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
Core dump: Segmentation fault with 1..1000000000000 #13150
Comments
From varnie29a@mail.ruThe following one-liner causes Segmentation fault: It gives an assertion failed messsage as well as coredump: Core dump: ProblemType: Crash Perl Info
|
From @cpansproutOn Mon Aug 05 13:25:54 2013, varnie29a@mail.ru wrote:
Your perl -V output has use64bitall=undef, which means you are running That said, I get a crash on a 64-bit system, too. PL_tmps_ix is of type -- Father Chrysostomos |
The RT System itself - Status changed from 'new' to 'open' |
From @jkeenanOn 8/5/13 9:18 PM, Father Chrysostomos via RT wrote:
Confirmed on Darwin x86_64: ##### PL_tmps_ix is of type
|
From @cpansproutOn Mon Aug 05 18:18:34 2013, sprout wrote:
To fix this I would have to change this: #define SAVETMPS save_int((int*)&PL_tmps_floor), PL_tmps_floor = PL_tmps_ix to avoid restoring -1 as 4294967295. But this is equally dangerous if IV is bigger than size_t: #define SAVETMPS save_iv((IV*)&PL_tmps_floor), PL_tmps_floor = PL_tmps_ix We have save_long. Are there any guarantees that long is the same size -- Father Chrysostomos |
From @cpansproutOn Sat Aug 24 06:28:10 2013, sprout wrote:
Another question: how do I check that an nv cast to iv (more precisely, -- Father Chrysostomos |
From @nwc10On Sat, Aug 24, 2013 at 09:49:02AM -0700, Father Chrysostomos via RT wrote:
Technically you can't check whether the cast overflowed after the event, You might want to use parts of this macro in perl.h #define I_V(n) ((n) < IV_MAX_P1 ? ((n) < IV_MIN ? IV_MIN : (IV) (n)) \ Nicholas Clark |
From zefram@fysh.orgNicholas Clark wrote:
The Perl core relies in many places on signed integer overflow wrapping -zefram |
From @nwc10On Sat, Aug 24, 2013 at 06:27:11PM +0100, Zefram wrote:
True-ish for the value, but don't try this with an if conditional immediately But IIRC this was a floating point value being cast to an integer, and as Nicholas Clark |
From @tonycozOn Sat, Aug 24, 2013 at 06:28:11AM -0700, Father Chrysostomos via RT wrote:
long is smaller than size_t on x64 Windows. Tony |
From @cpansproutThank you to everyone for your answers. On Sat Aug 24 10:16:36 2013, nicholas wrote:
Well it turns out pp_flop is already doing a range check like that. =item Range iterator outside integer range (F) One (or both) of the numeric arguments to the range operator ".." Why can�t perl work around the problem itself, at least for positive -- Father Chrysostomos |
From @cpansproutOn Sat Aug 24 18:01:39 2013, sprout wrote:
Simple answer: Edge case explosion. Not worth it. -- Father Chrysostomos |
From @cpansproutOn Mon Aug 05 18:18:34 2013, sprout wrote:
I have fixed the crash with the mortals stack in commit e8eb279. That -- Father Chrysostomos |
@cpansprout - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#119161 (status was 'resolved')
Searchable as RT119161$
The text was updated successfully, but these errors were encountered: