MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: mathlink program hanging in MLAnswer

  • To: mathgroup at
  • Subject: [mg15282] Re: mathlink program hanging in MLAnswer
  • From: kevinl (Kevin Leuthold)
  • Date: Thu, 31 Dec 1998 04:39:36 -0500
  • Organization: Wolfram Research, Inc.
  • References: <76cibk$>
  • Sender: owner-wri-mathgroup at


A MathLink program can hang at this point under quite normal

MLAnswer is a function that consists of a loop that reads packets off 
the link to Mathematica, and deals with these packets, until the link 
has been closed or there's an error on the link.

When a MathLink program is hanging inside of MLNextPacket within
MLAnswer, it means that the program is waiting for some input from
Mathematica. Once such input arrives on the link (usually because the
Mathematica  user called a function Installed by the MathLink program),
the call to MLNextPacket should return.

Your program will execute the loop in MLAnswer until the link is closed,
or there is an error.  Under normal circumstances, this will happen
when the Mathematica user Uninstalls your program.

Kevin Leuthold
MathLink Group
Wolfram Research

John Gore <gore_john at> writes:

>I have a mathlink program that hangs in MLAnswer. The program gets
>through all of my code and then hangs in MLAnswer within the mprep
>generated tm.c file on the line

>while( !MLDone && !MLError(mlp)
>	&& (pkt = MLNextPacket(mlp), pkt) && pkt == CALLPKT){

>on the second pass through this loop.

>Stepping through the code, I find that it hangs on the second "Step
>Into" on this line, perhaps this suggests the MLNextPacket(mlp) call.

>The program enters an infinite loop within MLMAP32 bouncing between
>01193D88   mov         eax,dword ptr [esp+10h] .
>01193DEA   cmp         edi,ebx
>01193DEC   jne         01193D88

>where 	edi =	4294967295
>	edx =	3220968560

>Any idea what's up?

  • Prev by Date: Re: List handling
  • Next by Date: Re: List handling
  • Previous by thread: mathlink program hanging in MLAnswer
  • Next by thread: problem with precision in NSolve