Mailing List Archive

Strange problem with DBM
I've compiled 5.001m on HP-UX and all the tests went fine. This simple
test program does not work though (it prints nothing):

@INC = ("/tmp/perl/perl5.001m/lib");

$file = "/tmp/x_$$";

dbmopen(%x, $file, 0644) || die;
$x{'as'} = 'de';
dbmclose(%x);

dbmopen(%x, $file, 0644) || die;
print "$x{'as'}\n";
dbmclose(%x);

unlink(<$x.*>);

Running with the debugger gives me File.pm:9 (the 1; at the end) as
last line executed so it seems that the previous line (bootstrap
SDBM_File) silently failed... Here is the trace:

SDBM_File::(/tmp/perl/perl5.001m/lib/SDBM_File.pm:7):
7: bootstrap SDBM_File;
DynaLoader::bootstrap(/tmp/perl/perl5.001m/lib/DynaLoader.pm:393):
393: local(@args) = @_;
DynaLoader::bootstrap(/tmp/perl/perl5.001m/lib/DynaLoader.pm:394):
394: local($module) = $args[0];
DynaLoader::bootstrap(/tmp/perl/perl5.001m/lib/DynaLoader.pm:395):
395: local(@dirs, $file);
DynaLoader::bootstrap(/tmp/perl/perl5.001m/lib/DynaLoader.pm:397):
397: confess "Usage: DynaLoader::bootstrap(module)" unless $module;
DynaLoader::bootstrap(/tmp/perl/perl5.001m/lib/DynaLoader.pm:401):
401: croak("Can't load module $module, dynamic loading not available in this perl.\n".
402: " (You may need to build a new perl executable which either supports\n".
403: " dynamic loading or has the $module module statically linked into it.)\n")
404: unless defined(&dl_load_file);
DynaLoader::bootstrap(/tmp/perl/perl5.001m/lib/DynaLoader.pm:406):
406: print STDERR "DynaLoader::bootstrap($module)\n" if $dl_debug;
DynaLoader::bootstrap(/tmp/perl/perl5.001m/lib/DynaLoader.pm:408):
408: my(@modparts) = split(/::/,$module);
DynaLoader::bootstrap(/tmp/perl/perl5.001m/lib/DynaLoader.pm:409):
409: my($modfname) = $modparts[-1];
DynaLoader::bootstrap(/tmp/perl/perl5.001m/lib/DynaLoader.pm:410):
410: my($modpname) = join('/',@modparts);
DynaLoader::bootstrap(/tmp/perl/perl5.001m/lib/DynaLoader.pm:411):
411: foreach (@INC) {
DynaLoader::bootstrap(/tmp/perl/perl5.001m/lib/DynaLoader.pm:412):
412: my $dir = "$_/auto/$modpname";
DynaLoader::bootstrap(/tmp/perl/perl5.001m/lib/DynaLoader.pm:413):
413: next unless -d $dir; # skip over uninteresting directories
DynaLoader::bootstrap(/tmp/perl/perl5.001m/lib/DynaLoader.pm:416):
416: last if ($file=_check_file("$dir/$modfname.$dl_dlext"));
DynaLoader::_check_file(/tmp/perl/perl5.001m/lib/DynaLoader.pm:468):
468: my($file) = @_;
DynaLoader::_check_file(/tmp/perl/perl5.001m/lib/DynaLoader.pm:469):
469: return $file if (!$do_expand && -f $file); # the common case
DynaLoader::bootstrap(/tmp/perl/perl5.001m/lib/DynaLoader.pm:422):
422: $file = dl_findfile(@dirs, map("-L$_",@INC), $modfname) unless $file;
DynaLoader::bootstrap(/tmp/perl/perl5.001m/lib/DynaLoader.pm:424):
424: croak "Can't find loadable object for module $module in \@INC"
425: unless $file;
DynaLoader::bootstrap(/tmp/perl/perl5.001m/lib/DynaLoader.pm:427):
427: my($bootname) = "boot_$module";
DynaLoader::bootstrap(/tmp/perl/perl5.001m/lib/DynaLoader.pm:428):
428: $bootname =~ s/\W/_/g;
DynaLoader::bootstrap(/tmp/perl/perl5.001m/lib/DynaLoader.pm:429):
429: @dl_require_symbols = ($bootname);
DynaLoader::bootstrap(/tmp/perl/perl5.001m/lib/DynaLoader.pm:434):
434: my $bs = $file;
DynaLoader::bootstrap(/tmp/perl/perl5.001m/lib/DynaLoader.pm:435):
435: $bs =~ s/(\.\w+)?$/\.bs/; # look for .bs 'beside' the library
DynaLoader::bootstrap(/tmp/perl/perl5.001m/lib/DynaLoader.pm:436):
436: if (-s $bs) { # only read file if it's not empty
DynaLoader::bootstrap(/tmp/perl/perl5.001m/lib/DynaLoader.pm:450):
450: my $libref = dl_load_file($file) or
451: croak "Can't load '$file' for module $module: ".dl_error()."\n";
DynaLoader::bootstrap(/tmp/perl/perl5.001m/lib/DynaLoader.pm:453):
453: my(@unresolved) = dl_undef_symbols();
DynaLoader::bootstrap(/tmp/perl/perl5.001m/lib/DynaLoader.pm:454):
454: carp "Undefined symbols present after loading $file: @unresolved\n"
455: if (@unresolved);
DynaLoader::bootstrap(/tmp/perl/perl5.001m/lib/DynaLoader.pm:457):
457: my $boot_symbol_ref = dl_find_symbol($libref, $bootname) or
458: croak "Can't find '$bootname' symbol in $file\n";
DynaLoader::bootstrap(/tmp/perl/perl5.001m/lib/DynaLoader.pm:460):
460: dl_install_xsub("${module}::bootstrap", $boot_symbol_ref, $file);
DynaLoader::bootstrap(/tmp/perl/perl5.001m/lib/DynaLoader.pm:463):
463: &{"${module}::bootstrap"}(@args);
DynaLoader::bootstrap(/tmp/perl/perl5.001m/lib/DynaLoader.pm:463):
463: &{"${module}::bootstrap"}(@args);
SDBM_File::(/tmp/perl/perl5.001m/lib/SDBM_File.pm:9):
9: 1;

Do you know what went wrong?

Lionel Cons

+------- CERN - European Laboratory for Particle Physics -------+
| E-mail: Lionel.Cons@cern.ch |
| Earth-mail: CN/DCI/UWS, CERN, CH-1211 GENEVE 23, Switzerland |
| Phone: + (41 22) 767 49 13 Fax: + (41 22) 767 71 55 |
+---------------------------------------------------------------+

BTW, here is myconfig:

Summary of my perl5 (patchlevel 1) configuration:
Platform:
osname=hpux, osver=9, archname=hpux
uname='hp-ux mercury a.09.01 a 9000715 2006134867 two-user license '
hint=recommended
Compiler:
cc='cc', optimize='+O1', ld='ld'
cppflags='-D_POSIX_SOURCE -D_HPUX_SOURCE -Aa'
ccflags ='-D_POSIX_SOURCE -D_HPUX_SOURCE -Aa'
ldflags =''
stdchar='unsigned char', d_stdstdio=define, usevfork=false
voidflags=15, castflags=0, d_casti32=define, d_castneg=define
intsize=4, alignbytes=8, usemymalloc=y, randbits=15
Libraries:
so=sl
libpth=/lib/pa1.1 /lib /usr/lib /usr/local/lib
libs=-lm -ldld
libc=/lib/libc.sl
Dynamic Linking:
dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=undef
cccdlflags='+z', ccdlflags='-Wl,-E ', lddlflags='-b'
Re: Strange problem with DBM [ In reply to ]
> I've compiled 5.001m on HP-UX and all the tests went fine. This simple
> test program does not work though (it prints nothing):

This program works for me on 5.001m. I wonder why it was using SDBM_File,
and not NDBM_File (which is what mine uses). What are your dynamic_ext and
static_ext variables in config.sh set to?

Jeff
Re: Strange problem with DBM [ In reply to ]
Jeff Okamoto writes:
>
> This program works for me on 5.001m. I wonder why it was using SDBM_File,
> and not NDBM_File (which is what mine uses). What are your dynamic_ext and
> static_ext variables in config.sh set to?

This was a bug in hpux_9.sh, I added ndbm and dbm to the $libswanted
and now it works fine.

Lionel Cons

+------- CERN - European Laboratory for Particle Physics -------+
| E-mail: Lionel.Cons@cern.ch |
| Earth-mail: CN/DCI/UWS, CERN, CH-1211 GENEVE 23, Switzerland |
| Phone: + (41 22) 767 49 13 Fax: + (41 22) 767 71 55 |
+---------------------------------------------------------------+

#!/usr/local/bin/perl -s-- -export-a-crypto-system-sig -RSA-in-3-lines-PERL
($k,$n)=@ARGV;$m=unpack(H.$w,$m."\0"x$w),$_=`echo "16do$w 2+4Oi0$d*-^1[d2%
Sa2/d0<X+d*La1=z\U$n%0]SX$k"[$m*]\EszlXx++p|dc`,s/^.|\W//g,print pack('H*'
,$_)while read(STDIN,$m,($w=2*$d-1+length($n||die"$0 [-d] k n\n")&~1)/2)