Skip Menu |

This queue is for tickets about the Convert-Binary-C CPAN distribution.

Report information
The Basics
Id: 12668
Status: resolved
Priority: 0/
Queue: Convert-Binary-C

People
Owner: Nobody in particular
Requestors: rob.west [...] tekelec.com
Cc:
AdminCc:

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



Subject: Some Config variables corrupted when using this module
Distribution name and version: Convert-Binary-C-0.58 Perl version: 5.8.0 built for i386-linux-thread-multi Operating System vendor and version: Linux nc1lx2132b 2.4.20-8smp #1 SMP Thu Mar 13 17:45:54 EST 2003 i686 i686 i386 GNU/Linux Symptom: My 'make test' failed on 132_native.t. Here's the relevant output: t/132_native.........ok 7/59# Test 11 got: '4' issymlink='/usr/bin/t' (t/132_native.t at line 56) # Expected: '4' # t/132_native.t line 56 is: ok($Config{lc $_}, $c->native($_)); # Test 17 got: '4' lp='' lpr='' ls='ls' lseeksize' (t/132_native.t at line 56 fail #4) # Expected: '4' # Test 19 got: '' (t/132_native.t at line 56 fail #5) # Expected: '8' t/132_native.........FAILED tests 11, 17, 19 Failed 3/59 tests, 94.92% okay I tried running t/132_native.t directly: ok 10 # native(IntSize) = 4 # found $Config{intsize} not ok 11 # Test 11 got: '4' issymlink='/usr/bin/t' (t/132_native.t at line 56) # Expected: '4' # t/132_native.t line 56 is: ok($Config{lc $_}, $c->native($_)); ok 12 # native(CharSize) = 1 # found $Config{charsize} ok 13 ok 14 # native(ShortSize) = 2 # found $Config{shortsize} ok 15 ok 16 # native(LongSize) = 4 # found $Config{longsize} not ok 17 # Test 17 got: '4' lp='' lpr='' ls='ls' lseeksize' (t/132_native.t at line 56 fail #4) # Expected: '4' ok 18 # native(LongLongSize) = 8 # found $Config{longlongsize} not ok 19 # Test 19 got: '' (t/132_native.t at line 56 fail #5) # Expected: '8' ok 20 To narrow it down, I wrote the following: use Test; use Config; use Convert::Binary::C; BEGIN { plan tests => 1 } ok($Config{'intsize'}, '4'); Here are the results: # perl -Iblib/arch -Iblib/lib t/config.t 1..1 # Running under perl version 5.008 for linux # Current time local: Tue May 3 17:57:43 2005 # Current time GMT: Tue May 3 21:57:43 2005 # Using Test.pm version 1.23 not ok 1 # Test 1 got: '4' issymlin' (t/config.t at line 7) # Expected: '4' # t/config.t line 7 is: ok($Config{'intsize'}, '4'); If I comment out the 'use Convert::Binary::C;' line, I get the following: # perl -Iblib/arch -Iblib/lib t/config.t 1..1 # Running under perl version 5.008 for linux # Current time local: Tue May 3 17:58:55 2005 # Current time GMT: Tue May 3 21:58:55 2005 # Using Test.pm version 1.23 ok 1 I'd really like to use the module, but this strangeness scares me. I'm hoping there's a fairly simple answer. Thanks, Rob West
From: rob.west [...] tekelec.com
Darn it, I realized after I hit the create button that I pasted the outputs with my slightly modified version of 132_native.t. To avoid any confusion, here's the relevant output of 'make test' with the original: t/132_native.........ok 7/59# Test 11 got: '4' issymlink='/usr/bin/t' (t/132_native.t at line 56) # Expected: '4' # t/132_native.t line 56 is: ok($Config{lc $_}, $c->native($_)); # Test 17 got: '4' lp='' lpr='' ls='ls' lseeksize' (t/132_native.t at line 56 fail #4) t/132_native.........NOK 17# Expected: '4' t/132_native.........ok 18/59# Test 19 got: '' (t/132_native.t at line 56 fail #5) # Expected: '8' t/132_native.........FAILED tests 11, 17, 19 Failed 3/59 tests, 94.92% okay And, here's the relevant output of running 132_native.t directly: ok 8 # native(PointerSize) = 4 ok 9 ok 10 # native(IntSize) = 4 # found $Config{intsize} not ok 11 # Test 11 got: '4' issymlink='/usr/bin/t' (t/132_native.t at line 56) # Expected: '4' # t/132_native.t line 56 is: ok($Config{lc $_}, $c->native($_)); ok 12 # native(CharSize) = 1 # found $Config{charsize} ok 13 ok 14 # native(ShortSize) = 2 # found $Config{shortsize} ok 15 ok 16 # native(LongSize) = 4 # found $Config{longsize} not ok 17 # Test 17 got: '4' lp='' lpr='' ls='ls' lseeksize' (t/132_native.t at line 56 fail #4) # Expected: '4' ok 18 # native(LongLongSize) = 8 # found $Config{longlongsize} not ok 19 # Test 19 got: '' (t/132_native.t at line 56 fail #5) # Expected: '8' ok 20 # native(FloatSize) = 4 ok 21 ok 22 # native(DoubleSize) = 8 # found $Config{doublesize} ok 23 ok 24 # native(LongDoubleSize) = 12 ok 25 ok 26 # native(Alignment) = 4 ok 27 ok 28 # native(CompoundAlignment) = 1 ok 29
Date: Wed, 4 May 2005 09:38:24 +0200
From: Marcus Holland-Moritz <mhx-perl [...] gmx.net>
To: bug-Convert-Binary-C [...] rt.cpan.org
Subject: Re: [cpan #12668] Some Config variables corrupted when using this module
RT-Send-Cc:
Hi, thanks for taking the time to document the failure. However, I don't think this is a bug in either Convert::Binary::C or in its test suite. I rather suspect that your Config module is broken. I believe that I'm not using the Config module in obscure ways, and I've tested Convert::Binary::C successfully with all public Perl releases since 5.005_03. The expected output of running t/132_native.t is something like: 1..59 # Running under perl version 5.009003 for linux # Current time local: Wed May 4 09:00:45 2005 # Current time GMT: Wed May 4 07:00:45 2005 # Using Test.pm version 1.25 ok 1 ok 2 ok 3 ok 4 ok 5 ok 6 ok 7 ok 8 # native(PointerSize) = 4 ok 9 ok 10 # native(IntSize) = 4 # found $Config{intsize} ok 11 ok 12 # native(CharSize) = 1 # found $Config{charsize} ok 13 ok 14 # native(ShortSize) = 2 # found $Config{shortsize} ok 15 ok 16 # native(LongSize) = 4 # found $Config{longsize} ok 17 ok 18 # native(LongLongSize) = 8 # found $Config{longlongsize} ok 19 ok 20 # native(FloatSize) = 4 ok 21 ok 22 # native(DoubleSize) = 8 # found $Config{doublesize} ok 23 ok 24 # native(LongDoubleSize) = 12 ok 25 ok 26 # native(Alignment) = 4 ok 27 ok 28 # native(CompoundAlignment) = 1 ok 29 ok 30 ok 31 ok 32 ok 33 ok 34 ok 35 ok 36 ok 37 ok 38 ok 39 ok 40 ok 41 ok 42 ok 43 ok 44 ok 45 ok 46 ok 47 ok 48 ok 49 ok 50 ok 51 ok 52 ok 53 ok 54 ok 55 ok 56 ok 57 ok 58 ok 59 Note that this doesn't contain the spurious Config variables seen in your output ('issymlink', 'lp', 'lpr', ls', 'lseeksize'). The interesting thing is that 'issymlink' immediately follows 'intsize' and 'lp' immediately follows 'longsize' in Config.pm. As I'd really like to find the source of the problem, could you please send the following to me: 1) the output of perl -V 2) the files that perl -MConfig -le 'print $INC{"Config.pm"}' and perl -MTest -le 'print $INC{"Test.pm"}' point to (i.e. your Config and Test modules) Please attach the Config.pm / Test.pm so they won't be messed up by email clients and/or the CPAN RT system. Thanks, Marcus
From: rob.west [...] tekelec.com
Marcus, Thanks very much for being so responsive. I thought it might be my Config module also, which is why I wrote the config.t test I mentioned. It passes when your module is not used and fails when it is used. However, I suppose that doesn't necessarily prove it beyond a doubt. I appreciate any help you can provide. I have attached my Config.pm and Test.pm as you requested. Here is the output from the commands. I do notice that the output from perl -V looks very suspect: # perl -V Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration: Platform: osname=linux, osvers=2.4.20-2.48smp, archname=i386-linux-thread-multi uname='linux str' config_args='-des -Doptimize=-O2 -march=i386 -mcpu=i686 -g -Dmyhostname=localhost -Dperladmin=root@localhost -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dinstallprefix=/usr -Dprefix=/usr -Darchname=i386-linux -Dvendorprefix=/usr -Dsiteprefix=/usr -Dotherlibdirs=/usr/lib/perl5/5.8.0 -Duseshrplib -Dusethreads -Duseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -isr' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef' useithreads=define usemultiplicity= useperlio= d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=un uselongdouble= usemymalloc=, bincompat5005=undef Compiler: cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm', optimize='', cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -I/usr/local/include -I/usr/include/gdbm' ccversion='', gccversion='3.2.2 20030213 (Red Hat Linux 8.0 3.2.2-1)', gccosandvers='' gccversion='3.2.2 200302' intsize=e, longsize= , ptrsize=p, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long' k', ivsize=4' ivtype='long' known_ext, nvtype='double' o_nonbl', nvsize=, Off_t='', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='gcc' l', ldflags =' -L/usr/local/lib' ldf' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -lgdbm -ldb -ldl -lm -lpthread -lc -lcrypt -lutil perllibs= libc=/lib/libc-2.3.1.so, so=so, useshrplib=true, libperl=libper gnulibc_version='2.3.1' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so', d_dlsymun=undef, ccdlflags='-rdynamic -Wl,-rpath,/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE' cccdlflags='-fPIC' ccdlflags='-rdynamic -Wl,-rpath,/usr/lib/perl5', lddlflags='s Unicode/Normalize XS/A' Characteristics of this binary (from libperl): Compile-time options: DEBUGGING MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT Locally applied patches: MAINT18379 Built under linux Compiled at Feb 18 2003 22:19:53 @INC: /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 . # perl -MConfig -le 'print $INC{"Config.pm"}' /usr/lib/perl5/5.8.0/i386-linux-thread-multi/Config.pm # perl -MTest -le 'print $INC{"Test.pm"}' /usr/lib/perl5/5.8.0/Test.pm Thanks, Rob

Message body is not shown because it is too large.

From: rob.west [...] tekelec.com
Here's the Config.pm attachment...

Message body is not shown because it is too large.

From: rob.west [...] tekelec.com
Here's the Config.pm attachment...

Message body is not shown because it is too large.

From: rob.west [...] tekelec.com
OK, it is definitely something wrong with my environment, but I don't know what. For kicks, I tried running 'make test' as a regular user vs. root, and it passed. Since I need to be root to do 'make install', I'm still a little worried, but I will progress. I'd love to figure out what the diff is that is causing this so I could fix or work around it, though. Thanks again, Marcus, for the module and the support! - Rob
Date: Wed, 4 May 2005 22:29:35 +0200
From: Marcus Holland-Moritz <mhx-perl [...] gmx.net>
To: bug-Convert-Binary-C [...] rt.cpan.org
Subject: Re: [cpan #12668] Some Config variables corrupted when using this module
RT-Send-Cc:
Hi Rob, good news first: This is definitely not a bug in Convert::Binary::C. Your Config.pm and Test.pm both look sane. From the perl -V output I could see that you're using a rather old RedHat 8.0 Linux. So I just downloaded the installation CD, installed RedHat under VMware, up2date'd to a similar perl version as yours and was immediately able to reproduce the problem. I still didn't know what the problem was, but I could reduce it to: [mhx@redhat mhx]$ perl -MConfig -le'print "$_=[$Config{$_}]" for qw(path_sep intsize)' path_sep=[:] intsize=[4' issymlin] So, this doesn't use any modules but Config. The trick is to get more than one value from %Config. The first value always seems to be ok. But I still didn't know the cause. So I asked the friendly guys on #p5p and Nicholas Clark just mentioned "UTF8" and immediately it was clear. [mhx@redhat mhx]$ set | grep -i utf LANG=en_US.UTF-8 SUPPORTED=en_US.UTF-8:en_US:en [mhx@redhat mhx]$ LANG=C perl -MConfig -le'print "$_=[$Config{$_}]" for qw(path_sep intsize)' path_sep=[:] intsize=[4] So this is one of the many UTF8 bugs in your version of perl that have been fixed in more recent versions. You can try to export LANG=C make test and you should see all tests pass. I hope you'll still consider using Convert::Binary::C. Let me know if you like it! I'm going to rm -rf /tmp/redhat now... ;-) Best wishes, Marcus
Marcus, You're awesome. I set LANG to en_US to match the value under my regular user account, and lo, and behold, all tests pass! By the way, I was actually using a old RH 9.0 dist (it _is_ wierd that the output said 8.0). I had wondered if that was the problem; so, this morning, I did a full yum update to the latest RH9 Fedora Legacy packages, but got the same problem. Since I'm likely not the only one that needs/haves to run RH9 for the time being, it would probably be a good bet to mention the UTF-8 problem in the Config.pm perldoc (and maybe in your's also, to avoid future invalid bug reports ;) ). Do you think I should I enter a documentation request for Config.pm (not entirely sure how best to do that)? Thanks again! Rob