Bug#791537: Acknowledgement (nss: FTBFS on hppa: segmentation fault in PR_FindSymbol)

2015-08-05 Thread John David Anglin
On 2015-08-05, at 4:54 PM, Mike Hommey wrote:

 On Wed, Aug 05, 2015 at 01:31:43PM -0400, John David Anglin wrote:
 This is caused by a bug in debian/rules.  The LD_LIBRARY_PATH used for the 
 shlibsign command does not
 contain the path to libsoftokn3.so.  As a result, PORT_LoadLibraryFromOrigin 
 doesn't find the library and the variable
 lib is NULL.
 
 The thing is, it should be trying to load nss/libsoftokn3.so from the
 directory containing libnss3.so. This works fine on other architectures,
 by the way.


If I was to guess, I would have to think the dladdr call in 
PR_GetLibraryFilePathname_stub fails because
hppa uses function descriptors for indirect calls.  Did this work for ia64?  
There seems to be some  trickiness
there.

I removed my debugging build, so it will be some time before I can investigate 
further.

Dave
--
John David Anglin   dave.ang...@bell.net


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#791537: Acknowledgement (nss: FTBFS on hppa: segmentation fault in PR_FindSymbol)

2015-08-05 Thread John David Anglin
On 2015-08-05, at 5:50 PM, John David Anglin wrote:

 If I was to guess, I would have to think the dladdr call in 
 PR_GetLibraryFilePathname_stub fails because
 hppa uses function descriptors for indirect calls.  Did this work for ia64?  
 There seems to be some  trickiness
 there.

Not quite right but close.  PR_GetLibraryFilePathname() is actually in 
/usr/lib/hppa-linux-gnu/libnspr4.so.
This hunk is used:

#if defined(USE_DLFCN)  defined(HAVE_DLADDR)
Dl_info dli;
char *result;

if (dladdr((void *)addr, dli) == 0) {
PR_SetError(PR_LIBRARY_NOT_LOADED_ERROR, _MD_ERRNO());
DLLErrorInternal(_MD_ERRNO());
return NULL;
}
result = PR_Malloc(strlen(dli.dli_fname)+1);
if (result != NULL) {
strcpy(result, dli.dli_fname);
}
return result;

PR_GetLibraryFilePathname is passed the following:

Breakpoint 1, 0xfc4e09d4 in PORT_LoadLibraryFromOrigin ()
   from debian/libnss3/usr/lib/hppa-linux-gnu/libnssutil3.so
(gdb) p/x $r25
$11 = 0x173f2
(gdb) p (char *)$r26
$12 = 0x15ff0 libnssutil3.so

$r5 contains a function pointer pointing to a function descriptor:
(gdb) x/2x 0x173f0
0x173f0:0x0001756c  0x000c

0x0001756c is the address of a stub:
(gdb) disass 0x0001756c,0x0001756c+8
Dump of assembler code from 0x1756c to 0x17574:
   0x0001756c:  b,l 0x17560,r20
   0x00017570:  depwi 0,31,2,r20

On return from dladdr, dli contains:
Breakpoint 5, 0xfc6bd74c in PR_GetLibraryFilePathname ()
   from /usr/lib/hppa-linux-gnu/libnspr4.so
(gdb) p/x $sp-0x78
$8 = 0xfd703a08
(gdb) x/4x 0xfd703a08
0xfd703a08: 0xfd7016e1  0x0001  0x  0x
(gdb) p (char *)0xfd7016e1
$9 = 0xfd7016e1 
/home/dave/debian/nss/nss-3.19.2/debian/libnss3-tools/usr/bin/shlibsign

Thus, dladdr doesn't correctly handle function pointers on hppa.  On the other 
hand, it's
not clear how dladdr can tell the difference between a data pointer and a 
function pointer.

Dave
--
John David Anglin   dave.ang...@bell.net


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#791537: Acknowledgement (nss: FTBFS on hppa: segmentation fault in PR_FindSymbol)

2015-08-05 Thread Mike Hommey
On Wed, Aug 05, 2015 at 01:31:43PM -0400, John David Anglin wrote:
 This is caused by a bug in debian/rules.  The LD_LIBRARY_PATH used for the 
 shlibsign command does not
 contain the path to libsoftokn3.so.  As a result, PORT_LoadLibraryFromOrigin 
 doesn't find the library and the variable
 lib is NULL.

The thing is, it should be trying to load nss/libsoftokn3.so from the
directory containing libnss3.so. This works fine on other architectures,
by the way.

Mike


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#791537: Acknowledgement (nss: FTBFS on hppa: segmentation fault in PR_FindSymbol)

2015-08-05 Thread John David Anglin
This is caused by a bug in debian/rules.  The LD_LIBRARY_PATH used for the 
shlibsign command does not
contain the path to libsoftokn3.so.  As a result, PORT_LoadLibraryFromOrigin 
doesn't find the library and the variable
lib is NULL.

The assert is optimized away.  Thus, it might help if shlibsign printed an 
error message when a library is not
found.

Attached is a patch which fixes build on hppa.  Pleas apply.

There is an issue with buildd dependencies for hppa and some other ports:

nss build-depends on missing:
- empty-dependency-after-parsing

Thanks,
Dave
--
John David Anglin   dave.ang...@bell.net


--- debian/rules.save   2015-06-20 17:27:31.0 -0400
+++ debian/rules2015-08-05 12:33:59.625818701 -0400
@@ -168,7 +168,7 @@
$(if $(wildcard $(call manpage,$(bin))),$(call cmd,install -m 
644 -T $(call manpage,$(bin)) $(DISTDIR)/man/nss-$(bin).1)))
 
 ifeq ($(DEB_HOST_ARCH),$(DEB_BUILD_ARCH))
-SHLIBSIGN = LD_LIBRARY_PATH=debian/libnss3/usr/lib/$(DEB_HOST_MULTIARCH) 
debian/libnss3-tools/usr/bin/shlibsign
+SHLIBSIGN = 
LD_LIBRARY_PATH=debian/libnss3/usr/lib/$(DEB_HOST_MULTIARCH):debian/libnss3/usr/lib/$(DEB_HOST_MULTIARCH)/nss
 debian/libnss3-tools/usr/bin/shlibsign
 else
 SHLIBSIGN = shlibsign
 endif