|
From: <and...@us...> - 2007-01-24 14:50:51
|
The stack trace explicitly tells you: the main() called libc fgets() which called libc getline() which called memcpy which had the invalid write. Your error is likely that you passed an invalid argument to fgets() from main(). Check the arguments you use to fgets on line 22 of gan.c and you'll probably find your error. Andrew val...@li... wrote on 01/24/2007 03:35:24 AM: > [image removed] > > [Valgrind-developers] backtrace option in valgrind . > > Vikas <cat...@gm...> > > to: > > valgrind-developers > > 01/24/07 04:13 AM > > Bcc: > > Andrew Lamb > > Hi , > > I get an output like this. > > ==26775== Invalid write of size 2 > POINT 1 . > ==26775== at 0x1B9879DA: memcpy (in /lib/tls/i686/cmov/libc-2.3.6.so) > ==26775== by 0x1B970FEE: _IO_getline (in /lib/tls/i686/cmov/libc- 2.3.6.so) > ==26775== by 0x1B96FF18: _IO_fgets (in /lib/tls/i686/cmov/libc-2.3.6.so) > ==26775== by 0x80484CD: main (gan.c:22) > ==26775== Address 0x1BA4E029 is 1 bytes inside a block of size 2 free'd > ==26775== at 0x1B9070B9: free (vg_replace_malloc.c:153) > ==26775== by 0x804848F: main (gan.c:13) > > > Is there any way to know what function was called before memcpy > which is below POINT1 ??? > > Waiting for reply. > vikas > > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Valgrind-developers mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-developers |