[Debian-med-packaging] Bug#661793: bioperl: Error in berkeleydb3.pm while creating Temp file

Florent Angly florent.angly at gmail.com
Fri Mar 2 23:04:26 UTC 2012


Hi Olivier,

Do you have an simple example that reproduces this error?

The syntax for tying to a DB_File is, according to `perldoc DB_File`:
> [$X =] tie %hash,  'DB_File', [$filename, $flags, $mode, $DB_HASH] ;
> [$X =] tie %hash,  'DB_File', $filename, $flags, $mode, $DB_BTREE ;
So, the order of the parameters is important and you cannot simply 
interchange them.

The Perl module in question is at 
https://github.com/bioperl/bioperl-live/blob/master/Bio/DB/SeqFeature/Store/berkeleydb3.pm. 
The calling script has created and opened a temporary file and it is 
trying to put a Berkeley database in this temporary file. This Berkeley 
DB creation step fails. I suspect that it may be a permission problem... 
Does the mode 0644 solve the problem? Is there enough space on the disk?

Running the script as follows will help diagnostic what went wrong:
> perl -d `which bp_seqfeature_load.pl` [options]
Then press 'c' and send the entire backtrace of the crash when it happens.

Best,

Florent




On 01/03/12 20:23, Olivier Sallou wrote:
> Package: bioperl
> Version: 1.6.901-2
> Severity: important
> Tags: upstream
>
>   When using bp_seqfeature_load.pl I have an error at build_summary_statistics call time of berkeleydb3.pm:
>     Couldn't create temporary file for sorting: Inappropriate ioctl for device
>   It occurs in berkeleydb3.pm line 500
>
>   Looking at the code I tried to manipulate it replacing
>      my $s = tie %sort,'DB_File',$name,0666,O_CREAT|O_RDWR,$numeric_cmp
>   by
>      my $s = tie %sort,'DB_File',$name,O_CREAT|O_RDWR,0666,$numeric_cmp
>
>   and the error disappear.
>
> I used below sample code to test:
>
> require File::Temp;
> use File::Temp ();
> use File::Temp qw/ :seekable /;
> use base 'Bio::DB::SeqFeature::Store::berkeleydb';
> use DB_File;
> use Fcntl qw(O_RDWR O_CREAT :flock);
>
> my $fh   = File::Temp->new() or die("Couldn't create temporary file for sorting: $!");
> my $name = $fh->filename;
> my %sort;
> my $numeric_cmp         = DB_File::BTREEINFO->new;
> $numeric_cmp->{compare} = sub { $_[0]<=>  $_[1] };
> $numeric_cmp->{flags}   = R_DUP;
> my $s = tie %sort,'DB_File',$name,0666,O_CREAT|O_RDWR,$numeric_cmp
> #my $s = tie %sort,'DB_File',$name,O_CREAT|O_RDWR,0666,$numeric_cmp
>          or die("Couldn't create temporary file for sorting: $!");
>
>
>
> However the same code works fine on a Red Hat on an other system (not same perl version).
> So I do not know if my fix is a correct fix, it just make the error disappear.
> If I look at perldoc for DB_File I see examples like:
>   tie %A, "DB_File", "filename", O_CREAT|O_RDWR, 0666, $DB_HASH ;
> so it seems that 0666 should be set after O_CREAT....
>
> -- System Information:
> Debian Release: wheezy/sid
>    APT prefers unstable
>    APT policy: (500, 'unstable'), (500, 'stable')
> Architecture: amd64 (x86_64)
>
> Kernel: Linux 2.6.32-5-amd64 (SMP w/1 CPU core)
> Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/dash
>
> Versions of packages bioperl depends on:
> ii  libbio-perl-perl              1.6.901-2  BioPerl core perl modules
> ii  perl                          5.14.2-7   Larry Wall's Practical Extraction
>
> Versions of packages bioperl recommends:
> ii  bioperl-run                  1.6.9-1     BioPerl wrappers: scripts
> ii  libace-perl                  1.92-2+b2   Object-Oriented Access to ACEDB Da
> ii  libapache-dbi-perl           1.11-1      interface connecting apache server
> ii  libbio-perl-run-perl         1.6.9-1     BioPerl wrappers: modules
> ii  libcache-cache-perl          1.06-2      Managed caches of persistent infor
> ii  libdbi-perl                  1.618-1     Perl Database Interface (DBI)
> ii  libgd-gd2-perl               1:2.46-3+b1 Perl module wrapper for libgd - gd
> ii  libhttp-message-perl         6.03-1      perl interface to HTTP style messa
> ii  liblist-moreutils-perl       0.33-1+b1   Perl module with additional list f
> ii  libset-scalar-perl           1.25-1      Perl interface for operations on f
> ii  liburi-perl                  1.59-1      module to manipulate and access UR
> ii  libwww-perl                  6.01-3      simple and consistent interface to
> ii  libxml-simple-perl           2.18-3      Perl module for reading and writin
> ii  libxml-twig-perl             1:3.39-1    Perl module for processing huge XM
> ii  libyaml-perl                 0.80-1      YAML Ain't Markup Language
> ii  perl-doc                     5.14.2-7    Perl documentation
>
> Versions of packages bioperl suggests:
> ii  groff-base                    1.21-6     GNU troff text-formatting system (
>
> -- no debconf information
>
>
>
> _______________________________________________
> Debian-med-packaging mailing list
> Debian-med-packaging at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-med-packaging




More information about the Debian-med-packaging mailing list