Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 483540 - =dev-libs/nss-3.15.1-r1 with clang: shlibsign segfaults
Summary: =dev-libs/nss-3.15.1-r1 with clang: shlibsign segfaults
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: systemwide-clang
  Show dependency tree
 
Reported: 2013-09-03 22:49 UTC by Stefan de Konink
Modified: 2024-04-20 12:29 UTC (History)
0 users

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


Attachments
emerge --info (emergeinfo.txt,4.12 KB, text/plain)
2013-09-05 10:55 UTC, Stefan de Konink
Details
build.log (build.log,509.07 KB, text/x-log)
2013-09-05 11:18 UTC, Stefan de Konink
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan de Konink 2013-09-03 22:49:25 UTC
The build fails on the generation of some certificates.

Generate a DSA key pair ... 
/var/tmp/portage/dev-libs/nss-3.15.1-r1/work/nss-3.15.1/nss/cmd/shlibsign/./sign.sh: line 13: 15945 Segmentation fault      "${2}"/shlibsign -v -i "${5}"
make[2]: *** [../../dist/Linux2.6_x86_clang_glibc_PTH_OPT.OBJ/lib/libsoftokn3.chk] Error 139


Reproducible: Always
Comment 1 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2013-09-05 09:53:03 UTC
Please comment with the output of `emerge --info` and attach the full build log.
Comment 2 Stefan de Konink 2013-09-05 10:55:38 UTC
Created attachment 357918 [details]
emerge --info
Comment 3 Stefan de Konink 2013-09-05 11:18:14 UTC
Created attachment 357920 [details]
build.log
Comment 4 Stefan de Konink 2013-09-05 11:21:59 UTC
Looking at the output from NSS, I guess it is trivial to spot some real bugs in the library.
Comment 5 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2013-09-05 11:35:32 UTC
(In reply to Stefan de Konink from comment #3)
> Created attachment 357920 [details]
> build.log

/var/tmp/portage/dev-libs/nss-3.15.1-r1/work/nss-3.15.1/nss/cmd/shlibsign/./sign.sh: line 13: 27479 Segmentation fault      "${2}"/shlibsign -v -i "${5}"

Please try to obtain a backtrace of that.

https://www.gentoo.org/proj/en/qa/backtraces.xml
Comment 6 Stefan de Konink 2013-09-05 11:50:38 UTC
(In reply to Tom Wijsman (TomWij) from comment #5)
> (In reply to Stefan de Konink from comment #3)
> > Created attachment 357920 [details]
> > build.log
> 
> /var/tmp/portage/dev-libs/nss-3.15.1-r1/work/nss-3.15.1/nss/cmd/shlibsign/./
> sign.sh: line 13: 27479 Segmentation fault      "${2}"/shlibsign -v -i "${5}"
> 
> Please try to obtain a backtrace of that.
> 
> https://www.gentoo.org/proj/en/qa/backtraces.xml

Yeah, the odd thing is that running it the second time manually it get me this:

make[2]: Entering directory `/var/tmp/portage/dev-libs/nss-3.15.1-r1/work/nss-3.15.1/nss/lib/util'
gcc -o Linux3.10_x86_glibc_PTH_DBG.OBJ/quickder.o -c -g -D_POSIX_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE -fPIC -Di386 -DLINUX2_1  -Wall -Werror-implicit-function-declaration -Wno-switch -pipe -DLINUX -Dlinux -DHAVE_STRERROR -DXP_UNIX -DDEBUG -UNDEBUG -DDEBUG_root -D_REENTRANT -DUSE_UTIL_DIRECTLY -DNO_NSPR_10_SUPPORT -I../../dist/Linux3.10_x86_glibc_PTH_DBG.OBJ/include -I../../dist/public/nss -I../../dist/private/nss -I../../dist/Linux3.10_x86_glibc_PTH_DBG.OBJ/include/dbm  quickder.c
In file included from quickder.c:11:0:
secasn1.h:15:21: fatal error: plarena.h: No such file or directory
compilation terminated.

Notice *GCC*, even with CC=clang make.

So when I manually try to run the tool from there I can even make it work without a problem;

/var/tmp/portage/dev-libs/nss-3.15.1-r1/work/nss-3.15.1/nss/cmd/shlibsign/Linux2.6_x86_clang_glibc_PTH_OPT.OBJ/shlibsign -v -i /var/tmp/portage/dev-libs/nss-3.15.1-r1/work/nss-3.15.1/nss/cmd/shlibsign/../../dist/Linux2.6_x86_clang_glibc_PTH_OPT.OBJ/lib/libsoftokn3.so
moduleSpec configdir='' certPrefix='' keyPrefix='' secmod='' flags=noCertDB, noModDB
Generate a DSA key pair ... 
Library File: /var/tmp/portage/dev-libs/nss-3.15.1-r1/work/nss-3.15.1/nss/cmd/shlibsign/../../dist/Linux2.6_x86_clang_glibc_PTH_OPT.OBJ/lib/libsoftokn3.so 298524 bytes
Check File: /var/tmp/portage/dev-libs/nss-3.15.1-r1/work/nss-3.15.1/nss/cmd/shlibsign/../../dist/Linux2.6_x86_clang_glibc_PTH_OPT.OBJ/lib/libsoftokn3.chk
  hash: 32 bytes
    c0 c9 e7 0c 02 b5 de 02 8e 1d
    e8 be 09 f8 a0 27 6c 69 6d 34
    18 8e b6 95 0c 6d 1d 2e 06 86
    f4 81
  signature: 64 bytes
    46 32 8f 07 4b 5b ab 0d e4 12
    f4 0d 96 4f 99 64 63 5f 4f 0c
    84 69 01 1c 13 87 4f 55 31 77
    6e 5c 1c 37 63 d0 b9 d5 88 41
    19 9c 10 a0 7a 54 11 97 44 d1
    25 cb 1b 60 be 99 f3 7d b6 ae
    48 55 78 91
Comment 7 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2013-09-05 12:02:24 UTC
Interesting, thank you for trying.
Comment 8 SpanKY gentoo-dev 2013-09-26 05:06:25 UTC
i suspect the header stuff is a red herring.  you're most likely not setting the env vars the same way the ebuild is.
Comment 9 Kyle Dunn 2013-11-13 21:19:44 UTC
I have successfully compiled nss on amd64 using clang-3.3-r100 and LLVM-3.3-r1.

I set /etc/portage/env and /etc/portage/package.env/clang to explicitly use clang instead of GCC. Please let me know what additional details I can provide or tests to verify the result is as I believe.

Thanks,
Kyle
Comment 10 SpanKY gentoo-dev 2014-02-01 04:11:00 UTC
so is this still a problem w/clang-3.4 ?
Comment 11 Stefan de Konink 2014-02-01 19:59:07 UTC
Confirmed. Works with 3.4.