bug-gnubg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnubg] Compile & crash on Solaris


From: Jim Segrave
Subject: Re: [Bug-gnubg] Compile & crash on Solaris
Date: Fri, 3 Jan 2003 00:48:10 +0100
User-agent: Mutt/1.2.5.1i

On Thu 02 Jan 2003 (22:45 +0000), Joern Thyssen wrote:
> On Thu, Jan 02, 2003 at 10:57:15PM +0100, Holger wrote
> > Hi all,
> > 
> > The main problem is that the programme doesn't run. It crashs almost right
> > away.
> > 
> > As I'm at university I cannot install GNUbg under the default, but
> > /home/pub/lib/... . I ran configure with these options:
> > ./configure --enable-bearoff=external \
> >             --without-sound \
> >             --without-gtkextra \
> >             --prefix=/home/pub/lib/gnubg-`date +%y%m%d`
> > 
> > Here is the debug output of two invocations. How should GNUbg be invoked,
> > anyway, with --datadir or does it find it by itself?
> 
> gnubg should use whatever you've specified with --prefix above as the
> default datadir.
> > 
> > (gdb) run
> > 
> > Program received signal SIGSEGV, Segmentation fault.
> > 0xfe6331b4 in strlen ()
> > (gdb) bt
> > #0  0xfe6331b4 in strlen ()
> > #1  0xfe6860f0 in _doprnt ()
> > #2  0xfe687eb8 in sprintf ()
> > #3  0x6f188 in PathSearch (szFile=0xbdac0 "met/zadeh.xml", szDir=0x0) at
> > path.c:86
> > #4  0x4ac5c in readMET (pmd=0xffbe9b58, szFileName=0xbdac0 "met/zadeh.xml",
> > szDir=0x0)
> >     at matchequity.c:1273
> > #5  0x4b47c in InitMatchEquity (szFileName=0xbdac0 "met/zadeh.xml",
> > szDir=0x0)
> >     at matchequity.c:1631
> > #6  0x2157c in real_main (closure=0x1, argc=1, argv=0xffbeeb84) at
> > gnubg.c:6352
> > #7  0x21b40 in main (argc=1, argv=0xffbeeb84) at gnubg.c:6612
> 
> This code seems to be the culprit (path.c line 85ff):
> 
>     sprintf( pch, "%s/%s", szDir, szFile );
>     if( !access( pch, R_OK ) )
>       return realloc( pch, strlen( pch ) + 1 );
> 
> I guess this should be
> 
>    if ( szDir ) {
>       sprintf( pch, "%s/%s", szDir, szFile );
>       if( !access( pch, R_OK ) )
>       return realloc( pch, strlen( pch ) + 1 );
>    }
> 
> I wonder why I works on all other platforms?!

Some librarys Xprintf functions test for null string pointers and
replace them with the character string '(null)'.:


In gdb:

    sprintf( pch, "%s/%s", szDir, szFile );
=>  if( !access( pch, R_OK ) )
        return realloc( pch, strlen( pch ) + 1 );
(gdb) p pch
$3 = 0x85ae000 "(null)/met/zadeh.xml"

Solaris libc isn't doing that.
 
-- 
Jim Segrave           address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]