Segmentation fault of unknown cause

31 views
Skip to first unread message

yugo4k

unread,
Sep 23, 2011, 12:26:59 PM9/23/11
to TANGO Project - ALGENCAN
Hello,

I modified the file toyprob.c according to the problem I'm trying to
solve; it compiled but had a segmentation fault on execution.

The following functions were modified:
evalf
evalg
evalh
evalc
evaljac
evalhc

Since segmentation faults are usually related to off bound indexes, I
checked each array and loop but got nothing out of the expected. My
problem has 7 variables, 7 equality constraints and every bound seems
to be respected (according to the toyprob example): arrays going from
0 to 6 and index of constraint going from 1 to 7.

Using gdb, all I got was:
Program received signal SIGSEGV, Segmentation fault.
0x00000000004018a8 in Evaljac ()
Current language: auto; currently asm


The last function called in toyprob.c before the segmentation fault is
evaljac, with just the first ind of value 1. A little after the
program exits the function, the segmentation fault occurs.

Can anyone give some hint as to how to fix this?

Thanks,

Yugo

Ernesto G. Birgin

unread,
Sep 23, 2011, 1:10:23 PM9/23/11
to tango-...@googlegroups.com
Yugo, hi!

Are you using the C interface?

All I can say with the information you sent is that the most probable cause is some error in your user-supplied subroutines that describe the problem.

Can you please send to the list the smallest piece of code that reproduces the error?

Regards,
Ernesto.

Yugo K

unread,
Sep 24, 2011, 10:20:56 AM9/24/11
to tango-...@googlegroups.com
Hi Ernesto,

Thank you so much for your answer.

My code is a bit big; so searching for ways to reduce it to the problematic part, I wound up founding a terrible mistake on my part.
I left out the *jcnnz line (in evaljac), so that a value was never attributed to it in my code. I guess it is this variable that allocates memory for the attribution of the derivative values of the equations of constraint.

I'm sorry for disturbing you guys on such a foolish mistake on my part and thank you again for your attention.

Best regards,

Yugo



--
You received this message because you are subscribed to the Google Groups "TANGO Project - ALGENCAN" group.
To view this discussion on the web visit https://groups.google.com/d/msg/tango-project/-/SW8uibgqmb4J.
To post to this group, send email to tango-...@googlegroups.com.
To unsubscribe from this group, send email to tango-projec...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/tango-project?hl=en.

Reply all
Reply to author
Forward
0 new messages