Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Perl: porters

DB_File 1.82 crash

 

 

Perl porters RSS feed   Index | Next | Previous | View Threaded


h.m.brand at xs4all

Nov 4, 2009, 12:27 AM

Post #1 of 5 (94 views)
Permalink
DB_File 1.82 crash

--8<--- test.pl
use strict;
use warnings;
use DB_File;
print "Using DB_File-$DB_File::VERSION\n";
tie my %db, "DB_File", "test.db";
$db{name} = "Fede\x{2122}";
-->8---

$ perl test.pl
Using DB_File-1.82
Wide character in subroutine entry at xx.pl line 6.

$ perl -MV=DB_File
DB_File
/pro/lib/perl5/5.10.1/PA-RISC2.0/DB_File.pm: 1.820

--
H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/
using & porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,
11.11, 11.23, and 11.31, OpenSuSE 10.3, 11.0, and 11.1, AIX 5.2 and 5.3.
http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/
http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/


paul_marquess at yahoo

Nov 4, 2009, 7:56 AM

Post #2 of 5 (74 views)
Permalink
RE: DB_File 1.82 crash [In reply to]

You need to use a DBM_Filter

use DB_File;
use DBM_Filter ;

$db = tie my %db, "DB_File", "test.db";
$db->Filter_Push('utf8');

Paul

> -----Original Message-----
> From: H.Merijn Brand [mailto:h.m.brand[at]xs4all.nl]
> Sent: 04 November 2009 08:28
> To: Paul Marquess; Perl5 Porters
> Subject: DB_File 1.82 crash
>
> --8<--- test.pl
> use strict;
> use warnings;
> use DB_File;
> print "Using DB_File-$DB_File::VERSION\n";
> tie my %db, "DB_File", "test.db";
> $db{name} = "Fede\x{2122}";
> -->8---
>
> $ perl test.pl
> Using DB_File-1.82
> Wide character in subroutine entry at xx.pl line 6.
>
> $ perl -MV=DB_File
> DB_File
> /pro/lib/perl5/5.10.1/PA-RISC2.0/DB_File.pm: 1.820
>
> --
> H.Merijn Brand http://tux.nl Perl Monger
> http://amsterdam.pm.org/
> using & porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20,
> 11.00,
> 11.11, 11.23, and 11.31, OpenSuSE 10.3, 11.0, and 11.1, AIX 5.2 and
> 5.3.
> http://mirrors.develooper.com/hpux/ http://www.test-
> smoke.org/
> http://qa.perl.org http://www.goldmark.org/jeff/stupid-
> disclaimers/


h.m.brand at xs4all

Nov 4, 2009, 8:14 AM

Post #3 of 5 (74 views)
Permalink
Re: DB_File 1.82 crash [In reply to]

On Wed, 4 Nov 2009 15:56:30 -0000, "Paul Marquess"
<paul_marquess[at]yahoo.co.uk> wrote:

> You need to use a DBM_Filter

My solution was

utf8::encode ($name);
$db{name} = $name;

as in this case I was *sure* about it being valid utf8, but what I mean
is that it shouldn't *die*.

> use DB_File;
> use DBM_Filter ;
>
> $db = tie my %db, "DB_File", "test.db";
> $db->Filter_Push('utf8');
>
> Paul
>
> > -----Original Message-----
> > From: H.Merijn Brand [mailto:h.m.brand[at]xs4all.nl]
> > Sent: 04 November 2009 08:28
> > To: Paul Marquess; Perl5 Porters
> > Subject: DB_File 1.82 crash
> >
> > --8<--- test.pl
> > use strict;
> > use warnings;
> > use DB_File;
> > print "Using DB_File-$DB_File::VERSION\n";
> > tie my %db, "DB_File", "test.db";
> > $db{name} = "Fede\x{2122}";
> > -->8---
> >
> > $ perl test.pl
> > Using DB_File-1.82
> > Wide character in subroutine entry at xx.pl line 6.
> >
> > $ perl -MV=DB_File
> > DB_File
> > /pro/lib/perl5/5.10.1/PA-RISC2.0/DB_File.pm: 1.820

--
H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/
using & porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,
11.11, 11.23, and 11.31, OpenSuSE 10.3, 11.0, and 11.1, AIX 5.2 and 5.3.
http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/
http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/


nick at ccl4

Nov 4, 2009, 8:19 AM

Post #4 of 5 (74 views)
Permalink
Re: DB_File 1.82 crash [In reply to]

On Wed, Nov 04, 2009 at 05:14:38PM +0100, H.Merijn Brand wrote:
> On Wed, 4 Nov 2009 15:56:30 -0000, "Paul Marquess"
> <paul_marquess[at]yahoo.co.uk> wrote:
>
> > You need to use a DBM_Filter
>
> My solution was
>
> utf8::encode ($name);
> $db{name} = $name;
>
> as in this case I was *sure* about it being valid utf8, but what I mean
> is that it shouldn't *die*.

Why not? What should it do in this case? It can't store the data given.

Nicholas Clark


Paul.Marquess at ntlworld

Nov 5, 2009, 11:27 AM

Post #5 of 5 (64 views)
Permalink
RE: DB_File 1.82 crash [In reply to]

A quick survey of the modules in core shows that DB_File isn't alone - looks
like it is par-for-the-course for XS modules - I see Encode, Socket, all the
compression modules will all croak.

Paul


> -----Original Message-----
> From: H.Merijn Brand [mailto:h.m.brand[at]xs4all.nl]
> Sent: 04 November 2009 16:15
> To: paul.marquess[at]ntlworld.com
> Cc: paul_marquess[at]yahoo.co.uk; 'Perl5 Porters'
> Subject: Re: DB_File 1.82 crash
>
> On Wed, 4 Nov 2009 15:56:30 -0000, "Paul Marquess"
> <paul_marquess[at]yahoo.co.uk> wrote:
>
> > You need to use a DBM_Filter
>
> My solution was
>
> utf8::encode ($name);
> $db{name} = $name;
>
> as in this case I was *sure* about it being valid utf8, but what I mean
> is that it shouldn't *die*.
>
> > use DB_File;
> > use DBM_Filter ;
> >
> > $db = tie my %db, "DB_File", "test.db";
> > $db->Filter_Push('utf8');
> >
> > Paul
> >
> > > -----Original Message-----
> > > From: H.Merijn Brand [mailto:h.m.brand[at]xs4all.nl]
> > > Sent: 04 November 2009 08:28
> > > To: Paul Marquess; Perl5 Porters
> > > Subject: DB_File 1.82 crash
> > >
> > > --8<--- test.pl
> > > use strict;
> > > use warnings;
> > > use DB_File;
> > > print "Using DB_File-$DB_File::VERSION\n";
> > > tie my %db, "DB_File", "test.db";
> > > $db{name} = "Fede\x{2122}";
> > > -->8---
> > >
> > > $ perl test.pl
> > > Using DB_File-1.82
> > > Wide character in subroutine entry at xx.pl line 6.
> > >
> > > $ perl -MV=DB_File
> > > DB_File
> > > /pro/lib/perl5/5.10.1/PA-RISC2.0/DB_File.pm: 1.820
>
> --
> H.Merijn Brand http://tux.nl Perl Monger
> http://amsterdam.pm.org/
> using & porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20,
> 11.00,
> 11.11, 11.23, and 11.31, OpenSuSE 10.3, 11.0, and 11.1, AIX 5.2 and
> 5.3.
> http://mirrors.develooper.com/hpux/ http://www.test-
> smoke.org/
> http://qa.perl.org http://www.goldmark.org/jeff/stupid-
> disclaimers/

Perl porters RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.