[prev in list] [next in list] [prev in thread] [next in thread]
List: majordomo-workers
Subject: Odd problems with $/ and thread-enabled Perl
From: Jason L Tibbitts III <tibbs () math ! uh ! edu>
Date: 1999-03-10 2:18:53
[Download RAW message or body]
[Note CC:]
I've had a few people testing Majordomo2 snapshots who have tried to use a
Perl binary compiled with threading enabled. This failed in bizarre ways.
I built a threaded and non-threaded Perl on one system and found that the
problem stems from $/ becoming undefined for reasons I don't understand.
An example:
XYX:epithumia:~/majordomo> cat testit
BEGIN {print ord($/), "\n";}
XYX:epithumia:~/majordomo> perl -w testit
10
XYX:epithumia:~/majordomo> thrperl -w testit
Use of uninitialized value at testit line 1.
0
This is rather maddening. Why is $/ undefined here? Note that if I don't
wrap it in BEGIN the result is as expected with either Perl, but in my real
code the value seems to either start undefined or magically become that way
by the first non-'use', non-'BEGIN' statement. I can probably just set $/
explicitly where it matters, but this troubles me.
XYX:epithumia:~/majordomo> perl -V
Summary of my perl5 (5.0 patchlevel 5 subversion 2) configuration:
Platform:
osname=linux, osvers=2.0.35, archname=i686-linux
uname='linux epithumia.math.uh.edu 2.0.35 #1 thu oct 1 04:50:26 cdt 1998 i686 unknown '
hint=previous, useposix=true, d_sigaction=define
usethreads=undef useperlio=undef d_sfio=undef
Compiler:
cc='cc', optimize='-O2', gccversion=egcs-2.90.27 980315 (egcs-1.0.2 release)
cppflags='-D_REENTRANT -Dbool=char -DHAS_BOOL -I/usr/local/include'
ccflags ='-D_REENTRANT -Dbool=char -DHAS_BOOL -I/usr/local/include'
stdchar='char', d_stdstdio=define, usevfork=false
intsize=4, longsize=4, ptrsize=4, doublesize=8
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
alignbytes=4, usemymalloc=n, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lndbm -ldb -ldl -lm -lpthread -lc -lposix -lcrypt
libc=, so=so, useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'
Characteristics of this binary (from libperl):
Built under linux
Compiled at Mar 9 1999 19:44:49
@INC:
/usr/lib/perl5/5.00502/i686-linux
/usr/lib/perl5/5.00502
/usr/lib/perl5/site_perl/5.005/i686-linux
/usr/lib/perl5/site_perl/5.005
.
XYX:epithumia:~/majordomo> thrperl -V
Summary of my perl5 (5.0 patchlevel 5 subversion 2) configuration:
Platform:
osname=linux, osvers=2.0.35, archname=i686-linux-thread
uname='linux epithumia.math.uh.edu 2.0.35 #1 thu oct 1 04:50:26 cdt 1998 i686 unknown '
hint=recommended, useposix=true, d_sigaction=define
usethreads=define useperlio=undef d_sfio=undef
Compiler:
cc='cc', optimize='-O2', gccversion=egcs-2.90.27 980315 (egcs-1.0.2 release)
cppflags='-D_REENTRANT -Dbool=char -DHAS_BOOL -I/usr/local/include'
ccflags ='-D_REENTRANT -Dbool=char -DHAS_BOOL -I/usr/local/include'
stdchar='char', d_stdstdio=define, usevfork=false
intsize=4, longsize=4, ptrsize=4, doublesize=8
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
alignbytes=4, usemymalloc=n, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lndbm -ldb -ldl -lm -lpthread -lc -lposix -lcrypt
libc=, so=so, useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'
Characteristics of this binary (from libperl):
Built under linux
Compiled at Mar 9 1999 13:48:33
@INC:
/usr/lib/perl5/5.00502/i686-linux-thread
/usr/lib/perl5/5.00502
/usr/lib/perl5/site_perl/5.005/i686-linux-thread
/usr/lib/perl5/site_perl/5.005
.
--
Jason L Tibbitts III - tibbs@uh.edu - 713/743-3486 - 660PGH - 94 PC800
System Manager: University of Houston Department of Mathematics
"I survived while Ruby died in Jackie's trashy fantasy..."
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic