Port-sparc archive

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

Re: atomic_cas_ulong_ni segmentation fault



On Thursday 06 March 2008 13:58:26 Andrew Doran wrote:
> On Thu, Mar 06, 2008 at 01:36:58PM +0000, raymond.meyer%rambler.ru@localhost 
> wrote:
> > I'm running 32-bit sparc port of NetBSD 4.99.55 with netbsd_sun4u kernel
> > on Ultra 10. The userland and kernel were compiled
> > with '-Os -mcpu=ultrasparc -mvis'
> >
> > #include <stdio.h>
> > int main(void)
> > {
> >     printf("hey\n");
> >     return 0;
> > }
> >
> > If I compile the above program with 'gcc test.c -lpthread' and then run
> > the executable, it dies with SEGV.
> >
> > Running gdb on the core file outputs the following:
> >
> > Program terminated with signal 11, Segmentation fault
> > #0 0x40117324 in atomic_cas_ulong_ni () from /usr/lib/libc.so.12
>
> Please provide:
>
> - backtrace
> - dissasembly of atomic_cas_ulong_ni() (disassemble atomic_cas_ulong_ni)
> - registers (info reg)
>
> Thanks,
> Andrew

see attachement
Script started on Thu Mar  6 14:45:02 2008
# gdb a.out a.out.core
GNU gdb 6.5
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "sparc--netbsdelf"...(no debugging symbols found)

Reading symbols from /usr/lib/libpthread.so.0...(no debugging symbols 
found)...done.
Loaded symbols for /usr/lib/libpthread.so.0
Reading symbols from /usr/lib/libsparc_v8.so.0...(no debugging symbols 
found)...done.
Loaded symbols for /usr/lib/libsparc_v8.so.0
Reading symbols from /usr/lib/libc.so.12...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libc.so.12
Reading symbols from /usr/libexec/ld.elf_so...(no debugging symbols 
found)...done.
Loaded symbols for /usr/libexec/ld.elf_so

Core was generated by `a.out'.
Program terminated with signal 11, Segmentation fault.
#0  0x40117324 in atomic_cas_ulong_ni () from /usr/lib/libc.so.12
(gdb) bt
#0  0x40117324 in atomic_cas_ulong_ni () from /usr/lib/libc.so.12
#1  0x400671d4 in pthread_mutex_lock () from /usr/lib/libpthread.so.0
#2  0x4012ba28 in free () from /usr/lib/libc.so.12
#3  0x4012cf9c in malloc () from /usr/lib/libc.so.12
#4  0x4010d264 in pthread_atfork () from /usr/lib/libc.so.12
#5  0x4006a2e0 in pthread__init () from /usr/lib/libpthread.so.0
#6  0x400dd264 in ether_ntohost () from /usr/lib/libc.so.12
#7  0x40170c94 in __errno () from /usr/lib/libc.so.12
#8  0x400c4fc4 in _init () from /usr/lib/libc.so.12
#9  0x40023a70 in _rtld_call_init_functions () from /usr/libexec/ld.elf_so
#10 0x40024414 in _rtld () from /usr/libexec/ld.elf_so
#11 0x40022ef4 in _rtld_start () from /usr/libexec/ld.elf_so
#12 0x40022ef4 in _rtld_start () from /usr/libexec/ld.elf_so
Previous frame identical to this frame (corrupt stack?)
(gdb) disassemble atomic_cas_ulong_ni
Dump of assembler code for function atomic_cas_ulong_ni:
0x40117314 <atomic_cas_ulong_ni+0>:     srl  %o0, 3, %o5
0x40117318 <atomic_cas_ulong_ni+4>:     and  %o5, 0x3ff, %o5
0x4011731c <atomic_cas_ulong_ni+8>:     sethi  %hi(0xfffffc00), %o3
0x40117320 <atomic_cas_ulong_ni+12>:    add  %o5, %o3, %o5
0x40117324 <atomic_cas_ulong_ni+16>:    ldstub  [ %o5 ], %o3
0x40117328 <atomic_cas_ulong_ni+20>:    tst  %o3
0x4011732c <atomic_cas_ulong_ni+24>:    be,a   0x40117344 
<atomic_cas_ulong_ni+48>
0x40117330 <atomic_cas_ulong_ni+28>:    nop 
0x40117334 <atomic_cas_ulong_ni+32>:    nop 
0x40117338 <atomic_cas_ulong_ni+36>:    nop 
0x4011733c <atomic_cas_ulong_ni+40>:    b,a   0x40117324 
<atomic_cas_ulong_ni+16>
0x40117340 <atomic_cas_ulong_ni+44>:    nop 
0x40117344 <atomic_cas_ulong_ni+48>:    ld  [ %o0 ], %o3
0x40117348 <atomic_cas_ulong_ni+52>:    cmp  %o1, %o3
0x4011734c <atomic_cas_ulong_ni+56>:    be,a   0x40117354 
<atomic_cas_ulong_ni+64>
0x40117350 <atomic_cas_ulong_ni+60>:    st  %o2, [ %o0 ]
0x40117354 <atomic_cas_ulong_ni+64>:    clrb  [ %o5 ]
0x40117358 <atomic_cas_ulong_ni+68>:    retl 
0x4011735c <atomic_cas_ulong_ni+72>:    mov  %o3, %o0
End of assembler dump.
(gdb) info reg
g0             0x0      0
g1             0x3000000        50331648
g2             0x81c06314       -2118098156
g3             0x310045c        51381340
g4             0xf0000000       -268435456
g5             0x0      0
g6             0x0      0
g7             0x0      0
o0             0x40192dbc       1075391932
o1             0x0      0
o2             0xffe00000       -2097152
o3             0xfffffc00       -1024
o4             0x0      0
o5             0xfffffdb7       -585
sp             0xffffc420       0xffffc420
o7             0x400671cc       1074164172
l0             0x0      0
l1             0x0      0
l2             0x0      0
l3             0x0      0
l4             0x0      0
l5             0x0      0
l6             0x0      0
l7             0x4007c0dc       1074249948
i0             0x40192dac       1075391916
i1             0x0      0
i2             0x0      0
i3             0x0      0
i4             0x0      0
i5             0x0      0
fp             0xffffc488       0xffffc488
i7             0x4012ba20       1074969120
y              0x0      0
psr            0x4400000        71303168
wim            0x0      0
tbr            0x0      0
pc             0x40117324       0x40117324 <atomic_cas_ulong_ni+16>
npc            0x40117328       0x40117328 <atomic_cas_ulong_ni+20>
fsr            0x400671cc       1074164172
csr            0x0      0
(gdb) quit
# ^D
Script done on Thu Mar  6 14:45:52 2008


Home | Main Index | Thread Index | Old Index