New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DB_File methods and substr don't mix #7361
Comments
From perl-5.8.0@ton.iguana.beCreated by perl-5.8.0@ton.iguana.beThe following program works as expected on 5.8.0, but picks up #!/usr/bin/perl -wl # This program tries to associate a set of digits with a given alpha key. my $mode = shift || 0; my $db_file = "testdb"; Will output if run without args: Want to associate 4 with key a Apart from the warnings, notice how it fetches wrong (old) values for the Running it with argument 3 (causing a "scalar" to be put before all Perl Info
|
From @mhxOn 2004-06-14, at 17:32:26 +0100, Paul Marquess wrote:
This looks like missing SvGETMAGIC's to me. When you pass the result The following should help, but there may be SvGETMAGIC's missing in Inline Patch
|
The RT System itself - Status changed from 'new' to 'open' |
From @pmqsHey thanks! I had got as far as writing a regression test for the DB_File test suite to The only thing I found out was that the new behaviour started with 5.8.1 - I'll run DB_File through my torture test. If there aren't any problems with Anyone know if this new behaviour documented anywhere? Paul
|
From @pmqsLooking at the modules in 5.8.4, I see that GDBM_File, NDBM_File, ODBM_File, MIME::Base64 seems to have the same issue as well. It uses this /* set up EOL from the second argument if present, default to "\n" Didn't get the chance to run my DB_File torture test yet, but I thought it In DB_File I need to differentiate between someone passing an empty string xsub_method(sv * arg) if (SvOK(arg)) { The important part of that code, as far as this bug is concerned, is the Starting with perl 5.8.1 (I think), this code can do the wrong thing under Consider this snippet of code foreach my $key ( 'alpha', 'beta', 'gamma') { Assume the "xsub_method" uses the code at the start to parse the parameter. Changing the XSUB code, as Marcus suggests, to this char * ptr = NULL ; SvGETMAGIC(arg); fixes the problem. Paul
|
From @timbunceOn Wed, Jun 16, 2004 at 01:20:44PM +0100, Paul Marquess wrote:
I'm sure many modules do. I'd guess that parts of the code do as well. I've suggested before that a very simple way to flush out these Naturally this would only be for DEBUGGING builds (perhaps then Tim. |
From @timbunceOn Thu, Jun 17, 2004 at 12:37:08PM +0100, Paul Marquess wrote:
It would find places that are missing SvGETMAGIC(arg) calls. I'm guess the overlap between SvGETMAGIC(arg) calls needed for A taint-everything mechanism would find most instances of the Any volunteers? (Ought to be fairly trivial to add the mechanism.) Tim.
|
From @pmqsFix for 30237 with regression tests enclosed. Paul
|
From @mhxOn 2004-06-22, at 21:29:12 +0100, Paul Marquess wrote:
Thanks, applied as #22970. Marcus -- |
@mhx - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#30237 (status was 'resolved')
Searchable as RT30237$
The text was updated successfully, but these errors were encountered: