Re: Segfault in memcpy() .. help... :)

From: Rasmus R\xnlev (raro94ab@hp4.econ.cbs.dk)
Date: 04/11/96


On Wed, 10 Apr 1996, Michael J. Cunningham wrote:

> On Thu, 11 Apr 1996, Rasmus Rxnlev wrote:
> 
> > (gdb) back       This is the same output as with the where cmd.
> > #0  0xdf66231c in _memcpy ()
> > #1  0xdf69e6a8 in _doprnt ()
> > #2  0xdf6ab16c in sprintf ()
> > #3  0xa9244 in write_aliases (ch=0x8f69c8) at alias.c:35
> 
> Without being able to determine the exact line in your program that
> it died..you didnt list it, I would say that you are trying to 
> sprintf a null pointer into a buffer. This is proably the cause of
> the _memcpy problem. Put a check in before the sprintf to make sure
> that the variable is not null before trying to copy it to the buffer.

Well... How di I do that ?
I am using GDB on the CORE file, if there is a way to make gdb show at 
what line in the CircleMUD code it crashed.. uhm.. Please enlighten me :)

Allso.. if anyone has an idea if there is some mini-hacker help/doc file 
on GDB somewhere I'd be gratefull... the gdb help pages just spam me 
without really helping me a lot.. *sulk*

Regards,
Con

d.
--
***************************************************************************
*                            *    Visit my homepage:                      *
*   Rasmus Rønlev DOEK'94    *    http://www.econ.cbs.dk/people/raro94ab  *
*   Student instructor       *    Visit my Multi User Dungeon (MUD):      *
*                            *    ns3.ptd.net 5000 or 198.80.46.3 5000    *   
***************************************************************************
*                                                                         *
*      Student, B.Sc in Computer Science and Business Administration      *
*                                                                         *
***************************************************************************



This archive was generated by hypermail 2b30 : 12/18/00 PST