Re: lang/perl5.12 segfault (amd64 - 8-STABLE)
On 17.07.2010 8:18, Mario Sergio Fujikawa Ferreira wrote: Hi, I am running 8-STABLE as of July 1st 2010. FreeBSD exxodus.fedaykin.here 8.1-PRERELEASE FreeBSD 8.1-PRERELEASE #14: Thu Jul 1 12:50:38 BRT 2010 li...@exxodus:/usr/obj/usr/src/sys/LIOUX amd64 With latest ports as of July 14th 2010. I've been trying to build perl5.12 since its addition to the ports tree without success. The ports tree is up to date as of today. The build always produces segmentation faults. The relevant part of the build log follows: Fixed. Problem was with -lpth linking (THREADS option). Please update ports tree and install port again. Sorry for the inconvenience. -- Sergey Skvortsov mailto: s...@freebsd.org ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
RE: lang/perl5.12 segfault (amd64 - 8-STABLE)
The patch could possibly solve my challenge, but if it works then why do I get this? r...@anchorage:/usr/ports/lang/perl5.12# patch my.patch Hmm... Looks like a unified diff to me... The text leading up to this was: -- |--- files/patch-freebsd.sh 2009-01-13 21:38:50.0 + |+++ files/patch-freebsd.sh 2010-07-16 21:46:31.0 +0100 -- Patching file files/patch-freebsd.sh using Plan A... patch: malformed patch at line 8: @@ -88,6 +88,8 @@ Scott -Original Message- From: owner-freebsd-po...@freebsd.org [mailto:owner-freebsd-po...@freebsd.org] On Behalf Of Christopher Key Sent: Sunday, July 18, 2010 8:46 PM To: po...@freebsd.org Subject: Re: lang/perl5.12 segfault (amd64 - 8-STABLE) cj...@cam.ac.uk wrote: Someone who understands the perl threading internals needs to figure this out. Simple solution, there was a missing -lpthread, patch available from: http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/148648 For some reason, linking binaries without -lpthread succeeds, but the pthread calls in the resulting binary do nothing. #v+ # cat pthread.c #include stdio.h #include stdlib.h #include pthread.h int main(void) { int i; pthread_key_t k; k = 1234; i = pthread_key_create(k, NULL); fprintf(stderr, %d %d\n, i, (int) k); return 0; } # gcc pthread.c -o pt1 # gcc pthread.c -lpthread -o pt2 # ./pt1 0 1234 # ./pt2 0 0 #v- ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: lang/perl5.12 segfault (amd64 - 8-STABLE)
On Tue, 20 Jul 2010 07:37:37 -0700 Scott Sanbeg ssan...@gmail.com wrote: The patch could possibly solve my challenge, but if it works then why do I get this? r...@anchorage:/usr/ports/lang/perl5.12# patch my.patch Hmm... Looks like a unified diff to me... The text leading up to this was: -- |--- files/patch-freebsd.sh 2009-01-13 21:38:50.0 + |+++ files/patch-freebsd.sh 2010-07-16 21:46:31.0 +0100 -- Patching file files/patch-freebsd.sh using Plan A... patch: malformed patch at line 8: @@ -88,6 +88,8 @@ Works for me. Did you perhaps edit it and make an error? You can always apply it by hand, it's not all that complex. -- Gary Jennejohn ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
RE: lang/perl5.12 segfault (amd64 - 8-STABLE)
Chris - thank you for the attachment - using it succeeded and perl 5.12 has also been successfully built. Gary - no edits, no. However, using Chris's attachment as 'my.patch' and the previous copy and paste from the inline code of ports/148648 as 'my.patch.old' for the diff run, below, you'll see that the two are obviously different. I am using Google Chrome for a browser, so the extra white space, etc, may be due to it, or to the ports site and how it is storing the individual character bits. r...@anchorage:/usr/ports/lang/perl5.12# diff my.patch my.patch.old 1,2c1,2 --- files/patch-freebsd.sh 2009-01-13 21:38:50.0 + +++ files/patch-freebsd.sh 2010-07-16 21:46:31.0 +0100 --- --- files/patch-freebsd.sh2009-01-13 21:38:50.0 + +++ files/patch-freebsd.sh2010-07-16 21:46:31.0 +0100 6,10c6,10 +--- ./hints/freebsd.sh.orig2010-05-07 14:34:10.0 +0100 ./hints/freebsd.sh 2010-07-16 21:43:38.0 +0100 @@ -88,6 +88,8 @@ esac libswanted=`echo $libswanted | sed 's/ malloc / /'` --- +--- ./hints/freebsd.sh.orig 2010-05-07 14:34:10.0 +0100 ./hints/freebsd.sh 2010-07-16 21:43:38.0 +0100 @@ -88,6 +88,8 @@ esac libswanted=`echo $libswanted | sed 's/ malloc / /'` 12,14c12,14 lddlflags=-shared fi cccdlflags='-DPIC -fPIC' --- lddlflags=-shared fi cccdlflags='-DPIC -fPIC' 18,24c18,24 +libpth=/usr/lib /usr/local/lib +glibpth=/usr/lib /usr/local/lib +- ldflags=-Wl,-E ++ ldflags=%%PTHREAD_LIBS%% -Wl,-E + lddlflags=-shared + cccdlflags='-DPIC -fPIC' +;; --- + libpth=/usr/lib /usr/local/lib + glibpth=/usr/lib /usr/local/lib +- ldflags=-Wl,-E ++ ldflags=%%PTHREAD_LIBS%% -Wl,-E + lddlflags=-shared + cccdlflags='-DPIC -fPIC' + ;; 26c26 0*|1*|2*|3*) ;; --- 0*|1*|2*|3*) ;; 28c28 *) --- *) 30,32c30,32 if /usr/bin/file -L /usr/lib/libc.so | /usr/bin/grep -vq not stripped ; then usenm=false fi --- if /usr/bin/file -L /usr/lib/libc.so | /usr/bin/grep -vq not stripped ; then usenm=false fi 36,37c36,37 # This script UU/usethreads.cbu will get 'called-back' by Configure # after it has prompted the user for whether to use threads. --- # This script UU/usethreads.cbu will get 'called-back' by Configure # after it has prompted the user for whether to use threads. Scott -Original Message- From: Christopher Key [mailto:cj...@cam.ac.uk] Sent: Tuesday, July 20, 2010 8:47 AM To: Scott Sanbeg Cc: po...@freebsd.org Subject: Re: lang/perl5.12 segfault (amd64 - 8-STABLE) Scott Sanbeg wrote: The patch could possibly solve my challenge, but if it works then why do I get this? r...@anchorage:/usr/ports/lang/perl5.12# patch my.patch Hmm... Looks like a unified diff to me... The text leading up to this was: -- |--- files/patch-freebsd.sh 2009-01-13 21:38:50.0 + |+++ files/patch-freebsd.sh 2010-07-16 21:46:31.0 +0100 -- Patching file files/patch-freebsd.sh using Plan A... patch: malformed patch at line 8: @@ -88,6 +88,8 @@ I guess that the patch is getting munged somewhere; I'm not sure why its ended up inline in the pr rather than available to download. Try the attached. Chris. ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: lang/perl5.12 segfault (amd64 - 8-STABLE)
On Mon, 19 Jul 2010, Christopher Key wrote: Simple solution, there was a missing -lpthread, patch available from: http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/148648 Hehe... I completely overlooked this possibility. I sent a follow-up to perl5-porters quoting your message. For some reason, linking binaries without -lpthread succeeds, but the pthread calls in the resulting binary do nothing. Odd. I wonder what is the justification for this behaviour, if any... -- Janne Snabb / EPIPE Communications sn...@epipe.com - http://epipe.com/ ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: lang/perl5.12 segfault (amd64 - 8-STABLE)
cj...@cam.ac.uk wrote: Someone who understands the perl threading internals needs to figure this out. Simple solution, there was a missing -lpthread, patch available from: http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/148648 For some reason, linking binaries without -lpthread succeeds, but the pthread calls in the resulting binary do nothing. #v+ # cat pthread.c #include stdio.h #include stdlib.h #include pthread.h int main(void) { int i; pthread_key_t k; k = 1234; i = pthread_key_create(k, NULL); fprintf(stderr, %d %d\n, i, (int) k); return 0; } # gcc pthread.c -o pt1 # gcc pthread.c -lpthread -o pt2 # ./pt1 0 1234 # ./pt2 0 0 #v- ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: lang/perl5.12 segfault (amd64 - 8-STABLE)
On 17.07.2010 06:18 (UTC+1), Mario Sergio Fujikawa Ferreira wrote: Hi, I am running 8-STABLE as of July 1st 2010. FreeBSD exxodus.fedaykin.here 8.1-PRERELEASE FreeBSD 8.1-PRERELEASE #14: Thu Jul 1 12:50:38 BRT 2010 li...@exxodus:/usr/obj/usr/src/sys/LIOUX amd64 With latest ports as of July 14th 2010. I've been trying to build perl5.12 since its addition to the ports tree without success. The ports tree is up to date as of today. Same error here on recent 9.0-CURRENT (amd64), updating from perl-threaded-5.10.1_2. Rainer The build always produces segmentation faults. The relevant part of the build log follows: -- `sh cflags optimize='-O2 -pipe -march=athlon64 -fno-strict-aliasing' globals.o` -DPIC -fPIC globals.c CCCMD = cc -DPERL_CORE -c -DAPPLLIB_EXP=/usr/local/lib/perl5/5.12.1/BSDPAN -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector -I/usr/l ocal/include -std=c89 -O2 -pipe -march=athlon64 -fno-strict-aliasing -Wall -ansi -W -Wextra -Wdeclaration-after-statement -Wendif-labels -Wc++-compat LD_LIBRARY_PATH=/usr/ports/lang/perl5.12/work/perl-5.12.1 cc -Wl,-E -fstack-protector -L/usr/local/lib -o miniperlgv.o toke.o perly.o pad.o regcomp.o dump.o util.o mg.o reent r.o mro.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o globals.o perlio.o perlapi.o numeric.o mathoms.o lo cale.o pp_pack.o pp_sort.ominiperlmain.o opmini.o perlmini.o -lm -lcrypt -lutil LD_LIBRARY_PATH=/usr/ports/lang/perl5.12/work/perl-5.12.1 ./miniperl -w -Ilib -MExporter -e '?' || make minitest Segmentation fault (core dumped) LD_LIBRARY_PATH=/usr/ports/lang/perl5.12/work/perl-5.12.1 ./miniperl -Ilib make_patchnum.pl Segmentation fault (core dumped) *** Error code 139 1 error You may see some irrelevant test failures if you have been unable to build lib/Config.pm, or the Unicode data files. cd t (rm -f perl; /bin/ln -s ../miniperl perl) LD_LIBRARY_PATH=/usr/ports/lang/perl5.12/work/perl-5.12.1 ./perl TEST -minitest base/*.t comp/*.t cmd/*.t run/*.t io/*.t re/ *.t op/*.t uni/*.t/dev/tty Segmentation fault (core dumped) LD_LIBRARY_PATH=/usr/ports/lang/perl5.12/work/perl-5.12.1 ./miniperl -Ilib make_patchnum.pl LD_LIBRARY_PATH=/usr/ports/lang/perl5.12/work/perl-5.12.1 ./miniperl -Ilib autodoc.pl Segmentation fault (core dumped) *** Error code 139 Segmentation fault (core dumped) *** Error code 139 2 errors *** Error code 1 Stop in /usr/ports/lang/perl5.12. *** Error code 1 Stop in /usr/ports/lang/perl5.12. -- The complete build log can be found at: http://people.freebsd.org/~lioux/perl5.12_build_log.bz2 Let me know if there is anything I can do to help. Regards, ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: lang/perl5.12 segfault (amd64 - 8-STABLE)
Hi, Same problem here. Here is the gdb output: #0 0x004ddbd3 in Perl_safesyscalloc (count=1, size=4072) at util.c:311 311 DEBUG_m(PerlIO_printf(Perl_debug_log, 0x%UVxf: (%05ld) calloc %ld x %ld bytes\n,PTR2UV(ptr),(long)PL_an++,(long)count,(long)total_size)); (gdb) bt #0 0x004ddbd3 in Perl_safesyscalloc (count=1, size=4072) at util.c:311 #1 0x0054a28f in Perl_get_arena (my_perl=0x801002500, arena_size=3880, bodytype=SVt_PV) at sv.c:737 #2 0x0054a584 in S_more_bodies (my_perl=0x801002500, sv_type=SVt_PV) at sv.c:1104 #3 0x0054b829 in Perl_sv_upgrade (my_perl=0x801002500, sv=0x801002c98, new_type=SVt_PV) at sv.c:1398 #4 0x005722ff in Perl_sv_setpv (my_perl=0x801002500, sv=0x801002c98, ptr=0x791d5a ) at sv.c:4387 #5 0x00748695 in perl_construct (my_perl=0x801002500) at perl.c:254 #6 0x0071e6a7 in main (argc=3, argv=0x7fffe368, env=0x7fffe388) at miniperlmain.c:111 It is somehow related to the Perl_debug_log which is the first argument of PerlIO_printf. But I can not figure out why, too many layers of #defines and calls within calls. If I insert a line which references Perl_debug_log before the problematic line, it will dump core on that line, gdb output: Program received signal SIGSEGV, Segmentation fault. 0x006f2de0 in Perl_PerlIO_stderr (my_perl=0x0) at perlio.c:4981 4981if (!PL_perlio) { I cannot inspect PL_perlio because it is another macro, from perlapi.h: #define PL_perlio (*Perl_Iperlio_ptr(aTHX)) aTHX is defined in perl.h to be my_perl, which seems to be a null pointer: (gdb) p my_perl $1 = (PerlInterpreter *) 0x0 So, the miniperl process dies because it cannot de-reference this NULL pointer. I have no clue where it should be initialized. -- Janne Snabb / EPIPE Communications sn...@epipe.com - http://epipe.com/ ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: lang/perl5.12 segfault (amd64 - 8-STABLE)
On Sat, 17 Jul 2010, Janne Snabb wrote: It is somehow related to the Perl_debug_log which is the first argument of PerlIO_printf. But I can not figure out why, too many layers of #defines and calls within calls. The problem seems to go away when threads are disabled. The problematic line 311 in util.c expands to quite a horrible mess (found this out by doing make util.i): (void)( { if ((PL_curinterp)) { PerlInterpreter* my_perl __attribute__((unused)) = ((PerlInterpreter *)pthread_getspecific(PL_thr_key)); if (((my_perl-Idebug) 0x0080)) {(my_perl-Idebug)=~0x0080; PerlIO_printf(Perl_PerlIO_stderr(my_perl), 0x%lx: (%05ld) calloc %ld x %ld bytes\n,(UV)(ptr),(long)(my_perl-Ian)++,(long)count,(long)total_size); (my_perl-Idebug)|=0x0080;} } } ); The problem is that my_perl here is NULL pointer. PL_thr_key which is given to pthread_getspecific() to get my_perl is zero. (gdb) p my_perl $1 = (PerlInterpreter *) 0x0 (gdb) p PL_thr_key $2 = 0 (gdb) Someone who understands the perl threading internals needs to figure this out. -- Janne Snabb / EPIPE Communications sn...@epipe.com - http://epipe.com/ ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: lang/perl5.12 segfault (amd64 - 8-STABLE)
On Saturday, 2010-07-17 at 09:23:18 +, Janne Snabb wrote: The problem seems to go away when threads are disabled. The problematic line 311 in util.c expands to quite a horrible mess (found this out by doing make util.i): (void)( { if ((PL_curinterp)) { PerlInterpreter* my_perl __attribute__((unused)) = ((PerlInterpreter *)pthread_getspecific(PL_thr_key)); if (((my_perl-Idebug) 0x0080)) {(my_perl-Idebug)=~0x0080; PerlIO_printf(Perl_PerlIO_stderr(my_perl), 0x%lx: (%05ld) calloc %ld x %ld bytes\n,(UV)(ptr),(long)(my_perl-Ian)++,(long)count,(long)total_size); (my_perl-Idebug)|=0x0080;} } } ); Someone who understands the perl threading internals needs to figure this out. I would recommend you take this to the perl5-porters mailing list. You will have a much better chance of finding expertise than on this mailing list. perl5-port...@perl.org HTH, Lupe Christoph -- | It is a well-known fact in any organisation that, if you want a job| | done, you should give it to someone who is already very busy. | | Terry Pratchett, Unseen Academicals | ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: lang/perl5.12 segfault (amd64 - 8-STABLE)
On Saturday, 2010-07-17 at 09:23:18 +, Janne Snabb wrote: The problem seems to go away when threads are disabled. The problem appears on i386 in addition to amd64, probably other architectures as well. My advice would be: DO NOT try to upgrade your perl to 5.12 if you are using threads (which are not enabled by default). On Sat, 17 Jul 2010, Lupe Christoph wrote: I would recommend you take this to the perl5-porters mailing list. You will have a much better chance of finding expertise than on this mailing list. Done. Does not show up yet though. Maybe it is sitting in some moderation queue. -- Janne Snabb / EPIPE Communications sn...@epipe.com - http://epipe.com/ ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
lang/perl5.12 segfault (amd64 - 8-STABLE)
Hi, I am running 8-STABLE as of July 1st 2010. FreeBSD exxodus.fedaykin.here 8.1-PRERELEASE FreeBSD 8.1-PRERELEASE #14: Thu Jul 1 12:50:38 BRT 2010 li...@exxodus:/usr/obj/usr/src/sys/LIOUX amd64 With latest ports as of July 14th 2010. I've been trying to build perl5.12 since its addition to the ports tree without success. The ports tree is up to date as of today. The build always produces segmentation faults. The relevant part of the build log follows: -- `sh cflags optimize='-O2 -pipe -march=athlon64 -fno-strict-aliasing' globals.o` -DPIC -fPIC globals.c CCCMD = cc -DPERL_CORE -c -DAPPLLIB_EXP=/usr/local/lib/perl5/5.12.1/BSDPAN -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector -I/usr/l ocal/include -std=c89 -O2 -pipe -march=athlon64 -fno-strict-aliasing -Wall -ansi -W -Wextra -Wdeclaration-after-statement -Wendif-labels -Wc++-compat LD_LIBRARY_PATH=/usr/ports/lang/perl5.12/work/perl-5.12.1 cc -Wl,-E -fstack-protector -L/usr/local/lib -o miniperlgv.o toke.o perly.o pad.o regcomp.o dump.o util.o mg.o reent r.o mro.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o globals.o perlio.o perlapi.o numeric.o mathoms.o lo cale.o pp_pack.o pp_sort.ominiperlmain.o opmini.o perlmini.o -lm -lcrypt -lutil LD_LIBRARY_PATH=/usr/ports/lang/perl5.12/work/perl-5.12.1 ./miniperl -w -Ilib -MExporter -e '?' || make minitest Segmentation fault (core dumped) LD_LIBRARY_PATH=/usr/ports/lang/perl5.12/work/perl-5.12.1 ./miniperl -Ilib make_patchnum.pl Segmentation fault (core dumped) *** Error code 139 1 error You may see some irrelevant test failures if you have been unable to build lib/Config.pm, or the Unicode data files. cd t (rm -f perl; /bin/ln -s ../miniperl perl) LD_LIBRARY_PATH=/usr/ports/lang/perl5.12/work/perl-5.12.1 ./perl TEST -minitest base/*.t comp/*.t cmd/*.t run/*.t io/*.t re/ *.t op/*.t uni/*.t /dev/tty Segmentation fault (core dumped) LD_LIBRARY_PATH=/usr/ports/lang/perl5.12/work/perl-5.12.1 ./miniperl -Ilib make_patchnum.pl LD_LIBRARY_PATH=/usr/ports/lang/perl5.12/work/perl-5.12.1 ./miniperl -Ilib autodoc.pl Segmentation fault (core dumped) *** Error code 139 Segmentation fault (core dumped) *** Error code 139 2 errors *** Error code 1 Stop in /usr/ports/lang/perl5.12. *** Error code 1 Stop in /usr/ports/lang/perl5.12. -- The complete build log can be found at: http://people.freebsd.org/~lioux/perl5.12_build_log.bz2 Let me know if there is anything I can do to help. Regards, -- Mario S F Ferreira - DF - Brazil - I guess this is a signature. feature, n: a documented bug | bug, n: an undocumented feature ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org