Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 190458 - net-nds/portmap-6.0 : portmap segfaults on HPPA when built as a PIE
Summary: net-nds/portmap-6.0 : portmap segfaults on HPPA when built as a PIE
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High critical (vote)
Assignee: HPPA Porters
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 190182
  Show dependency tree
 
Reported: 2007-08-27 20:44 UTC by Jeroen Roovers (RETIRED)
Modified: 2008-01-08 14:49 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge.info-elmer,4.63 KB, text/plain)
2007-08-27 21:07 UTC, Jeroen Roovers (RETIRED)
Details
Relevant info about the segfault as found in dmesg (portmap-6.0-segfault.dmesg,2.03 KB, text/plain)
2007-08-27 21:17 UTC, Jeroen Roovers (RETIRED)
Details
Patch to remove -pie from LDFLAGS (portmap-no-pie.patch,440 bytes, patch)
2007-12-24 13:57 UTC, Guy Martin (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeroen Roovers (RETIRED) gentoo-dev 2007-08-27 20:44:04 UTC
net-nds/portmap-5b-r9 works fine.
net-nds/portmap-6.0 causes a segmentation fault almost immediately:

# portmap -d
Segmentation fault
# strace -f portmap -d
execve("/sbin/portmap", ["portmap", "-d"], [/* 50 vars */]) = 0
brk(0)                                  = 0x410b9000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40000000
newuname({sys="Linux", node="elmer", ...}) = 0
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=0, st_size=0, ...}) = 0
mmap(NULL, 14371, PROT_READ, MAP_PRIVATE, 3, 0) = 0x4003a000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\2\1\3\0\0\0\0\0\0\0\0\0\3\0\17\0\0\0\1\0\1\356"..., 512) = 512
fstat64(3, {st_mode=0, st_size=0, ...}) = 0
mmap(NULL, 1391104, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x40234000
mmap(0x4037f000, 28672, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14a000) = 0x4037f000
mmap(0x40386000, 6656, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40386000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40001000
mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40002000
mprotect(0x410b3000, 20480, PROT_READ|PROT_WRITE) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40005000
mprotect(0x410b3000, 20480, PROT_READ|PROT_EXEC) = 0
munmap(0x4003a000, 14371)               = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
Process 21456 detached
Comment 1 SpanKY gentoo-dev 2007-08-27 21:02:41 UTC
works fine on hake ... but it has glibc-2.3.6

i doubt strace will be useful ... throw it into gdb
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2007-08-27 21:07:09 UTC
Created attachment 129373 [details]
emerge --info

gdb still has problems of its own, sadly.
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2007-08-27 21:11:22 UTC
# gdb portmap
GNU gdb 6.6
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 "hppa2.0-unknown-linux-gnu"...
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) run -d
Starting program: /sbin/portmap -d

Program received signal SIGSEGV, Segmentation fault.
0x410b4a94 in ?? ()
(gdb)
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2007-08-27 21:17:46 UTC
Created attachment 129375 [details]
Relevant info about the segfault as found in dmesg
Comment 5 Guy Martin (RETIRED) gentoo-dev 2007-12-24 13:56:42 UTC
This seems to be a linker bug.
If I remove -pie from the LDFLAGS in the Makefile, it works.
This is probably not the best solution.


Vapier, any comment on this ?
Comment 6 Guy Martin (RETIRED) gentoo-dev 2007-12-24 13:57:40 UTC
Created attachment 139254 [details, diff]
Patch to remove -pie from LDFLAGS
Comment 7 SpanKY gentoo-dev 2007-12-24 17:14:34 UTC
i'd forgotten that newer portmap adds -pie ... i thought PIE is known to be broken on hppa

this is why `nscd` segfaults for example

but i thought we fixed that too ?  it's been a while
Comment 8 Jeroen Roovers (RETIRED) gentoo-dev 2007-12-24 20:44:47 UTC
(In reply to comment #7)
> this is why `nscd` segfaults for example
> 
> but i thought we fixed that too ?  it's been a while

  29 Jul 2005; Mike Frysinger <vapier@gentoo.org>
  +files/2.3.4/hppa-no-pie.patch, glibc-2.3.2-r12.ebuild,
  glibc-2.3.3.20040420-r2.ebuild, glibc-2.3.4.20040619-r2.ebuild,
  glibc-2.3.4.20040808-r1.ebuild, glibc-2.3.4.20041102-r1.ebuild:
  Add patch to disable building nscd as PIE on hppa since PIE support is
  broken in glibc for parisc.
Comment 9 Guy Martin (RETIRED) gentoo-dev 2007-12-28 11:41:38 UTC
Commented out LDFLAGS on hppa in the ebuild.
Please test and I'll mark stable if it works for everybody.
Comment 10 Jeroen Roovers (RETIRED) gentoo-dev 2008-01-08 14:35:15 UTC
(In reply to comment #9)
> Commented out LDFLAGS on hppa in the ebuild.
> Please test and I'll mark stable if it works for everybody.

For the record: it works, but then it works just as well without this patch and with a properly patched glibc-2.7-r1.
Comment 11 Jeroen Roovers (RETIRED) gentoo-dev 2008-01-08 14:49:57 UTC
Let's call this fixed, then. :)