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
UTF8-C8 + Str.subst either dumps core or corrupt memory #5232
Comments
From @TuxThe code I used to reproduce: --8<--- use v6; my Buf $b = Buf.new(61, ^2048 .map({ 256.rand.Int })); my Str $q = "\""; $u .= subst(/( $q | $e )/, { "$e$0" }, :g); $ p6 --version Linux 3.12.53-40-desktop [openSUSE 13.1 (Bottle)] HP Z220CMT Xeon(R) CPU E3-1245 V2 @ 3.40GHz/3791(8) x86_64 11913 Mb In a one-liner: $ p6 -e'my$b=Buf.new(61,^2048 .map({256.rand.Int}));my Str $u=$b.decode("utf8-c8");$u.=subst(/("a"|"b")/,{"c$0"},:g);' or (same code) $ p6 -e'my$b=Buf.new(61,^2048 .map({256.rand.Int}));my Str $u=$b.decode("utf8-c8");$u.=subst(/("a"|"b")/,{"c$0"},:g);' Golfing back, the |"b" is optional, as are $0, and the braces $ p6 -e'Buf.new(61,^2048 .map({256.rand.Int})).decode("utf8-c8").subst(/"a"/,"c",:g);' 2048 was just a test case. Round about 175 runs sometimes pass and sometimes fail $ p6 -e'Buf.new(61,^179 .map({256.rand.Int})).decode("utf8-c8").subst(/"a"/,"c",:g);' -- |
From @nwc10On Mon, Apr 11, 2016 at 04:39:59AM -0700, H. Merijn Brand wrote:
With timotimo's commit from this afternoon: commit 808fd05041b3d846b0a54acc4297299af2a1b71d cope with buffers being too small in re_nfg fixes a crash when working with utf8-c8 strings. that one liner changes from ASAN barfage to no output. That means it's now "tests needed" ? Nicholas Clark |
The RT System itself - Status changed from 'new' to 'open' |
From @moritzOn 04/11/2016 03:04 PM, Nicholas Clark wrote:
It is. I'd also be grateful if somebody could provide a deterministic string of Cheers, |
From @moritzOn 11.04.2016 17:00, Moritz Lenz wrote:
Turns out that somebody is me :-) This code coredumps reliably on a not-yet-patched rakudo for me: use v6; Cheers,
|
From @moritzTested here: Raku/roast@28274ef712 |
@moritz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#127878 (status was 'resolved')
Searchable as RT127878$
The text was updated successfully, but these errors were encountered: