Invalid type in pack: 'Q' at .../perl/lib/DBM/Deep/Engine.pm line 660

154 views
Skip to first unread message

QM

unread,
Nov 15, 2008, 8:30:33 PM11/15/08
to DBM-Deep
Error message:

Invalid type in pack: 'Q' at .../perl/lib/DBM/Deep/Engine.pm line
660

This comes from using the 'large' packsize on a 32-bit Perl:

$db = tie %hash, 'DBM::Deep',
{
file => $hashfile,
locking => 1,
autoflush => 0,
pack_size => 'large',
max_buckets => 256,
data_sector_size => 32,
};


From Engine.pm:
our $VERSION = q(1.0013);

Does it make sense for D::D to catch this, and throw a more user-
friendly error?

(Should there be an option to non-fatally use the 'medium' packsize on
32-bit systems when the 'large' is requested, or is that just delaying
the problem of running out of address space so that a lot of time is
wasted?)

-QM

Rob Kinyon

unread,
Nov 16, 2008, 10:38:48 AM11/16/08
to DBM-...@googlegroups.com
On Sat, Nov 15, 2008 at 20:30, QM <Quantum.Me...@gmail.com> wrote:
>
> Error message:
>
> Invalid type in pack: 'Q' at .../perl/lib/DBM/Deep/Engine.pm line
> 660
>
> This comes from using the 'large' packsize on a 32-bit Perl:
>
> $db = tie %hash, 'DBM::Deep',
> {
> file => $hashfile,
> locking => 1,
> autoflush => 0,
> pack_size => 'large',
> max_buckets => 256,
> data_sector_size => 32,
> };
>
>
> From Engine.pm:
> our $VERSION = q(1.0013);
>
> Does it make sense for D::D to catch this, and throw a more user-
> friendly error?

Yeah, a better error message would probably be a good idea.

> (Should there be an option to non-fatally use the 'medium' packsize on
> 32-bit systems when the 'large' is requested, or is that just delaying
> the problem of running out of address space so that a lot of time is
> wasted?)

Well, on a 32-bit system, the current architecture can only handle a
2G datafile. There are ways of increasing that using relative instead
of absolute seeking, but that would require quite the change in how
seeking happens. I suppose the best idea would be a better way of
detecting that 'Q' isn't available (using eval{}) and throwing a
warning if 'large' is selected and degrading to 'medium'.

And, now that I think about it, doing the same thing when opening a
file on 32-bit systems that was created with 'large' (throwing a fatal
error) would be a good idea. Thanks for bringing this up.

--
Thanks,
Rob Kinyon

Rob Kinyon

unread,
Nov 16, 2008, 8:45:29 PM11/16/08
to DBM-...@googlegroups.com
I've checked in a fix (with test) for trying to create a file with
pack_size => 'large' on a system without a Perl that recognizes pack(
'Q', ... ). Would it be possible for someone with a Perl that has 'Q'
to create a file for me from the section in t/13_set_pack.t that deals
with 64-bit systems? I'd like to include it in the distro for a test
about opening a file created on a 64-bit system with a Perl that
doesn't understand 'Q'.

Thanks,
Rob

--
Thanks,
Rob Kinyon

QM

unread,
Nov 21, 2008, 12:59:11 PM11/21/08
to DBM-Deep
I could do it, since I have access to a 64-bit Perl on a 64-bit
system. But I don't know *how* to do it.

On Nov 16, 8:45 pm, "Rob Kinyon" <rob.kin...@gmail.com> wrote:
> I've checked in a fix (with test) for trying to create a file with
> pack_size => 'large' on a system without a Perl that recognizes pack(
> 'Q', ... ). Would it be possible for someone with a Perl that has 'Q'
> to create a file for me from the section in t/13_set_pack.t that deals
> with 64-bit systems? I'd like to include it in the distro for a test
> about opening a file created on a 64-bit system with a Perl that
> doesn't understand 'Q'.
>
> Thanks,
> Rob
>
>
>
> On Sun, Nov 16, 2008 at 10:38, Rob Kinyon <rob.kin...@gmail.com> wrote:

Rob Kinyon

unread,
Nov 21, 2008, 1:01:57 PM11/21/08
to DBM-...@googlegroups.com
On Fri, Nov 21, 2008 at 12:59, QM <Quantum.Me...@gmail.com> wrote:
>
> I could do it, since I have access to a 64-bit Perl on a 64-bit
> system. But I don't know *how* to do it.

t/13_setpack.t uses new_fh() to create a temporary file. Instead,
replace that filename with a hardcoded one. Run the test - you'll have
the 64-bit file. Email that to me. :-)

Thanks,
Rob
--
Thanks,
Rob Kinyon

Rob Kinyon

unread,
Feb 15, 2010, 11:05:47 PM2/15/10
to DBM-...@googlegroups.com
On Fri, Nov 21, 2008 at 13:01, Rob Kinyon <rob.k...@gmail.com> wrote:
> On Fri, Nov 21, 2008 at 12:59, QM <Quantum.Me...@gmail.com> wrote:
>>
>> I could do it, since I have access to a 64-bit Perl on a 64-bit
>> system. But I don't know *how* to do it.
>
> t/13_setpack.t uses new_fh() to create a temporary file. Instead,
> replace that filename with a hardcoded one. Run the test - you'll have
> the 64-bit file. Email that to me. :-)
>
> Thanks,
> Rob

QM - Does this problem still exist?

Rob

Reply all
Reply to author
Forward
0 new messages