libc-2.10.1 causes previously well-behaved program to abort

Hazel Russman hazel_russman at yahoo.co.uk
Sat Sep 19 16:23:22 UTC 2009


Tilman Sauerbeck wrote Thu, 17 Sep 2009 16:49:51 +0200
> I'm guessing that the program does something wrong, and that the error
> was tolerated by earlier glibc versions.
> 
> Try running the program in valgrind; that should give you more clues on
> where the heap corruption happens resp what causes it.
> 
> Regards,
> Tilman
> 
> -- 
You're right. I'm the one at fault here. According
 to valgrind, there's an illegal write operation
 which presumably corrupts my memory and 
(sometimes) causes the next g_malloc call to
 crash. The malloc thing was just a symptom of the
 real problem.

The statement that does the illegal write is a
 call to strcpy, which copies data originally read
 from the configuration file; that meshes exactly
 with what I noticed about the effects of changing
 this file. I think I can see what's illegal about
 it; it looks like I forgot to convert a void
 pointer to char. Anyway I'll have a go at fixing
 it now.

Thanks for introducing me to valgrind. It's an
 awsome program.

Hazel
-- 
Hazel Russman <hazel_russman at yahoo.co.uk>



More information about the CRUX mailing list