Skip Menu |

This queue is for tickets about the Cwd CPAN distribution.

Report information
The Basics
Id: 4681
Status: resolved
Priority: 0/
Queue: Cwd

People
Owner: Nobody in particular
Requestors: blair [...] orcaware.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.09
Fixed in: (no value)



Subject: Cwd 2.10 doesn't build with static Perl
Hello, I have a static version of Perl 5.8.2 compiled with -pg to run performance tests. Building Cwd 2.10 on this gets a core dump: % make cp Cwd.pm blib/lib/Cwd.pm /opt/i386-linux/installed/perl-5.8.2-g-pg/bin/perl5.8.2 /opt/i386-linux/installed/perl-5.8.2-g-pg/lib/5.8.2/ExtUtils/xsubpp -typemap /opt/i386-linux/installed/perl-5.8.2-g-pg/lib/5.8.2/ExtUtils/typemap Cwd.xs > Cwd.xsc && mv Cwd.xsc Cwd.c /opt/i386-linux/gcc/bin/gcc -c -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -g -pg -O3 -march=i386 -mcpu=i686 -DVERSION=\"2.11\" -DXS_VERSION=\"2.11\" "-I/opt/i386-linux/installed/perl-5.8.2-g-pg/lib/5.8.2/i686-linux-thread-multi/CORE" Cwd.c rm -rf blib/arch/auto/Cwd/Cwd.a /usr/bin/ar cr blib/arch/auto/Cwd/Cwd.a Cwd.o && : blib/arch/auto/Cwd/Cwd.a chmod 755 blib/arch/auto/Cwd/Cwd.a Manifying blib/man3/Cwd.3 orcaware% make test rm -rf blib/arch/auto/Cwd/Cwd.a /usr/bin/ar cr blib/arch/auto/Cwd/Cwd.a Cwd.o && : blib/arch/auto/Cwd/Cwd.a chmod 755 blib/arch/auto/Cwd/Cwd.a Writing "Makefile.aperl" for this perl Attempt to free unreferenced scalar: SV 0x859a8cc at blib/lib/Cwd.pm line 162. make: *** [Makefile.aperl] Segmentation fault (core dumped) Here's a stack trace: #0 0x081dc51d in Perl_pp_entersub (my_perl=0x8573588) at pp_hot.c:2606 2606 if (!CvROOT(cv) && !CvXSUB(cv)) { (gdb) bt #0 0x081dc51d in Perl_pp_entersub (my_perl=0x8573588) at pp_hot.c:2606 #1 0x081bf34d in Perl_runops_debug (my_perl=0x8573588) at dump.c:1438 #2 0x0815901d in S_call_body (my_perl=0x8573588, myop=0xbfffe1e0, is_eval=0) at perl.c:2224 #3 0x08158d0a in Perl_call_sv (my_perl=0x8573588, sv=0x8573588, flags=6) at perl.c:2142 #4 0x0815ce06 in S_call_list_body (my_perl=0x8573588, cv=0x2a7) at perl.c:4393 #5 0x0815cb10 in Perl_call_list (my_perl=0x8573588, oldscope=22, paramList=0x882bc54) at perl.c:4322 #6 0x081a2007 in Perl_newATTRSUB (my_perl=0x8573588, floor=623, o=0x16, proto=0x8573588, attrs=0x0, block=0x88052c8) at op.c:4367 #7 0x08196c36 in Perl_yyparse (my_perl=0x8573588) at perly.y:355 #8 0x0820f310 in S_doeval (my_perl=0x8573588, gimme=0, startop=0x0, outside=0x8584a30, seq=679) at pp_ctl.c:2802 #9 0x08210285 in Perl_pp_require (my_perl=0x8573588) at pp_ctl.c:3299 #10 0x081bf34d in Perl_runops_debug (my_perl=0x8573588) at dump.c:1438 #11 0x0815901d in S_call_body (my_perl=0x8573588, myop=0xbfffe650, is_eval=0) at perl.c:2224 #12 0x08158d0a in Perl_call_sv (my_perl=0x8573588, sv=0x8573588, flags=6) at perl.c:2142 #13 0x0815ce06 in S_call_list_body (my_perl=0x8573588, cv=0x2a7) at perl.c:4393 #14 0x0815cb10 in Perl_call_list (my_perl=0x8573588, oldscope=15, paramList=0x8595b0c) at perl.c:4322 #15 0x081a2007 in Perl_newATTRSUB (my_perl=0x8573588, floor=408, o=0xf, proto=0x8573588, attrs=0x0, block=0x8804b78) at op.c:4367 #16 0x08196c36 in Perl_yyparse (my_perl=0x8573588) at perly.y:355 #17 0x0820f310 in S_doeval (my_perl=0x8573588, gimme=0, startop=0x0, outside=0x8584a30, seq=679) at pp_ctl.c:2802 #18 0x08210285 in Perl_pp_require (my_perl=0x8573588) at pp_ctl.c:3299 #19 0x081bf34d in Perl_runops_debug (my_perl=0x8573588) at dump.c:1438 #20 0x0815901d in S_call_body (my_perl=0x8573588, myop=0xbfffeac0, is_eval=0) at perl.c:2224 #21 0x08158d0a in Perl_call_sv (my_perl=0x8573588, sv=0x8573588, flags=6) at perl.c:2142 #22 0x0815ce06 in S_call_list_body (my_perl=0x8573588, cv=0x2a7) at perl.c:4393 #23 0x0815cb10 in Perl_call_list (my_perl=0x8573588, oldscope=9, paramList=0x8800cc4) at perl.c:4322 #24 0x081a2007 in Perl_newATTRSUB (my_perl=0x8573588, floor=199, o=0x9, proto=0x8573588, attrs=0x0, block=0x8817088) at op.c:4367 #25 0x0819def4 in Perl_utilize (my_perl=0x8573588, aver=1, floor=679, version=0x0, idop=0x8804ad8, arg=0x0) at op.c:2975 #26 0x08196eb3 in Perl_yyparse (my_perl=0x8573588) at perly.y:414 #27 0x0820f310 in S_doeval (my_perl=0x8573588, gimme=0, startop=0x0, outside=0x8584a30, seq=679) at pp_ctl.c:2802 #28 0x08210285 in Perl_pp_require (my_perl=0x8573588) at pp_ctl.c:3299 #29 0x081bf34d in Perl_runops_debug (my_perl=0x8573588) at dump.c:1438 #30 0x081583f8 in S_run_body (my_perl=0x8573588, oldscope=679) at perl.c:1860 #31 0x08158155 in perl_run (my_perl=0x8573588) at perl.c:1779 #32 0x0804d594 in main (argc=679, argv=0x2a7, env=0xbffff000) at perlmain.c:86 #33 0x42015704 in __libc_start_main () from /lib/tls/libc.so.6 Best, Blair % /opt/i386-linux/installed/perl-5.8.2-g-pg/bin/perl -V Summary of my perl5 (revision 5.0 version 8 subversion 2) configuration: Platform: osname=linux, osvers=2.4.20-20.9, archname=i686-linux-thread-multi uname='linux orcaware.com 2.4.20-20.9 #1 mon aug 18 11:45:58 edt 2003 i686 i686 i386 gnulinux ' config_args='-Dprefix=/opt/i386-linux/installed/perl-5.8.2-g-pg -Dcc=/opt/i386-linux/gcc/bin/gcc -Doptimize=-g -pg -O3 -march=i386 -mcpu=i686 -Uinstallusrbinperl -Ulocincpth -Duseshrplib -Dcf_email=blair@orcaware.com -Ui_db -Uversiononly -Ubincompat5005 -Dusethreads -Duseithreads -Dlibpth=/lib /usr/lib -Dlibspath=/lib /usr/lib' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef useithreads=define usemultiplicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='/opt/i386-linux/gcc/bin/gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm', optimize='-g -pg -O3 -march=i386 -mcpu=i686', cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -I/usr/include/gdbm' ccversion='', gccversion='3.3.2', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='ld', ldflags ='-pg' libpth=/lib /usr/lib libs=-lnsl -lgdbm -ldl -lm -lcrypt -lutil -lpthread -lc perllibs=-lnsl -lgdbm -ldl -lm -lcrypt -lutil -lpthread -lc libc=/lib/libc-2.3.2.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.3.2' Dynamic Linking: dlsrc=dl_none.xs, dlext=none, d_dlsymun=undef, ccdlflags='' cccdlflags='', lddlflags='' Characteristics of this binary (from libperl): Compile-time options: DEBUGGING MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT Built under linux Compiled at Nov 22 2003 11:37:18 @INC: /opt/i386-linux/installed/perl-5.8.2-g-pg/lib/5.8.2/i686-linux-thread-multi /opt/i386-linux/installed/perl-5.8.2-g-pg/lib/5.8.2 /opt/i386-linux/installed/perl-5.8.2-g-pg/lib/site_perl/5.8.2/i686-linux-thread-multi /opt/i386-linux/installed/perl-5.8.2-g-pg/lib/site_perl/5.8.2 /opt/i386-linux/installed/perl-5.8.2-g-pg/lib/site_perl .
Unfortunately I have no clue what the problem is or how to fix it. Is it still broken in Cwd 2.14? -Ken
From: blair [...] orcaware.com
Yes, it still fails. I'll take a closer look into the core file and see what the stack trace shows. Blair
From: blair [...] orcaware.com
Good progress. If you change this in the Makefile: --- Makefile.orig 2004-01-14 08:57:36.000000000 -0800 +++ Makefile 2004-01-14 09:00:21.000000000 -0800 @@ -804,7 +804,7 @@ $(MAKE_APERL_FILE) : $(FIRST_MAKEFILE) $(NOECHO) $(ECHO) Writing \"$(MAKE_APERL_FILE)\" for this $(MAP_TARGET) - $(NOECHO) $(PERLRUNINST) \ + $(PERLRUNINST) \ Makefile.PL DIR= \ MAKEFILE=$(MAKE_APERL_FILE) LINKTYPE=static \ MAKEAPERL=1 NORECURS=1 CCCDLFLAGS= to see the command that generates Makefile.aperl and then run make test: Writing "Makefile.aperl" for this perl /opt/i386-linux/installed/perl-5.8.2-g-pg/bin/perl5.8.2 "- Iblib/arch" "-Iblib/lib" \ Makefile.PL DIR= \ MAKEFILE=Makefile.aperl LINKTYPE=static \ MAKEAPERL=1 NORECURS=1 CCCDLFLAGS= Attempt to free unreferenced scalar: SV 0x8616808 at blib/lib/Cwd.pm line 162. make: *** [Makefile.aperl] Segmentation fault (core dumped) Now try running the same command minus the -I's and it'll run just fine: /opt/i386-linux/installed/perl-5.8.2-g-pg/bin/perl5.8.2 \ Makefile.PL DIR= \ MAKEFILE=Makefile.aperl LINKTYPE=static \ MAKEAPERL=1 NORECURS=1 CCCDLFLAGS= Writing Makefile.aperl for Cwd In fact, trying to run perl Makefile.PL make make test with Cwd 2.08, the same version that came with perl 5.8.2 runs fine, so this just looks like a mismatch between .pm and .xs code. So we just have to make certain that Makefile.PL uses the already installed Cwd instead of the new Cwd. Blair
Hi, What happens if you use the following patch to the Makefile.PL? --- Makefile.PL 2004/01/03 04:41:52 1.9 +++ Makefile.PL 2004/01/15 02:21:02 @@ -1,7 +1,9 @@ # Note: this file was auto-generated by Module::Build::Compat version 0.03 # Generated by Module::Build::Compat->create_makefile_pl +BEGIN { @INC = grep {!/blib/} @INC } use ExtUtils::MakeMaker; WriteMakefile ( NAME => 'Cwd',
From: blair [...] orcaware.com
That did the trick. Works like a charm. Best, Blair
Okay, I've just uploaded version 2.15 which should fix this problem. -Ken