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
SDBM_File sometimes fails with "sdbm store() returned -1" #6841
Comments
From @steve-m-hayThis is a bug report for perl from steve.hay@uk.radan.com, Hashes tied to SDBM_File don't seem to be able to cope with certain kinds of WARNING! This program will create a *very* large file, so make sure you ===== use Fcntl; tie my %h, 'SDBM_File', 'testsdbm', O_RDWR | O_CREAT | O_TRUNC, 0666 for my $i (0 .. 255) { untie %h;The combined length of the key + value here is always 1003, which is However, the above program always crashes with this error: sdbm store returned -1, errno 22, key "..." at the point where i==1 and j==0. I've hacked the ext/SDBM_File/sdbm/sdbm.c file in the Perl source to At the point where it failed, the .pag file was 1.87GB (to be exact, it However, I retried the same program using ActivePerl Build 806 (which The same program completes without error if I just change SDBM_File to Flags: Site configuration information for perl v5.8.1: Configured by steveh at Thu Sep 25 17:01:07 2003. Summary of my perl5 (revision 5 version 8 subversion 1) configuration: Locally applied patches: @INC for perl v5.8.1: Environment for perl v5.8.1: |
From @jkeenanOn Tue Oct 14 08:54:57 2003, shay wrote:
With the attached program 24206.pl, I was able to set how large a matrix 069 - 128 This was on Darwin (Mac OS X 10.4.11). Does anyone have any insight into this? Thank you very much. |
The RT System itself - Status changed from 'new' to 'open' |
From @tonycozOn Thu, Dec 01, 2011 at 06:06:28PM -0800, James E Keenan via RT wrote:
I suspect you're running into a 32-bit long issue. On x64 Linux with a 64-bit long your test ran successfully, producing: -rw-r--r-- 1 tony tony 1048576 Dec 2 20:54 testsdbm.dir which a 64-bit offset can seek within successfully, not not 32-bit. Tony |
Yes, definitely a 32-bit issue on Windows. I saw this bug today with a script we typically run in production on Linux and wanted to see if it can be run on Windows. On Linux, our script creates a ~64GB .pag file. On Windows, it fails with "sdbm store returned -1, errno 22" when the .pag file reaches almost 2**31 bytes, 2147471360 to be exact. Is this connected to issue #12227? |
It might be partly connected to #12227. Another problem is "long" is 32-bits for both 32 and 64-bit Win32: https://docs.microsoft.com/en-us/cpp/cpp/integer-limits?view=msvc-170 and sdbm.c casts its page numbers to long when calculating the seek offsets, which limits the offsets to long. |
Migrated from rt.perl.org#24206 (status was 'open')
Searchable as RT24206$
The text was updated successfully, but these errors were encountered: