-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hey guys,
I have a problem with a seg fault inside of glibc's malloc and I don't have any clue how to solve it. My program calls malloc(x) several times, where x is never negative nor 0. But on one particular malloc() it always crashes. running my program with valgrind gives me the following hints: - --15446-- VALGRIND INTERNAL ERROR: Valgrind received a signal 11 (SIGSEGV) - exiting - --15446-- si_code=1; Faulting address: 0x2D11153860; sp: 0x40317bdd0 valgrind: the 'impossible' happened: Killed by fatal signal ==15446== at 0x38032A94: unlinkBlock (m_mallocfree.c:245) ==15446== by 0x3803453D: vgPlain_arena_malloc (m_mallocfree.c:1381) ==15446== by 0x3800292E: vgMemCheck_new_block (mc_malloc_wrappers.c:201) ==15446== by 0x38002C98: vgMemCheck_malloc (mc_malloc_wrappers.c:238) ==15446== by 0x3806140E: vgPlain_scheduler (scheduler.c:1394) ==15446== by 0x3808598A: run_a_thread_NORETURN (syswrap-linux.c:94) sched status: running_tid=1 Thread 1: status = VgTs_Runnable ==15446== at 0x4C2668A: malloc (vg_replace_malloc.c:236) ==15446== by 0x4058CD: sort(unsigned int**, unsigned int, unsigned int) (facedetect.cpp:288) ==15446== by 0x407F31: findScrambledArea(cv::Mat&) (facedetect.cpp:312) ==15446== by 0x40AFED: runOperation(Mode, CryptoKey const&, DetectorParams&, std::string, std::string, std::string, bool) (facedetect.cpp:625) ==15446== by 0x40BCC8: main (facedetect.cpp:700) The code in line 288 of facedetect.cpp looks harmless: int* data = (int*) malloc(10); I tried to run it without valgrind, and for sizes smaller than ~800 my program seems to run. For anything bigger I get a glibc error. *** glibc detected *** ./facescramble: malloc(): memory corruption: 0x000000000062b3a0 *** ======= Backtrace: ========= /lib64/libc.so.6(+0x72f66)[0x7f47a5066f66] /lib64/libc.so.6(+0x75ffb)[0x7f47a5069ffb] /lib64/libc.so.6(__libc_malloc+0x70)[0x7f47a506bde0] ./facescramble[0x4058ce] ./facescramble[0x407f32] ./facescramble[0x40afee] ./facescramble[0x40bcc9] /lib64/libc.so.6(__libc_start_main+0xfd)[0x7f47a5012d2d] ./facescramble[0x4041e9] Does anyone have any ideas why that might occur?! My glibc version is: sys-libs/glibc-2.12.2 and I just recompiled it on gentoo to enable the splitdebug feature which is necessary to run valgrind. Thanks, Stephanie -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk37TDkACgkQDQRlsUJ1SFBuYgCfT4Qdg4c0D2p/PTbXJic/GAKR lkIAn30uA14679fi2Ik/U+zq8POGaQ2L =/VeC -----END PGP SIGNATURE----- ------------------------------------------------------------------------------ EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev _______________________________________________ Valgrind-users mailing list Valgrind-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-users