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
[META] misuse of I32 #10172
Comments
From @nwc10There's a lot of inappropriate use of the I32 type throughout the core. The misuse of I32 causes lots of bugs (panics, SEGVs, silent data errors) if This is a meta-ticket for collating tickets relating to these sorts of bugs. |
1 similar comment
From @nwc10There's a lot of inappropriate use of the I32 type throughout the core. The misuse of I32 causes lots of bugs (panics, SEGVs, silent data errors) if This is a meta-ticket for collating tickets relating to these sorts of bugs. |
From @cpansproutThis is the same as 72784. |
@cpansprout - Status changed from 'new' to 'resolved' |
From @tonycozAs a general issue for testing this type of bug - we need to allocate Should we define (say) an environment variable to indicate that a large eg. It might be desirable to skip these tests when performing a parallel test. Tony |
The RT System itself - Status changed from 'new' to 'open' |
From @tseeOn 03/14/2012 06:46 AM, Tony Cook via RT wrote:
Or at least run that particular subset of tests in sequence. --Steffen |
From @tonycozOn Wed, Mar 14, 2012 at 08:05:48AM +0100, Steffen Mueller wrote:
Make a t/bigmem/ directory for large memory tests, perhaps. If I understand t/harness it should be easy to ensure those are run Tony |
From @tonycozOn Wed, Mar 14, 2012 at 07:36:27PM +1100, Tony Cook wrote:
Attached, two changes: 0001-add-a-directory-of-tests-to-run-with-large-available.patch modify t/TEST and t/harness to run t/bigmem/*.t if 0002-rt-100514-regression-test-for-read-with-a-2Gib-offse.patch regression test for RT #100514 Tony |
From @tonycozOn Sat, Mar 24, 2012 at 01:56:29PM +1100, Tony Cook wrote:
Actually attaching them might help. Tony |
From @tonycoz0001-add-a-directory-of-tests-to-run-with-large-available.patchFrom b02b95df63006d5594e2d0ce800b39ffe2fdc514 Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Fri, 23 Mar 2012 13:11:03 +0100
Subject: [PATCH 1/2] add a directory of tests to run with large available memory
Intended for testing 64-bit behavious
---
pod/perlhack.pod | 7 +++++++
t/TEST | 1 +
t/harness | 1 +
3 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/pod/perlhack.pod b/pod/perlhack.pod
index 63df5d5..64329ed 100644
--- a/pod/perlhack.pod
+++ b/pod/perlhack.pod
@@ -948,6 +948,13 @@ Setting this variable skips the vrexx.t tests for OS2::REXX.
This sets a variable in op/numconvert.t.
+=item * PERL_TEST_MEMORY
+
+Setting this variable includes the tests in F<t/bigmem/>. This should
+be set to the number of gigabytes of memory available for testing,
+eg. C<PERL_TEST_MEMORY=4> indicates that tests that require 4GiB of
+available memory can be run safely.
+
=back
See also the documentation for the Test and Test::Harness modules, for
diff --git a/t/TEST b/t/TEST
index c2c81e9..fdd2d53 100755
--- a/t/TEST
+++ b/t/TEST
@@ -463,6 +463,7 @@ unless (@ARGV) {
_find_tests('x2p');
_find_tests('japh') if $::torture;
_find_tests('t/benchmark') if $::benchmark or $ENV{PERL_BENCHMARK};
+ _find_tests('bigmem') if $ENV{PERL_TEST_MEMORY};
}
}
diff --git a/t/harness b/t/harness
index 7748c26..1a1efdb 100644
--- a/t/harness
+++ b/t/harness
@@ -135,6 +135,7 @@ if (@ARGV) {
push @next, 'japh' if $torture;
push @next, 'win32' if $^O eq 'MSWin32';
push @next, 'benchmark' if $ENV{PERL_BENCHMARK};
+ push @next, 'bigmem' if $ENV{PERL_TEST_MEMORY};
# Hopefully TAP::Parser::Scheduler will support this syntax soon.
# my $next = { par => '{' . join (',', @next) . '}/*.t' };
my $next = { par => [
--
1.7.2.5
|
From @tonycoz0002-rt-100514-regression-test-for-read-with-a-2Gib-offse.patchFrom a9392a4f703e2368f279108f18ed800b85a9300c Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Fri, 23 Mar 2012 13:11:48 +0100
Subject: [PATCH 2/2] [rt #100514] regression test for read() with a 2Gib offset
---
MANIFEST | 1 +
t/bigmem/read.t | 24 ++++++++++++++++++++++++
2 files changed, 25 insertions(+), 0 deletions(-)
create mode 100644 t/bigmem/read.t
diff --git a/MANIFEST b/MANIFEST
index cc185d6..dc01fdb 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -4968,6 +4968,7 @@ t/base/rs.t See if record-read works
t/base/term.t See if various terms work
t/base/while.t See if while work
t/benchmark/rt26188-speed-up-keys-on-empty-hash.t Benchmark if keys on empty hashes is fast enough
+t/bigmem/read.t Check read() handles large offsets
t/cmd/elsif.t See if else-if works
t/cmd/for.t See if for loops work
t/cmd/mod.t See if statement modifiers work
diff --git a/t/bigmem/read.t b/t/bigmem/read.t
new file mode 100644
index 0000000..b29c097
--- /dev/null
+++ b/t/bigmem/read.t
@@ -0,0 +1,24 @@
+#!perl
+BEGIN {
+ chdir 't';
+ unshift @INC, "../lib";
+}
+
+use strict;
+require './test.pl';
+use Config qw(%Config);
+
+$ENV{PERL_TEST_MEMORY} >= 3
+ or skip_all("Need ~3Gb for this test");
+$Config{ptrsize} >= 8
+ or skip_all("Need 64-bit pointers for this test");
+
+plan(1);
+
+# RT #100514
+my $x = "";
+read(DATA, $x, 4, 0x80000000);
+is(length $x, 0x80000004, "check we read to the correct offset");
+__DATA__
+Food
+
--
1.7.2.5
|
From @cpansproutOn Fri Mar 23 19:59:21 2012, tonyc wrote:
Thank you. Applied as ff5db60 and 9fda09b. -- Father Chrysostomos |
From @cpansproutOn Sat Feb 13 07:51:05 2010, nicholas wrote:
What should the maximum string and array lengths be? In various places in the perl source, we have overflow checks that use Take sv_setpvn for example. If the length is greater than IV_MAX it So that means 2**63-1 is the longest string supported on 64-bit On 32-bit platforms, if -Duse64bitint is not used, the situation is the On 32-bit platforms when -Duse64bitint *is* used, sv_setpvn allows So nothing is consistent. For all practical purposes, one is limited to 31-bit string lengths on I suggest we make 2**(PTRSIZE-1)-1 (*) the maximum string length and Regular expressions are currently limited to I32_MAX. Changing that In 6174b39 I allowed pos() to record positions up to 2**PTRSIZE-2. I * I.e., SSize_t_MAX, but we have no such macro currently. -- Father Chrysostomos |
From @tonycozOn Sat, Jul 27, 2013 at 07:33:28PM -0700, Father Chrysostomos via RT wrote:
I think it should be Ssize_t_max. Or more C standardly - ptrdiff_t-max. It might be possible in theory to support longer strings on a 32-bit Supporting larger objects on 32-bit platforms could complicate the Tony * stack, kernel space, mapped libraries, etc |
From @chipdudeOn 7/27/2013 7:33 PM, Father Chrysostomos via RT wrote:
Why would the answer ever be anything other than size_t? |
From @demerphqOn 28 July 2013 04:33, Father Chrysostomos via RT
IMO this is not a sound argument for rejecting a change. There are
Maybe, maybe not. But the plug in interface shouldn't be part of the Cheers, and thanks for all your work on this stuff! Yves -- |
From @cpansproutOn Mon Jul 29 22:19:43 2013, chip wrote:
Because AvFILLp needs to be set to -1 when the array is empty. We -- Father Chrysostomos |
From @cpansproutOn Tue Jul 30 06:33:28 2013, sprout wrote:
Also, the HV APIs use negative lengths for utf8. -- Father Chrysostomos |
From @demerphqOn 30 July 2013 17:20, Father Chrysostomos via RT
Yes, but that API is insane. Utterly insane. Yves -- |
From @cpansproutOn Sat Jul 27 20:08:37 2013, tonyc wrote:
Is this a correct way to define it, or am I doing something non-portable #define SSize_t_MAX (SSize_t)(~(size_t)0 >> 1) -- Father Chrysostomos |
From @chipdudeOn 7/30/2013 6:33 AM, Father Chrysostomos via RT wrote:
Your emphasis is incorrect. Rather, size_t adds very little |
From @chipdudeOn 7/30/2013 8:20 AM, Father Chrysostomos via RT wrote:
Those specific APIs can continue to use signed integers if you prefer; |
Migrated from rt.perl.org#72784 (status was 'open')
Searchable as RT72784$
The text was updated successfully, but these errors were encountered: