Re: portmap segfault and gdb unusable
On Thu, May 31, 2007 at 05:40:25PM +0200, seb@frankengul.org wrote:
> On Thu, May 31, 2007 at 02:46:51AM +0200, Thibaut VARENE wrote:
> > On 5/30/07, Sébastien Bernard <seb@frankengul.org> wrote:
> >
> > > I'm joining the oops text.
> >
> > It's not an Oops. It's "regular" userland fault.
>
> Ok, I'm not really familiar with the parisc land. I've (wrongly) assumed that since
> in the dmesg output, it should be related to the kernel (as it is on x86 and sparc).
>
> It is not.
>
> >
> > [snip]
> >
> > >EXT3 FS on sda7, internal journal
> > >EXT3-fs: mounted filesystem with ordered data mode.
> > >eth0: CSR0 00a09000
> >
> > ^^^ this is a bit surprising. It's apparently the tulip driver puking
> > something. Might be totally unrelated tho.
> >
> It maybe related to the hardware (two inboard ethernet interface + 1 quad board).
>
> >
> > >do_page_fault() pid=2163 command='portmap' type=15 address=0x823d3578
> > >vm_start = 0x411ea000, vm_end = 0x411eb000
> >
> > Type 15 is dtlb fault (such as loading from NULL pointer...)
> >
> > >IASQ: 00002027 00002027 IAOQ: 411e6af3 411e6af7
> > > IIR: 483a3dc9 ISR: 00002027 IOR: 823d3578
> > > CPU: 0 CR30: aec90000 CR31: 10410000
> > > ORIG_R28: 4039ebd8
> > > IAOQ[0]: 0x411e6af0
> > > IAOQ[1]: 0x411e6af4
> > > RP(r2): 0x411e6ad4
> >
> > It's a library at fault here (0x4... addresses). Find which one goofed
> > (ldd `which portmap`, find which library is linked to this address
> > space) and disassemble it to find what happened, if you really care ;)
>
> I do care (:p).
> -------------------
> seb@hpnux:~/dev/portmap-6.0$ ldd /sbin/portmap
> libwrap.so.0 => /lib/libwrap.so.0 (0x40018000)
> libc.so.6 => /lib/libc.so.6 (0x4070e000)
> libnsl.so.1 => /lib/libnsl.so.1 (0x402f5000)
> /lib/ld.so.1 (0x400c2000)
> --------------------
Things are going weirder and weirder.
If I debuild the portmap package I got the segfault.
I produced the folowing testcase :
---------------------------
seb:$cc -O2 -Wall -Wstrict-prototypes -fpie -DHOSTS_ACCESS -DCHECK_PORT -DIGNORE_SIGCHLD \
-DFACILITY=LOG_DAEMON -c portmap.c pmap_check.c from_local.c
seb:$cc -pie portmap.o pmap_check.o from_local.o -lwrap -o portmap
seb:$./portmap -d
Segmentation fault
seb:$
----------------------------
But if I do :
----------------------------
seb:$cc -O2 -Wall -Wstrict-prototypes -fpie -DHOSTS_ACCESS -DCHECK_PORT -DIGNORE_SIGCHLD \
-DFACILITY=LOG_DAEMON portmap.c pmap_check.c from_local.c -o portmap -lwrap
seb:$./portmap -d
portmap[10123]: cannot bind udp: Permission denied
seb:$
----------------------------
Strange isn't it ?
Seb
Reply to: