#263 PDL::IO::Storable not compatible with Inline::Pdlpp

closed-out-of-date
nobody
other (94)
5
2011-04-26
2011-04-05
No

Environment:
Linux 2.6.18-92.el5 x86_64 x86_64 x86_64 GNU/Linux
Perl v5.8.8 built for x86_64-linux-thread-multi
PDL 2.4.3
Storable 2.18
Inline 0.44

-------------------------------------
Code to reproduce bug:

#!/usr/bin/perl

use PDL;
use Storable;
use Inline qw(Pdlpp);
use PDL::IO::Storable;

my $a=pdl([1,2,3]);
my $b=pdl([3,3,3]);
$c=$a->testadd($b);
print $c."\n";
store $c, 'test.stor';

__DATA__

__Pdlpp__

pp_def('testadd',
Pars => 'a();b();[o]c();',
Code => '$c()=$a()+$b();'
);

-------------------------------------
Error Message above code generates:

An eval() failed in Inline::glue:
%Config::Config is read-only
Compilation failed in require at /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/Inline/Pdlpp.pm line 10.
Compilation failed in require at (eval 39) line 3.

at ./t line 0
INIT failed--call queue aborted.

-------------------------------------
Findings:
PDL::IO::Storable has the line "use Config;" inside its pdlunpack method. This replaces the Config definition that Inline::Pdlpp would other wise try to setup. When Inline::glue attempts to eval "require Inline::Pdlpp" this attempts to "require PDL::Core::Dev" which produces the "%Config::Config is read-only" message.

That message comes from the module Config_heavy which is loaded from Config. The only way that message is generated is if you attempt to call STORE, DELETE, or CLEAR for Config.

Inside PDL::Core::Dev the following two lines:

my $inc = defined $PDL::Config{MALLOCDBG}->{include} ?
"$PDL::Config{MALLOCDBG}->{include}" : '';
my $libs = defined $PDL::Config{MALLOCDBG}->{libs} ?
"$PDL::Config{MALLOCDBG}->{libs}" : '';

Have a side effect of if MALLCODBG does not exist it triggers an assign which calls STORE and generates the error identified. The Config Inline::Pdlpp would usually define has these values however because of PDL::IO::Storable is causing Config to get replaced with Config and it does not have this value it errors.

-------------------------------------

perldl -V
perlDL shell v1.33
PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file
'COPYING' in the PDL distribution. This is free software and you
are welcome to redistribute it under certain conditions, see
the same file for details.

Summary of my PDL configuration

VERSION: PDL v2.4.3

$%PDL::Config = {
'BADVAL_PER_PDL' => '0',
'WITH_PROJ' => undef,
'FFTW_TYPE' => 'double',
'FFTW_LIBS' => [
'/lib',
'/usr/lib64',
'/usr/lib',
'/usr/local/lib'
],
'WITH_FFTW' => undef,
'GSL_LIBS' => undef,
'GL_BUILD' => '1',
'WITH_IO_BROWSER' => '1',
'PROJ_INC' => undef,
'WHERE_PLPLOT_INCLUDE' => undef,
'WITH_KARMA' => '0',
'WHERE_KARMA' => undef,
'HTML_DOCS' => '1',
'WHERE_PLPLOT_LIBS' => undef,
'WITH_3D' => '1',
'FFTW_INC' => [
'/usr/include/',
'/usr/local/include'
],
'WITH_POSIX_THREADS' => '1',
'HIDE_TRYLINK' => '1',
'WITH_HDF' => undef,
'HDF_INC' => undef,
'OPENGL_LIBS' => '-L/usr/lib64/ -lGLU -lGL -lX11 -lm',
'WITH_BADVAL' => '0',
'WITH_GD' => undef,
'FITS_LEGACY' => '1',
'WITH_SLATEC' => '1',
'BADVAL_USENAN' => '0',
'TEMPDIR' => '/tmp',
'PROJ_LIBS' => undef,
'GD_LIBS' => undef,
'GSL_INC' => undef,
'GD_INC' => undef,
'OPTIMIZE' => undef,
'WITH_GSL' => undef,
'HDF_LIBS' => undef,
'MALLOCDBG' => {},
'WITH_PLPLOT' => '1'
};
Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
Platform:
osname=linux, osvers=2.6.9-78.0.1.elsmp, archname=x86_64-linux-thread-multi
uname='linux hs20-bc1-7.build.redhat.com 2.6.9-78.0.1.elsmp #1 smp tue jul 22 18:01:05 edt 2008 x86_64 x86_64 x86_64 gnulinux '
config_args='-des -Doptimize=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Dversion=5.8.8 -Dmyhostname=localhost -Dperladmin=root@localhost -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dinstallprefix=/usr -Dprefix=/usr -Dlibpth=/usr/local/lib64 /lib64 /usr/lib64 -Dprivlib=/usr/lib/perl5/5.8.8 -Dsitelib=/usr/lib/perl5/site_perl/5.8.8 -Dvendorlib=/usr/lib/perl5/vendor_perl/5.8.8 -Darchlib=/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi -Dsitearch=/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi -Dvendorarch=/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi -Darchname=x86_64-linux -Dvendorprefix=/usr -Dsiteprefix=/usr -Duseshrplib -Dusethreads -Duseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl=n -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -isr -Dd_gethostent_r_proto -Ud_endhostent_r_proto -Ud_sethostent_r_proto -Ud_endprotoent_r_proto -Ud_setprotoent_r_proto -Ud_endservent_r_proto -Ud_setservent_r_proto -Dinc_version_list=5.8.7 5.8.6 5.8.5 -Dscriptdir=/usr/bin'
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=define use64bitall=define uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
optimize='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic',
cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -I/usr/include/gdbm'
ccversion='', gccversion='4.1.2 20071124 (Red Hat 4.1.2-41)', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='gcc', ldflags =''
libpth=/usr/local/lib64 /lib64 /usr/lib64
libs=-lresolv -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
perllibs=-lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
libc=, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version='2.5'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE'
cccdlflags='-fPIC', lddlflags='-shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic'

Discussion

  • Chris Marshall

    Chris Marshall - 2011-04-05

    I can't reproduce the problem with PDL-2.4.8:

    tbug.pl
    [4 5 6]

    where tbug.pl is a cut and paste of the above
    code. PDL-2.4.3 is more than 4years out of date
    and many bugs and portability issues have been
    addressed in that time. I recommend updating
    your PDL and trying again. See http://pdl.perl.org
    for more information.

     
  • Chris Marshall

    Chris Marshall - 2011-04-05
    • status: open --> open-out-of-date
     
  • Chris Marshall

    Chris Marshall - 2011-04-12
    • milestone: 101029 -->
    • status: open-out-of-date --> pending-out-of-date
     
  • Chris Marshall

    Chris Marshall - 2011-04-12

    Marking this Pending to close in a couple of weeks unless there is follow-up
    from the original requestor to indicate that this is an on-going problem.

     
  • Matthew McGillis

    • status: pending-out-of-date --> open-out-of-date
     
  • Matthew McGillis

    Well it is an on going problem with the version we are dependent on but you are correct the identified issue is not reproducible in 2.4.8.

    Feel free to close.

     
  • Chris Marshall

    Chris Marshall - 2011-04-26
    • status: open-out-of-date --> closed-out-of-date
     
  • Chris Marshall

    Chris Marshall - 2011-04-26

    Thanks for following up. If there are specific compatibility issues
    between PDL-2.4.3 and the current PDL-2.4.9, feel free to bring
    them up on our perldl mailing list.

    We've made an effort to avoid breaking backwards compatibility
    and have been mostly successful. E.g., that 3D graphics currently
    does not support X11 embedding with the PDL::Graphics::TriD::Tk
    widget and some changes to dummy() handling of edge cases
    come to mind. TriD is in-process of being refactored. dummy() now
    behaves consistently with its definition but differently from before....

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks