info-inventor-dev
[Top] [All Lists]

Re: Segfault bug in SoBlinker

To: Ben Wong <benjamin.wong@xxxxxxxxxxxxx>, info-inventor-dev@xxxxxxxxxxx
Subject: Re: Segfault bug in SoBlinker
From: "Jörn Beutner" <beutner@xxxxxxxxxxxxxxx>
Date: Fri, 3 May 2002 11:32:48 +0200
In-reply-to: <200205030838.EAA331452@xxxxxxxxxxxxxxxxxxxx>
References: <200205030838.EAA331452@xxxxxxxxxxxxxxxxxxxx>
Reply-to: beutner@xxxxxxxxxxxxxxx
Sender: owner-info-inventor-dev@xxxxxxxxxxx
   Hi Ben,

I have complied and run your test code on my Linux-PC (running SuSE-7.3 and 
sgi-OpenInventor-2.1.5-6). The executable produces the same result as you 
discribed. 


# Program received signal SIGSEGV, Segmentation fault.
# 0x40232622 in SbDict::findEntry (this=0x0, key=134530060) at SbDict.c++:218


I do not know if this is a bug or a feature, but a closer look at the 
debugger gives the following result at the line 218 of SbDict.c++. The 
variables this=0x0 and buckets=0x0 are not initialized and the code produces 
a segmentation fault consequently.


209: //
210: // Returns reference to entry with given key, or NULL if there is none.
211: //
212:    
213: SbDictEntry *&
214: SbDict::findEntry(unsigned long key) const
215: {
216:    SbDictEntry             **entry;
217:     
218:    entry = &buckets[key % tableSize];
219:    
220:    while (*entry != NULL) {
221:            if ((*entry)->key == key)
222:                break;
223:            entry = &(*entry)->next;
224:    }
225:    return *entry;
226: }


Unfortunately I am not that familiar with the details of OpenInventor so I 
can not give you any further hints.

        Joern

On Friday, 3. May 2002 10:38, Ben Wong wrote:
> Hi,
>
> It appears that if you allocate an SoBlinker before calling
> SoXt::init(), the program will die with a segmentation fault. This
> doesn't appear to be documented anywhere, nor mentioned on any
> web-page, so I assume it is a bug rather than an obscure feature.
> (Of course, it could just be me doing something silly, but it seems
> unlikely at this point).
>
> I have reproduced the bug on both NetBSD-1.5 with the LGPL version of
> Open Inventor-2.1.5-7 and on an SGI running IRIX 6.5 (with the stock
> Open Inventor). Both died with the same call stack (see below). I'd
> like to know if this bug still exists in the latest version of Open
> Inventor. Could someone please test it for me and post the results?
>
> Below I have included a minimal program to reproduce the bug. Comment
> out the line that defines BLINKBUG if you want to see the program run
> without dumping core.
>
>       Ben

<Prev in Thread] Current Thread [Next in Thread>