[ruby-core:120752] [Ruby master Bug#21085] [BUG] Stack consistency error with -ne

Issue #21085 has been reported by segiddins (Samuel Giddins). ---------------------------------------- Bug #21085: [BUG] Stack consistency error with -ne https://bugs.ruby-lang.org/issues/21085 * Author: segiddins (Samuel Giddins) * Status: Open * ruby -v: ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [arm64-darwin24] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- Running the following crashes for me ``` shell echo '' | ruby -ne '' ``` Attached the diagnostic report as requested ---Files-------------------------------- ruby-2025-01-21-125203.ips (9.83 KB) -- https://bugs.ruby-lang.org/

Issue #21085 has been updated by ufuk (Ufuk Kayserilioglu). This succeeds with the `parse.y` parser, so it seems to be a Prism compiler bug: ```shell ❯ echo '' | ruby --parser=parse.y -vne '' ruby 3.4.1 (2024-12-25 revision 48d4efcb85) [arm64-darwin23] ❯ echo '' | ruby --parser=prism -vne '' ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [arm64-darwin23] -e:1: [BUG] Stack consistency error (sp: 7, bp: 6) ... ``` ---------------------------------------- Bug #21085: [BUG] Stack consistency error with -ne https://bugs.ruby-lang.org/issues/21085#change-111615 * Author: segiddins (Samuel Giddins) * Status: Open * ruby -v: ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [arm64-darwin24] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- Running the following crashes for me ``` shell echo '' | ruby -ne '' ``` Attached the diagnostic report as requested ---Files-------------------------------- ruby-2025-01-21-125203.ips (9.83 KB) -- https://bugs.ruby-lang.org/

Issue #21085 has been updated by segiddins (Samuel Giddins). Good catch. ``` ❯ ruby --dump=insns -vne '' --parser=parse.y ruby 3.4.1 (2024-12-25 revision 48d4efcb85) [arm64-darwin24] == disasm: #<ISeq:<main>@-e:1 (1,0)-(1,0)> 0000 jump 4 ( 1) 0002 putnil 0003 pop 0004 putself 0005 getglobal :$/ 0007 opt_send_without_block <calldata!mid:gets, argc:1, FCALL|ARGS_SIMPLE> 0009 branchif 4 0011 putnil 0012 leave ``` ``` ❯ ruby --dump=insns -vne '' --parser=prism ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [arm64-darwin24] == disasm: #<ISeq:<main>@-e:1 (1,0)-(1,0)> 0000 jump 7 ( 1)[Li] 0002 putnil 0003 pop 0004 jump 7 0006 putnil 0007 putself 0008 getglobal :$/ 0010 opt_send_without_block <calldata!mid:gets, argc:1, FCALL|ARGS_SIMPLE> 0012 branchif 6 0014 putnil 0015 leave ``` ---------------------------------------- Bug #21085: [BUG] Stack consistency error with -ne https://bugs.ruby-lang.org/issues/21085#change-111616 * Author: segiddins (Samuel Giddins) * Status: Open * ruby -v: ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [arm64-darwin24] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- Running the following crashes for me ``` shell echo '' | ruby -ne '' ``` Attached the diagnostic report as requested ---Files-------------------------------- ruby-2025-01-21-125203.ips (9.83 KB) -- https://bugs.ruby-lang.org/

Issue #21085 has been updated by alanwu (Alan Wu). Assignee set to prism ---------------------------------------- Bug #21085: [BUG] Stack consistency error with -ne https://bugs.ruby-lang.org/issues/21085#change-111620 * Author: segiddins (Samuel Giddins) * Status: Open * Assignee: prism * ruby -v: ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [arm64-darwin24] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- Running the following crashes for me ``` shell echo '' | ruby -ne '' ``` Attached the diagnostic report as requested ---Files-------------------------------- ruby-2025-01-21-125203.ips (9.83 KB) -- https://bugs.ruby-lang.org/

Issue #21085 has been updated by k0kubun (Takashi Kokubun). Backport changed from 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: REQUIRED to 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: DONE ruby_3_4 commit:cd395232b0491f9c4463c5889bab8d2c050e75e2 merged revision(s) commit:241ada7b1ca4fd71dc47a83d912ee25162a555d9. ---------------------------------------- Bug #21085: [BUG] Stack consistency error with -ne https://bugs.ruby-lang.org/issues/21085#change-111926 * Author: segiddins (Samuel Giddins) * Status: Closed * Assignee: prism * ruby -v: ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [arm64-darwin24] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: DONE ---------------------------------------- Running the following crashes for me ``` shell echo '' | ruby -ne '' ``` Attached the diagnostic report as requested ---Files-------------------------------- ruby-2025-01-21-125203.ips (9.83 KB) -- https://bugs.ruby-lang.org/
participants (4)
-
alanwu (Alan Wu)
-
k0kubun (Takashi Kokubun)
-
segiddins (Samuel Giddins)
-
ufuk (Ufuk Kayserilioglu)