discuss-gnustep
[Top][All Lists]
Advanced

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

Re: pl2link crashes randomly


From: Sebastian Reitenbach
Subject: Re: pl2link crashes randomly
Date: Thu, 7 Apr 2011 14:58:07 +0200
User-agent: KMail/1.13.5 (Linux/2.6.34.7-0.7-xen; KDE/4.4.4; x86_64; ; )

On Thursday, April 07, 2011 01:43:33 pm David Chisnall wrote:
> On 7 Apr 2011, at 12:31, Sebastian Reitenbach wrote:
> > To actually be able to compile gnustep-base on OpenBSD with llvm (patch
> > is not needed with gcc) I have to apply the following patch, that David
> > suggested:
> > 
> > --- Source/NSObject.m.orig      Sun Apr  3 10:53:10 2011
> > +++ Source/NSObject.m   Mon Apr  4 17:16:24 2011
> > @@ -945,7 +947,7 @@ objc_create_block_classes_as_subclasses_of(Class
> > super
> > 
> >       finalize_imp = class_getMethodImplementation(self, finalize_sel);
> > 
> > #endif
> > 
> > -#if (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__)
> > +#if defined(__FreeBSD__) && defined(__i386__)
> > 
> >       // Manipulate the FPU to add the exception mask. (Fixes SIGFPE
> >       // problems on *BSD)
> >       // Note this only works on x86
> > 
> > While David was suggesting above patch, he also mentioned the SIGFPE that
> > might happen, but here I see in thread 4: sig=27
> 
> Note that I didn't say that this would fix things, just that it was worth
> testing whether it was actually (still) needed on OpenBSD.  The default
yes, I understood, therefore I did not (yet ;) bothered Richard to add this 
patch.

> behaviour for floating point exceptions should (I think) be to evaluate to
> some kind of NaN representation, rather than raise a signal.  It isn't on
> FreeBSD for some reason, but we now have a public interface for setting
> the behaviour, so we don't need the asm anymore (and, actually, it doesn't
> work on recent FreeBSD versions, because they keep undoing it on context
> switches based on what you set via the public function).
> 
> The point of this asm is to turn off FPU exceptions, so that the OS never
> sees them and they are not delivered as SIGFPE.
> 
> The fact that you're getting SIGPROF is a bit weird, but this code should
> not have anything to do with it.  Did you accidentally link against a
> profiling library, or specify something like -pg when compiling?  A simple
> fix should be to just mask SIGPROF here, but I'm not sure why the signal
> is being raised at all.  Can you try setting a breakpoint on setitimer()
> and see if it's hit (and the first argument is 2)?
> 
> David
> 
> -- Sent from my Difference Engine

As I said from within gdb, I did not reproduced the crasher, only outside gdb. 
I did:
(gdb) handle SIGPROF print
Signal        Stop      Print   Pass to program Description
SIGPROF       No        Yes     Yes             Profiling timer expired
(gdb) break setitimer(int, const struct itimerval *, struct itimerval *)
Function "setitimer(int, const struct itimerval *, struct itimerval *)" not 
defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (setitimer(int, const struct itimerval *, struct itimerval *)) 
pending.
(gdb) r PRICE.app/Resources/Info-gnustep.plist 
./PRICE.app/Resources/PRICE.desktop
Starting program: /usr/local/bin/pl2link PRICE.app/Resources/Info-
gnustep.plist ./PRICE.app/Resources/PRICE.desktop

Program received signal SIGPROF, Profiling timer expired.

Program received signal SIGPROF, Profiling timer expired.

Program received signal SIGPROF, Profiling timer expired.

Program received signal SIGPROF, Profiling timer expired.

Program received signal SIGPROF, Profiling timer expired.

Program exited normally.

So it receives this signal even more than once, maybe its even unrelated.

$ ldd /usr/local/bin/pl2link                                                    
                                                                                
                                                                                
 
/usr/local/bin/pl2link:
        Start    End      Type Open Ref GrpRef Name
        1c000000 3c004000 exe  1    0   0      /usr/local/bin/pl2link
        0aa68000 2abf5000 rlib 0    1   0      /usr/local/lib/libgnustep-
base.so.3.2
        0adec000 2adf6000 rlib 0    2   0      /usr/local/lib/libobjc.so.0.0
        09b94000 29b9b000 rlib 0    2   0      /usr/local/lib/libgmp.so.8.0
        06c67000 26c6c000 rlib 0    3   0      /usr/local/lib/libavahi-
common.so.0.0
        0377a000 2377f000 rlib 0    2   0      /usr/local/lib/libavahi-
client.so.0.0
        001b8000 201ca000 rlib 0    2   0      
/usr/local/lib/libgnutls.so.16.0
        0e8b7000 2e8d5000 rlib 0    3   0      
/usr/local/lib/libgcrypt.so.15.0
        00073000 2007d000 rlib 0    2   0      /usr/local/lib/libxslt.so.3.8
        0b896000 2b8bd000 rlib 0    3   0      /usr/local/lib/libxml2.so.12.0
        08993000 2899a000 rlib 0    5   0      /usr/lib/libz.so.4.1
        000a1000 20180000 rlib 0    9   0      /usr/local/lib/libiconv.so.6.0
        0055e000 20566000 rlib 0    7   0      /usr/lib/libm.so.5.2
        0c801000 2c805000 rlib 0    2   0      /usr/local/lib/libffi.so.0.0
        0f6c1000 2f6ca000 rlib 0    3   0      /usr/lib/libpthread.so.13.1
        0a0c4000 2a110000 rlib 0    2   0      
/usr/local/lib/libicui18n.so.3.0
        08d57000 28dab000 rlib 0    3   0      /usr/local/lib/libicuuc.so.3.0
        01602000 22441000 rlib 0    4   0      
/usr/local/lib/libicudata.so.3.0
        014ec000 21520000 rlib 0    1   0      /usr/lib/libc.so.58.0
        04b57000 24b5b000 rlib 0    5   0      /usr/local/lib/libintl.so.5.0
        0ada6000 2adb1000 rlib 0    1   0      /usr/local/lib/libdbus-1.so.9.1
        0256c000 22571000 rlib 0    1   0      /usr/local/lib/libtasn1.so.2.0
        0f7cc000 2f7d1000 rlib 0    2   0      /usr/local/lib/libgpg-
error.so.3.1
        052b9000 252e7000 rlib 0    2   0      /usr/lib/libstdc++.so.50.0
        0d52e000 0d52e000 rtld 0    1   0      /usr/libexec/ld.so

here is another backtrace, slightly different:
(gdb) thread apply all bt

Thread 4 (process 23475, thread 0x865e4800):
#0  _thread_kern_sched (scp=0xcfbfc42c) at 
/usr/src/lib/libpthread/uthread/uthread_kern.c:488
#1  0x092db1f0 in _thread_sig_handler (sig=27, info=0xcfbfc480, 
scp=0xcfbfc42c) at /usr/src/lib/libpthread/uthread/uthread_sig.c:86
#2  <signal handler called>
#3  0x0f223b5d in _dl_sigprocmask () from /usr/libexec/ld.so
#4  0x0f225f1e in _dl_thread_bind_lock () from /usr/libexec/ld.so
#5  0x0f22731c in _dl_bind () from /usr/libexec/ld.so
#6  0x0f223b87 in _dl_bind_start () from /usr/libexec/ld.so
#7  0x8b522ed0 in ?? ()
#8  0x00000a38 in ?? ()
#9  0x2d950033 in gs_tolower_map () from /usr/local/lib/libgnustep-base.so.3.2
#10 0x2d8e0033 in .objc_selector_list () from /usr/local/lib/libgnustep-
base.so.3.2
#11 0x00000008 in ?? ()
#12 0x2d954844 in ?? () from /usr/local/lib/libgnustep-base.so.3.2
#13 0xcfbfc7ec in ?? ()
#14 0x2d954844 in ?? () from /usr/local/lib/libgnustep-base.so.3.2
#15 0x00000000 in ?? ()

Thread 3 (process 23475, thread 0x85107400):
#0  _thread_kern_sched (scp=0x0) at 
/usr/src/lib/libpthread/uthread/uthread_kern.c:488
#1  0x092da736 in _thread_kern_sched_state (state=PS_SLEEP_WAIT, 
fname=0x292c71fc "/usr/src/lib/libpthread/uthread/uthread_nanosleep.c", 
lineno=84) at /usr/src/lib/libpthread/uthread/uthread_kern.c:561
#2  0x092cd972 in nanosleep (time_to_sleep=0x87d55f74, time_remaining=0x0) at 
/usr/src/lib/libpthread/uthread/uthread_nanosleep.c:84
#3  0x06a45aee in usleep (useconds=Variable "useconds" is not available.
) at /usr/src/lib/libc/gen/usleep.c:46
#4  0x034cd2f3 in selector_table_collect_garbage (t=Variable "t" is not 
available.
) at hash_table.h:138
#5  0x034ceca6 in runloop (q=Variable "q" is not available.
) at toydispatch.c:197
#6  0x092d15be in _thread_start () at 
/usr/src/lib/libpthread/uthread/uthread_create.c:242
#7  0x0000002b in ?? ()
#8  0x00000000 in ?? ()

Thread 2 (process 23475, thread 0x85107c00):
#0  0x06a6476d in kill () from /usr/lib/libc.so.58.0
#1  0x06a9baf3 in __stack_smash_handler (func=0x292c7fd6 "_spinlock_debug", 
damaged=690779960) at /usr/src/lib/libc/sys/stack_protector.c:89
#2  0x092db36d in _spinlock_debug (lck=Variable "lck" is not available.
) at /usr/src/lib/libpthread/uthread/uthread_spinlock.c:109
#3  0x092d2c72 in _thread_malloc_lock () at 
/usr/src/lib/libpthread/thread/thread_malloc_lock.c:14
#4  0x06ac4d3d in malloc (size=3) at /usr/src/lib/libc/stdlib/malloc.c:1218
#5  0x06aaa592 in strdup (str=0x292c75fa "GC") at 
/usr/src/lib/libc/string/strdup.c:45
#6  0x092db44a in pthread_set_name_np (thread=0x85107c00, name=0x292c75fa 
"GC") at /usr/src/lib/libpthread/uthread/uthread_info_openbsd.c:472
#7  0x092d19fe in _thread_gc (arg=0x0) at 
/usr/src/lib/libpthread/uthread/uthread_gc.c:73
#8  0x092d15be in _thread_start () at 
/usr/src/lib/libpthread/uthread/uthread_create.c:242
#9  0x0000002b in ?? ()
#10 0x00000000 in ?? ()

Thread 1 (process 23475):
#0  0x06a6476d in kill () from /usr/lib/libc.so.58.0
#1  0x06a9baf3 in __stack_smash_handler (func=0x292c7fd6 "_spinlock_debug", 
damaged=690779960) at /usr/src/lib/libc/sys/stack_protector.c:89
#2  0x092db36d in _spinlock_debug (lck=Variable "lck" is not available.
) at /usr/src/lib/libpthread/uthread/uthread_spinlock.c:109
#3  0x092d2c72 in _thread_malloc_lock () at 
/usr/src/lib/libpthread/thread/thread_malloc_lock.c:14
#4  0x06ac4d3d in malloc (size=3) at /usr/src/lib/libc/stdlib/malloc.c:1218
#5  0x06aaa592 in strdup (str=0x292c75fa "GC") at 
/usr/src/lib/libc/string/strdup.c:45
#6  0x092db44a in pthread_set_name_np (thread=0x85107c00, name=0x292c75fa 
"GC") at /usr/src/lib/libpthread/uthread/uthread_info_openbsd.c:472
#7  0x092d19fe in _thread_gc (arg=0x0) at 
/usr/src/lib/libpthread/uthread/uthread_gc.c:73
#8  0x092d15be in _thread_start () at 
/usr/src/lib/libpthread/uthread/uthread_create.c:242
#9  0x0000002b in ?? ()
#10 0x00000000 in ?? ()



reply via email to

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