Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
dev-lang/yasm Fails to build with segfault
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Kate Monster
Apprentice
Apprentice


Joined: 13 Jun 2006
Posts: 226
Location: Clarkston, Michigan

PostPosted: Fri Nov 14, 2014 2:10 am    Post subject: dev-lang/yasm Fails to build with segfault Reply with quote

Hi. Curious issue I'm having. I'm attempting to build a gentoo chroot inside of an ubuntu install. Everything was going great until I tried installing yasm. Running emerge -1 yasm results in the following:
Code:
make -j5
make: Circular x86insn_nasm.gperf <- x86insn_nasm.gperf dependency dropped.
make: Circular x86insn_gas.gperf <- x86insn_gas.gperf dependency dropped.
x86_64-pc-linux-gnu-gcc -std=gnu99  -I.  \
  -c -o genperf.o `test -f tools/genperf/genperf.c || echo './'`tools/genperf/genperf.c
x86_64-pc-linux-gnu-gcc -std=gnu99  -I.  \
  -c -o gp-perfect.o `test -f tools/genperf/perfect.c || echo './'`tools/genperf/perfect.c
x86_64-pc-linux-gnu-gcc -std=gnu99  -I.  \
  -c -o gp-phash.o `test -f libyasm/phash.c || echo './'`libyasm/phash.c
x86_64-pc-linux-gnu-gcc -std=gnu99  -I.  \
  -c -o gp-xmalloc.o `test -f libyasm/xmalloc.c || echo './'`libyasm/xmalloc.c
x86_64-pc-linux-gnu-gcc -std=gnu99  -I.  \
  -c -o gp-xstrdup.o `test -f libyasm/xstrdup.c || echo './'`libyasm/xstrdup.c
x86_64-pc-linux-gnu-gcc -std=gnu99  -I.  \
  -c -o re2c-main.o `test -f tools/re2c/main.c || echo './'`tools/re2c/main.c
x86_64-pc-linux-gnu-gcc -std=gnu99  -I.  \
  -c -o re2c-code.o `test -f tools/re2c/code.c || echo './'`tools/re2c/code.c
x86_64-pc-linux-gnu-gcc -std=gnu99  -I.  \
  -c -o re2c-dfa.o `test -f tools/re2c/dfa.c || echo './'`tools/re2c/dfa.c
x86_64-pc-linux-gnu-gcc -std=gnu99  -I.  \
  -c -o re2c-parser.o `test -f tools/re2c/parser.c || echo './'`tools/re2c/parser.c
x86_64-pc-linux-gnu-gcc -std=gnu99  -I.  \
  -c -o re2c-actions.o `test -f tools/re2c/actions.c || echo './'`tools/re2c/actions.c
x86_64-pc-linux-gnu-gcc -std=gnu99  -I.  \
  -c -o re2c-scanner.o `test -f tools/re2c/scanner.c || echo './'`tools/re2c/scanner.c
x86_64-pc-linux-gnu-gcc -std=gnu99  -I.  \
  -c -o re2c-mbo_getopt.o `test -f tools/re2c/mbo_getopt.c || echo './'`tools/re2c/mbo_getopt.c
x86_64-pc-linux-gnu-gcc -std=gnu99  -I.  \
  -c -o re2c-substr.o `test -f tools/re2c/substr.c || echo './'`tools/re2c/substr.c
x86_64-pc-linux-gnu-gcc -std=gnu99  -I.  \
  -c -o re2c-translate.o `test -f tools/re2c/translate.c || echo './'`tools/re2c/translate.c
x86_64-pc-linux-gnu-gcc -std=gnu99  -I.  \
  -c -o genmacro.o `test -f tools/genmacro/genmacro.c || echo './'`tools/genmacro/genmacro.c
x86_64-pc-linux-gnu-gcc -std=gnu99 -I.  -c -o genversion.o `test -f modules/preprocs/nasm/genversion.c || echo './'`modules/preprocs/nasm/genversion.c
x86_64-pc-linux-gnu-gcc -std=gnu99 -I.  -c -o genstring.o `test -f genstring.c || echo './'`genstring.c
x86_64-pc-linux-gnu-gcc -std=gnu99 -o genperf  genperf.o gp-perfect.o gp-phash.o gp-xmalloc.o gp-xstrdup.o
x86_64-pc-linux-gnu-gcc -std=gnu99 -o genmacro  genmacro.o
x86_64-pc-linux-gnu-gcc -std=gnu99 -o re2c  re2c-main.o re2c-code.o re2c-dfa.o re2c-parser.o re2c-actions.o re2c-scanner.o re2c-mbo_getopt.o re2c-substr.o re2c-translate.o
x86_64-pc-linux-gnu-gcc -std=gnu99 -o genversion  genversion.o
./genperf x86insn_nasm.gperf x86insn_nasm.c
./genperf x86insn_gas.gperf x86insn_gas.c
x86_64-pc-linux-gnu-gcc -std=gnu99 -o genstring  genstring.o
./genmacro nasm-macros.c nasm_standard_mac ./modules/parsers/nasm/nasm-std.mac
./genversion version.mac
./genmacro win64-nasm.c win64_nasm_stdmac ./modules/objfmts/coff/win64-nasm.mac
./genmacro win64-gas.c win64_gas_stdmac ./modules/objfmts/coff/win64-gas.mac
./re2c -b -o gas-token.c ./modules/parsers/gas/gas-token.re
./re2c -b -o nasm-token.c ./modules/parsers/nasm/nasm-token.re
found distinct (A,B) on attempt 19
built perfect hash table of size 512
./genmacro nasm-version.c nasm_version_mac version.mac
./genstring license_msg license.c ./COPYING
Makefile:4765: recipe for target 'nasm-token.c' failed
make: *** [nasm-token.c] Segmentation fault (core dumped)
make: *** Deleting file 'nasm-token.c'
make: *** Waiting for unfinished jobs....
Makefile:4762: recipe for target 'gas-token.c' failed
make: *** [gas-token.c] Segmentation fault (core dumped)
make: *** Deleting file 'gas-token.c'
found distinct (A,B) on attempt 1640
built perfect hash table of size 512

Followed by your usual failure messages. I cd'ed into the work directory, then ran a ./configure and a make -j5 myself, and the results were rather strange. It succeeded to build, but a quick look at a snippet of that build log:
Code:
gcc -std=gnu99  -I.  \
  -c -o genperf.o `test -f tools/genperf/genperf.c || echo './'`tools/genperf/genperf.c
gcc -std=gnu99  -I.  \
  -c -o gp-perfect.o `test -f tools/genperf/perfect.c || echo './'`tools/genperf/perfect.c
gcc -std=gnu99  -I.  \
  -c -o gp-phash.o `test -f libyasm/phash.c || echo './'`libyasm/phash.c
gcc -std=gnu99  -I.  \
  -c -o gp-xmalloc.o `test -f libyasm/xmalloc.c || echo './'`libyasm/xmalloc.c
gcc -std=gnu99  -I.  \
  -c -o gp-xstrdup.o `test -f libyasm/xstrdup.c || echo './'`libyasm/xstrdup.c
gcc -std=gnu99  -I.  \
  -c -o re2c-main.o `test -f tools/re2c/main.c || echo './'`tools/re2c/main.c
gcc -std=gnu99  -I.  \
  -c -o re2c-code.o `test -f tools/re2c/code.c || echo './'`tools/re2c/code.c
gcc -std=gnu99  -I.  \
  -c -o re2c-dfa.o `test -f tools/re2c/dfa.c || echo './'`tools/re2c/dfa.c
gcc -std=gnu99  -I.  \
  -c -o re2c-parser.o `test -f tools/re2c/parser.c || echo './'`tools/re2c/parser.c
gcc -std=gnu99  -I.  \
  -c -o re2c-actions.o `test -f tools/re2c/actions.c || echo './'`tools/re2c/actions.c
gcc -std=gnu99  -I.  \
  -c -o re2c-scanner.o `test -f tools/re2c/scanner.c || echo './'`tools/re2c/scanner.c
gcc -std=gnu99  -I.  \
  -c -o re2c-mbo_getopt.o `test -f tools/re2c/mbo_getopt.c || echo './'`tools/re2c/mbo_getopt.c
gcc -std=gnu99  -I.  \
  -c -o re2c-substr.o `test -f tools/re2c/substr.c || echo './'`tools/re2c/substr.c
gcc -std=gnu99  -I.  \
  -c -o re2c-translate.o `test -f tools/re2c/translate.c || echo './'`tools/re2c/translate.c
gcc -std=gnu99  -I.  \
  -c -o genmacro.o `test -f tools/genmacro/genmacro.c || echo './'`tools/genmacro/genmacro.c
gcc -std=gnu99 -I.  -c -o genversion.o `test -f modules/preprocs/nasm/genversion.c || echo './'`modules/preprocs/nasm/genversion.c
gcc -std=gnu99 -I.  -c -o genstring.o `test -f genstring.c || echo './'`genstring.c
gcc -std=gnu99 -o genperf  genperf.o gp-perfect.o gp-phash.o gp-xmalloc.o gp-xstrdup.o
gcc -std=gnu99 -o re2c  re2c-main.o re2c-code.o re2c-dfa.o re2c-parser.o re2c-actions.o re2c-scanner.o re2c-mbo_getopt.o re2c-substr.o re2c-translate.o
./genperf x86insn_nasm.gperf x86insn_nasm.c
./genperf x86insn_gas.gperf x86insn_gas.c
gcc -std=gnu99 -o genversion  genversion.o
gcc -std=gnu99 -o genmacro  genmacro.o
gcc -std=gnu99 -o genstring  genstring.o
found distinct (A,B) on attempt 19
built perfect hash table of size 512
./re2c -b -o gas-token.c ./modules/parsers/gas/gas-token.re
./re2c -b -o nasm-token.c ./modules/parsers/nasm/nasm-token.re
./genstring license_msg license.c ./COPYING
./genversion version.mac
./genmacro nasm-macros.c nasm_standard_mac ./modules/parsers/nasm/nasm-std.mac
./genmacro nasm-version.c nasm_version_mac version.mac
./genmacro win64-nasm.c win64_nasm_stdmac ./modules/objfmts/coff/win64-nasm.mac
./genmacro win64-gas.c win64_gas_stdmac ./modules/objfmts/coff/win64-gas.mac
found distinct (A,B) on attempt 1640
built perfect hash table of size 512

No seg fault. What the devil is going on?
Back to top
View user's profile Send private message
Kate Monster
Apprentice
Apprentice


Joined: 13 Jun 2006
Posts: 226
Location: Clarkston, Michigan

PostPosted: Mon Nov 17, 2014 1:47 am    Post subject: Reply with quote

I guess it goes without saying, but I have tried this several times with the same results, so I seriously doubt it's hardware. The chroot sits on an i7, compiling for a core 2 duo.
Back to top
View user's profile Send private message
adlerweb
n00b
n00b


Joined: 01 Aug 2007
Posts: 6

PostPosted: Sat Sep 26, 2015 12:27 pm    Post subject: Reply with quote

Same here with 1.2.0-r1 and 1.3.0:
Code:
built perfect hash table of size 512
./re2c -b -o gas-token.c ./modules/parsers/gas/gas-token.re
./re2c -b -o nasm-token.c ./modules/parsers/nasm/nasm-token.re
Makefile:4780: recipe for target 'gas-token.c' failed
make: *** [gas-token.c] Segmentation fault
make: *** Deleting file 'gas-token.c'
make: *** Waiting for unfinished jobs....
Makefile:4783: recipe for target 'nasm-token.c' failed
make: *** [nasm-token.c] Segmentation fault
make: *** Deleting file 'nasm-token.c'

dmesg:
Code:
[*] re2c[*]: segfault at 0 ip 00007f3cc90441d0 sp 00007fffaa8fdee0 error 4 in libc-2.20.so[7f3cc8fda000+18e000]
[*] re2c[*]: segfault at 0 ip 00007ff5681921d0 sp 00007ffccd9b4300 error 4 in libc-2.20.so[7ff568128000+18e000]

CPU is Xeon W3520. Re2c seems to be included, dev-util/re2c is not installed. libc and gcc already rebuild for good measure. I redirected the generated re2c trough strace - last lines:
Code:
open("/tmp/tmpfuxtE34", O_RDWR|O_CREAT|O_EXCL, 0600) = -1 EACCES (Permission denied)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV +++
./re2c: line 2:  6931 Segmentation fault      strace ./re2c.org $*


Workarround: I had /tmp on my main partition (ext4 with rw,relatime,data=ordered). I mounted a clean tmpfs on /tmp and the compile worked fine.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13831

PostPosted: Sat Sep 26, 2015 6:28 pm    Post subject: Reply with quote

That suggests the tool has a bug where failing to open a temporary file causes it to crash. Since /tmp is normally world-writable, most people would not notice the bug. What is the output of ls -ld /tmp when the tmpfs is not mounted?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum