Skip to content
This repository

nqp fails to compile with Segmentation fault message. #83

Closed
mrhdias opened this Issue · 14 comments

5 participants

Henrique Dias Duke Leto Patrick R. Michaud Arne Skjærholt Will Coleda
Henrique Dias

$ git clone git://github.com/perl6/nqp.git
$ cd nqp/
$ perl Configure.pl
$ make
...
/usr/bin/parrot -L. -X. --library=src/stage1 src/stage1/nqp.pbc \
--target=pir --output=src/stage2/gen/NQPCORE.setting.pir \
--module-path=src/stage2 --setting=NULL src/stage2/NQPCORE.setting
/usr/bin/parrot -L. -X. -o src/stage2/NQPCORE.setting.pbc src/stage2/gen/NQPCORE.setting.pir
/usr/bin/perl5.16.2 -MExtUtils::Command -e mkpath src/stage2/gen
/usr/bin/perl5.16.2 tools/build/gen-cat.pl src/QAST/CompileTimeValue.nqp src/QAST/SpecialArg.nqp src/QAST/Node.nqp src/QAST/Regex.nqp src/QAST/IVal.nqp src/QAST/NVal.nqp src/QAST/SVal.nqp src/QAST/BVal.nqp src/QAST/WVal.nqp src/QAST/Want.nqp src/QAST/Var.nqp src/QAST/VarWithFallback.nqp src/QAST/Op.nqp src/QAST/VM.nqp src/QAST/Stmts.nqp src/QAST/Stmt.nqp src/QAST/Block.nqp src/QAST/Unquote.nqp src/QAST/CompUnit.nqp src/QAST/InlinePlaceholder.nqp > src/stage2/QASTNode.nqp
/usr/bin/parrot -L. -X. --library=src/stage1 src/stage1/nqp.pbc \
--target=pir --output=src/stage2/QASTNode.pir --no-regex-lib \
--module-path=src/stage2 --setting-path=src/stage2 src/stage2/QASTNode.nqp
/usr/bin/parrot -L. -X. -o src/stage2/QASTNode.pbc src/stage2/QASTNode.pir
/usr/bin/perl5.16.2 -MExtUtils::Command -e mkpath src/stage2/gen
/usr/bin/perl5.16.2 tools/build/gen-cat.pl src/QRegex/NFA.nqp src/QRegex/Cursor.nqp > src/stage2/QRegex.nqp
/usr/bin/parrot -L. -X. --library=src/stage1 src/stage1/nqp.pbc \
--target=pir --output=src/stage2/QRegex.pir --no-regex-lib \
--module-path=src/stage2 --setting-path=src/stage2 src/stage2/QRegex.nqp
/usr/bin/parrot -L. -X. -o src/stage2/QRegex.pbc src/stage2/QRegex.pir
/usr/bin/perl5.16.2 -MExtUtils::Command -e mkpath src/stage2/gen
/usr/bin/perl5.16.2 tools/build/gen-cat.pl src/HLL/Grammar.pm src/HLL/Actions.pm src/HLL/Compiler.pm src/HLL/CommandLine.pm src/HLL/World.pm > src/stage2/gen/NQPHLL.pm
/usr/bin/parrot -L. -X. --library=src/stage1 src/stage1/nqp.pbc \
--target=pir --output=src/stage2/gen/NQPHLL.pir --no-regex-lib \
--module-path=src/stage2 --setting-path=src/stage2 src/stage2/gen/NQPHLL.pm
/usr/bin/parrot -L. -X. --include=src/stage2 -o src/stage2/NQPHLL.pbc \
src/stage2/gen/NQPHLL.pir
/usr/bin/perl5.16.2 -MExtUtils::Command -e mkpath src/stage2/gen
/usr/bin/perl5.16.2 tools/build/gen-cat.pl src/QAST/PIRT.nqp src/QAST/Operations.nqp src/QAST/Compiler.nqp > src/stage2/QAST.nqp
/usr/bin/parrot -L. -X. --library=src/stage1 src/stage1/nqp.pbc \
--target=pir --output=src/stage2/QAST.pir --no-regex-lib \
--module-path=src/stage2 --setting-path=src/stage2 src/stage2/QAST.nqp
/usr/bin/parrot -L. -X. -o src/stage2/QAST.pbc src/stage2/QAST.pir
/usr/bin/perl5.16.2 -MExtUtils::Command -e mkpath src/stage2/gen
/usr/bin/perl5.16.2 tools/build/gen-cat.pl src/QRegex/P6Regex/Grammar.nqp src/QRegex/P6Regex/Actions.nqp src/QRegex/P6Regex/Compiler.nqp > src/stage2/gen/NQPP6QRegex.pm
/usr/bin/parrot -L. -X. --library=src/stage1 src/stage1/nqp.pbc \
--target=pir --output=src/stage2/gen/NQPP6QRegex.pir --no-regex-lib \
--module-path=src/stage2 --setting-path=src/stage2 src/stage2/gen/NQPP6QRegex.pm
/usr/bin/parrot -L. -X. --include=src/stage2 -o src/stage2/NQPP6QRegex.pbc \
src/stage2/gen/NQPP6QRegex.pir
/usr/bin/perl5.16.2 -MExtUtils::Command -e mkpath src/stage2/gen
/usr/bin/perl5.16.2 tools/build/gen-version.pl >src/gen/nqp-config.pm
/usr/bin/perl5.16.2 tools/build/gen-cat.pl src/NQP/World.pm src/NQP/Grammar.pm src/NQP/Ops.pm src/NQP/Actions.pm src/NQP/Compiler.pm src/gen/nqp-config.pm > src/stage2/gen/NQP.pm
/usr/bin/parrot -L. -X. --library=src/stage1 src/stage1/nqp.pbc \
--target=pir --output=src/stage2/gen/NQP.pir \
--module-path=src/stage2 --setting-path=src/stage2 src/stage2/gen/NQP.pm
make: *** [src/stage2/nqp.pbc] Segmentation fault

Duke Leto
Collaborator
leto commented

If you have a coredump file a backtrace will help people debug the problem. Also, the output of uname -a

Duke Leto
Collaborator
leto commented

Also, the output of git rev-parse HEAD

Henrique Dias

https://bugs.gentoo.org/show_bug.cgi?id=459840

I can not find the the coredump.

$ uname -a
Linux patolino 3.8.2-gentoo #1 SMP Mon Mar 4 21:28:52 WET 2013 x86_64 Intel(R) Core(TM)2 Duo CPU T7250 @ 2.00GHz GenuineIntel GNU/Linux

$ git rev-parse HEAD
33a40fc

Duke Leto
Collaborator
leto commented

ulimit -c will tell you if you are allowed to make core dumps. If it says 0, then no core dumps are being produced. Use this to allow the creation of coredumps: ulimit -c unlimited

Patrick R. Michaud
Owner

What OS?

What version of Parrot?

Henrique Dias

Gentoo Linux
Parrot 5.1.0

I set ulimit -c unlimited and I tried to compile again, but I not found any core file.

Arne Skjærholt
Collaborator

What happens if you do perl Configure.pl --gen-parrot instead of relying on the installed system Parrot?

Duke Leto
Collaborator
leto commented

Good point, @arnshollt . I doubt this version of nqp supports a random version of an installed Parrot.

Patrick R. Michaud
Owner

NQP has a "minimum Parrot revision" check that it performs during the Configure.pl step... it should refuse to build if the installed Parrot isn't recent enough to build NQP.

Patrick R. Michaud
Owner

In fact, the --gen-parrot option just grabs the (oldest) version of Parrot that NQP expects to be able to build with.

Arne Skjærholt
Collaborator

That's true. But at least that'll exclude distro-specific shenanigans. If that fails, I guess adding --parrot-option='--ccflags=-g' and seeing what a gdb backtrace gives us is the next step.

EDIT: Or a core dump, of course.

Henrique Dias

Now I tried to build the rakudo from the git and failed.

$ git clone git://github.com/rakudo/rakudo.git
$ cd rakudo/
$ perl Configure.pl --gen-parrot --gen-nqp --parrot-option='--ccflags=-g'

I don't see any core dump file, where can I find the core dump file?
...
x86_64-pc-linux-gnu-gcc -o ops2c.o -I"/home/hdias/Downloads/parrot/rakudo/parrot/include" -g -DHASATTRIBUTE_CONST -DHASATTRIBUTE_DEPRECATED -DHASATTRIBUTE_MALLOC -DHASATTRIBUTE_NONNULL -DHASATTRIBUTE_NORETURN -DHASATTRIBUTE_PURE -DHASATTRIBUTE_UNUSED -DHASATTRIBUTE_WARN_UNUSED_RESULT -DHASATTRIBUTE_HOT -DHASATTRIBUTE_COLD -DHAS_GETTEXT -I/usr/lib64/libffi-3.0.12/include -c ops2c.c
Compiled: ops2c.o
x86_64-pc-linux-gnu-gcc -s -o ops2c "ops2c.o" "/home/hdias/Downloads/parrot/rakudo/parrot/src/parrot_config.o" "-Wl,-rpath=/home/hdias/Downloads/parrot/rakudo/parrot/blib/lib" -L"/home/hdias/Downloads/parrot/rakudo/parrot/blib/lib" -lparrot -Wl,-E -Wl,-O1 -Wl,--as-needed -Wl,-E -lnsl -ldl -lm -lcrypt -lutil -lpthread -lrt -lgmp -lreadline -lffi -L/usr/lib64 -licuuc -licudata
Linked: ops2c
./ops2c --dynamic src/dynoplibs/bit.ops --quiet
x86_64-pc-linux-gnu-gcc -I./include -I./include/pmc -g -DHASATTRIBUTE_CONST -DHASATTRIBUTE_DEPRECATED -DHASATTRIBUTE_MALLOC -DHASATTRIBUTE_NONNULL -DHASATTRIBUTE_NORETURN -DHASATTRIBUTE_PURE -DHASATTRIBUTE_UNUSED -DHASATTRIBUTE_WARN_UNUSED_RESULT -DHASATTRIBUTE_HOT -DHASATTRIBUTE_COLD -DHAS_GETTEXT -I/usr/lib64/libffi-3.0.12/include -g -fPIC -falign-functions=16 -funit-at-a-time -fexcess-precision=standard -maccumulate-outgoing-args -Wall -Wextra -Waggregate-return -Wcast-align -Wcast-qual -Wdisabled-optimization -Wdiv-by-zero -Wendif-labels -Wformat-extra-args -Wformat-nonliteral -Wformat-security -Wformat-y2k -Wimplicit -Wimport -Winit-self -Winline -Winvalid-pch -Wjump-misses-init -Wlogical-op -Werror=missing-braces -Wmissing-declarations -Wno-missing-format-attribute -Wmissing-include-dirs -Wmultichar -Wpacked -Wpointer-arith -Wreturn-type -Wsequence-point -Wsign-compare -Wstrict-aliasing -Wstrict-aliasing=2 -Wswitch -Wswitch-default -Werror=undef -Wno-unused -Wvariadic-macros -Wwrite-strings -Wc++-compat -Werror=declaration-after-statement -Werror=implicit-function-declaration -Wmissing-prototypes -Werror=nested-externs -Werror=old-style-definition -Werror=strict-prototypes -fvisibility=hidden -Wno-parentheses-equality -fPIC -Isrc/dynoplibs -o src/dynoplibs/bit_ops.o -c src/dynoplibs/bit_ops.c
x86_64-pc-linux-gnu-gcc -o runtime/parrot/dynext/bit_ops.so \
src/dynoplibs/bit_ops.o -Wl,-O1 -Wl,--as-needed -shared -march=core2 -O2 -pipe -Wl,-O1 -Wl,--as-needed -fPIC -L/usr/lib64 -licuuc -licudata -lnsl -ldl -lm -lcrypt -lutil -lpthread -lrt -lgmp -lreadline -lffi
./ops2c --dynamic src/dynoplibs/sys.ops --quiet
x86_64-pc-linux-gnu-gcc -I./include -I./include/pmc -g -DHASATTRIBUTE_CONST -DHASATTRIBUTE_DEPRECATED -DHASATTRIBUTE_MALLOC -DHASATTRIBUTE_NONNULL -DHASATTRIBUTE_NORETURN -DHASATTRIBUTE_PURE -DHASATTRIBUTE_UNUSED -DHASATTRIBUTE_WARN_UNUSED_RESULT -DHASATTRIBUTE_HOT -DHASATTRIBUTE_COLD -DHAS_GETTEXT -I/usr/lib64/libffi-3.0.12/include -g -fPIC -falign-functions=16 -funit-at-a-time -fexcess-precision=standard -maccumulate-outgoing-args -Wall -Wextra -Waggregate-return -Wcast-align -Wcast-qual -Wdisabled-optimization -Wdiv-by-zero -Wendif-labels -Wformat-extra-args -Wformat-nonliteral -Wformat-security -Wformat-y2k -Wimplicit -Wimport -Winit-self -Winline -Winvalid-pch -Wjump-misses-init -Wlogical-op -Werror=missing-braces -Wmissing-declarations -Wno-missing-format-attribute -Wmissing-include-dirs -Wmultichar -Wpacked -Wpointer-arith -Wreturn-type -Wsequence-point -Wsign-compare -Wstrict-aliasing -Wstrict-aliasing=2 -Wswitch -Wswitch-default -Werror=undef -Wno-unused -Wvariadic-macros -Wwrite-strings -Wc++-compat -Werror=declaration-after-statement -Werror=implicit-function-declaration -Wmissing-prototypes -Werror=nested-externs -Werror=old-style-definition -Werror=strict-prototypes -fvisibility=hidden -Wno-parentheses-equality -fPIC -Isrc/dynoplibs -o src/dynoplibs/sys_ops.o -c src/dynoplibs/sys_ops.c
x86_64-pc-linux-gnu-gcc -o runtime/parrot/dynext/sys_ops.so \
src/dynoplibs/sys_ops.o -Wl,-O1 -Wl,--as-needed -shared -march=core2 -O2 -pipe -Wl,-O1 -Wl,--as-needed -fPIC -L/usr/lib64 -licuuc -licudata -lnsl -ldl -lm -lcrypt -lutil -lpthread -lrt -lgmp -lreadline -lffi
./parrot -o runtime/parrot/library/pcre.pbc runtime/parrot/library/pcre.pir
./parrot -o parrot_nci_thunk_gen.pbc tools/dev/nci_thunk_gen.pir
./pbc_to_exe parrot_nci_thunk_gen.pbc
x86_64-pc-linux-gnu-gcc -o parrot_nci_thunk_gen.o -I"/home/hdias/Downloads/parrot/rakudo/parrot/include" -g -DHASATTRIBUTE_CONST -DHASATTRIBUTE_DEPRECATED -DHASATTRIBUTE_MALLOC -DHASATTRIBUTE_NONNULL -DHASATTRIBUTE_NORETURN -DHASATTRIBUTE_PURE -DHASATTRIBUTE_UNUSED -DHASATTRIBUTE_WARN_UNUSED_RESULT -DHASATTRIBUTE_HOT -DHASATTRIBUTE_COLD -DHAS_GETTEXT -I/usr/lib64/libffi-3.0.12/include -c parrot_nci_thunk_gen.c
Compiled: parrot_nci_thunk_gen.o
x86_64-pc-linux-gnu-gcc -s -o parrot_nci_thunk_gen "parrot_nci_thunk_gen.o" "/home/hdias/Downloads/parrot/rakudo/parrot/src/parrot_config.o" "-Wl,-rpath=/home/hdias/Downloads/parrot/rakudo/parrot/blib/lib" -L"/home/hdias/Downloads/parrot/rakudo/parrot/blib/lib" -lparrot -Wl,-E -Wl,-O1 -Wl,--as-needed -Wl,-E -lnsl -ldl -lm -lcrypt -lutil -lpthread -lrt -lgmp -lreadline -lffi -L/usr/lib64 -licuuc -licudata
Linked: parrot_nci_thunk_gen
./parrot_nci_thunk_gen \
--loader-name=Parrot_glut_nci_loader \
--loader-storage-class=PARROT_DYNEXT_EXPORT \
--output=src/glut_nci_thunks.c \
<src/glut_nci_thunks.nci
Failed to load libpcre
current instr.: 'parrot;PCRE;init' pc 249 (runtime/parrot/library/pcre.pir:162)
called from Sub 'read_one_sig' pc 1984 (tools/dev/nci_thunk_gen.pir:861)
called from Sub 'read_sigs' pc 1905 (tools/dev/nci_thunk_gen.pir:823)
called from Sub 'main' pc 40 (tools/dev/nci_thunk_gen.pir:48)
gmake: *** [src/glut_nci_thunks.c] Error 1
Command failed (status 512): gmake install-dev

Will Coleda
Collaborator
coke commented

I'm not sure if this will help, but can you try:

perl Configure.pl --gen-parrot --gen-nqp --parrot-option='--ccflags=-g' --parrot-make-option='--without-pcre'

Henrique Dias mrhdias closed this
Henrique Dias

I've solved this issue. I removed the parrot, nqp and rakudo. Next i went back to reinstall it and everything worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.