0

I'm new to valgrind. While trying to check my small program, I'm getting this error:

==973== Process terminating with default action of signal 11 (SIGSEGV)
==973==  Bad permissions for mapped region at address 0x57E
==973==    at 0x57E: ???
==973==    by 0x400C3BA: _dl_signal_error (in /lib64/ld-2.4.so)
==973==    by 0x400B82F: _dl_map_object_deps (in /lib64/ld-2.4.so)
==973==    by 0x4002ED9: dl_main (in /lib64/ld-2.4.so)
==973==    by 0x4011F81: _dl_sysdep_start (in /lib64/ld-2.4.so)
==973==    by 0x4001245: _dl_start (in /lib64/ld-2.4.so)
==973==    by 0x4000A87: ??? (in /lib64/ld-2.4.so)

==973== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
==973==
==973== 1 errors in context 1 of 1:
==973== Jump to the invalid address stated on the next line
==973==    at 0x57E: ???
==973==    by 0x400C3BA: _dl_signal_error (in /lib64/ld-2.4.so)
==973==    by 0x400B82F: _dl_map_object_deps (in /lib64/ld-2.4.so)
==973==    by 0x4002ED9: dl_main (in /lib64/ld-2.4.so)
==973==    by 0x4011F81: _dl_sysdep_start (in /lib64/ld-2.4.so)
==973==    by 0x4001245: _dl_start (in /lib64/ld-2.4.so)
==973==    by 0x4000A87: ??? (in /lib64/ld-2.4.so)
==973==  Address 0x57e is not stack'd, malloc'd or (recently) free'd
==973==
==973== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

This kind of errors are AFAIK due to an incorrect memory access. The library is trying to access a memory area which is not mapped in its memory space.

Did valgrind stop without checking the whole program? Or does it mean that my app is ok? How can I fix the existing problem?

MaMu
  • 1,837
  • 4
  • 20
  • 36
  • 2
    Did you build your program with debug information (e.g. the `-g` flag with gcc)? It might help in giving more information from Valgrind. Also, it might be useful to also try and run your program in a debugger. Also, try to enable more warnings when you compile, you might be doing something which is technically not an error but still causes undefined behavior. Warning messages are often a sign of that. – Some programmer dude Dec 18 '13 at 15:38
  • Sorry! I have forgotten to set my ld_lib path.. Now I'm getting much more output! As you can see it was /lib64/ld-2.4.so which crashed valgrind, so i had no code. – MaMu Dec 18 '13 at 15:47
  • How do you build (compile/link) your small program? And if it's really small posting it won't hurt. – Some programmer dude Dec 18 '13 at 15:57
  • I'm using this: gcc `pkg-config --cflags glib-2.0` -g -Wall -O0 -o httpget c.c `pkg-config --libs glib-2.0` -locilib Well, its around 450 lines long, so i guess too long for posting... But my question how to get valgrind work, which works now. I try to fix it and ask againg if i gets more problems... – MaMu Dec 18 '13 at 16:03
  • If you have got an answer to your question you could answer your own question with that solution and accept it (which you can a few days after you posted your answer). That way this question will get an accepted answer. – thoni56 Dec 08 '18 at 13:21

0 Answers0