help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] Calling the same LP repeatedly - segmentation fault


From: Heinrich Schuchardt
Subject: Re: [Help-glpk] Calling the same LP repeatedly - segmentation fault
Date: Sat, 7 May 2016 18:50:25 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.7.0

On 05/07/2016 05:54 AM, Krishna wrote:
> I have all the attached files in examples directory in GLPK and I used
> these commands:
> gcc -c May5.c
> gcc -o go May5.c new_ssp.c -lglpk -lm
> ./go


Hello Krishna,

you can use parameter -g for full debug information (including line
numbers):

gcc -g -c May5.c
gcc -g -o go May5.c new_ssp.c -lglpk -lm
valgrind ./go


Valgrind finds some problems:

==12429== Conditional jump or move depends on uninitialised value(s)
==12429==    at 0x403505: closest_egress (May5.c:633)
==12429==    by 0x402E0D: proximity_constraint (May5.c:483)
==12429==    by 0x401F5A: main (May5.c:231)
==12429==
==12429== Conditional jump or move depends on uninitialised value(s)
==12429==    at 0x40358F: closest_egress (May5.c:644)
==12429==    by 0x402E0D: proximity_constraint (May5.c:483)
==12429==    by 0x401F5A: main (May5.c:231)
==12429==

==12429== Invalid read of size 4
==12429==    at 0x404623: successive_shortest_path (new_ssp.c:321)
==12429==    by 0x4040C6: Bipartite (new_ssp.c:200)
==12429==    by 0x402BB5: GAP (May5.c:442)
==12429==    by 0x402110: main (May5.c:256)
==12429==  Address 0xffe9bef88 is on thread 1's stack
==12429==  in frame #1, created by Bipartite (new_ssp.c:19)

==12429== Process terminating with default action of signal 11 (SIGSEGV)
==12429==  Access not within mapped region at address 0xFFFFFFFFFABF6040
==12429==    at 0x404417: successive_shortest_path (new_ssp.c:269)
==12429==    by 0x4040C6: Bipartite (new_ssp.c:200)
==12429==    by 0x402BB5: GAP (May5.c:442)
==12429==    by 0x402110: main (May5.c:256)
==12429==  If you believe this happened as a result of a stack
==12429==  overflow in your program's main thread (unlikely but
==12429==  possible), you can try to increase the size of the
==12429==  main thread stack using the --main-stacksize= flag.
==12429==  The main thread stack size used in this run was 8388608.

valgrind --main-stacksize=1000000000 ./go
only finds

==12499== Conditional jump or move depends on uninitialised value(s)
==12499==    at 0x40351F: closest_egress (May5.c:633)
==12499==    by 0x402E0D: proximity_constraint (May5.c:483)
==12499==    by 0x401F5A: main (May5.c:231)
==12499==
==12499== Conditional jump or move depends on uninitialised value(s)
==12499==    at 0x4035A9: closest_egress (May5.c:644)
==12499==    by 0x402E0D: proximity_constraint (May5.c:483)
==12499==    by 0x401F5A: main (May5.c:231)
==12499==

So it seems the the major problem in your program is that you use
excessive amounts of stack memory.

You should use malloc() to allocate memory for arrays and after usage
use free to deallocate it.

And you have to fix the
Conditional jump or move depends on uninitialised value(s)
problem.

Best regards

Heinrich Schuchardt



reply via email to

[Prev in Thread] Current Thread [Next in Thread]