Termination code 139

534 views
Skip to first unread message

Gyorgy

unread,
Jan 17, 2014, 11:35:43 AM1/17/14
to am...@googlegroups.com
Hi,
I have a nonlinear solver written in C++ interfaced to AMPL. I get the following error message after running it:

"error running ./mynonlinearsolver:
termination code 139; core file written"

However the code does terminate and gets the correct results but somehow at the very end I still have this error message my write_sol() function looks the following:

"write_sol(char* msg, double* x, NULL, NULL);"

The "msg" will actually print. However when I type 

"display x;"

it will display the starting point, but when I check separately the x pointer does point to the correct solution so somehow the x pointer I'm passing to write_sol() doesn't make it into the .sol file. Could this be because I'm using a double* instead of real*?

Any help is much appreciated!
Best,
Gyorgy 


victor.z...@gmail.com

unread,
Jan 17, 2014, 12:23:39 PM1/17/14
to am...@googlegroups.com
Hi Gyorgy,

"termination code 139" means segmentation fault. It is hard to say what is causing it in this case without looking at the actual code. It is possible that x array is not large enough.

I suggest building a debug version of the solver and running it under a debugger to see where exactly the segfault occurs. Or post the source code of your solver interface or at least a part of it that shows how you allocate x, msg and call write_sol.

HTH,
Victor

--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To post to this group, send email to am...@googlegroups.com.
Visit this group at http://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/groups/opt_out.

Gyorgy

unread,
Jan 20, 2014, 6:39:29 PM1/20/14
to am...@googlegroups.com
Hi Victor,
thanks a lot for your response the segfault was enough information to fix the issue! 
Best,
Gyorgy
Reply all
Reply to author
Forward
0 new messages