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

Re: portmap segfault and gdb unusable



On Thu, May 31, 2007 at 05:52:23PM +0200, seb@frankengul.org wrote:
> 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
> 

The main difference between the two is the -pie option at the link.
If I remove this when linking the portmap is ok.

Seems that collect2 or ld produced something really bad when given this option.

	Seb



Reply to: