ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:122519] [Ruby Bug#21439] Crash with PM_SPLAT_NODE compiler error (Prism)
@ 2025-06-11 20:35 bendrissou (Bachir Bendrissou) via ruby-core
  2025-06-12 12:39 ` [ruby-core:122521] " byroot (Jean Boussier) via ruby-core
  2025-06-12 14:32 ` [ruby-core:122522] " ufuk (Ufuk Kayserilioglu) via ruby-core
  0 siblings, 2 replies; 3+ messages in thread
From: bendrissou (Bachir Bendrissou) via ruby-core @ 2025-06-11 20:35 UTC (permalink / raw)
  To: ruby-core; +Cc: bendrissou (Bachir Bendrissou)

Issue #21439 has been reported by bendrissou (Bachir Bendrissou).

----------------------------------------
Bug #21439: Crash with PM_SPLAT_NODE compiler error (Prism)
https://bugs.ruby-lang.org/issues/21439

* Author: bendrissou (Bachir Bendrissou)
* Status: Open
* ruby -v: 3.5.0
* Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
Hi Ruby team,

I'm encountering a crash when using a splat (*) on the left-hand side of a for loop in the latest Ruby build from master. The error occurs during compilation, and seems related to Prism’s handling of PM_SPLAT_NODE.

### Input

The following minimal script crashes:

```
for *y in [4, 5]
  p y
end
```

### Expected Output

```
[4]
[5]
```

### Actual Output

```
bug-1.rb: [BUG] Unexpected node type for index in for node: PM_SPLAT_NODE
ruby 3.5.0dev (2025-06-11T18:07:43Z master 970813d982) +PRISM [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0001 p:0000 s:0003 E:000720 DUMMY  [FINISH]


-- Threading information ---------------------------------------------------
Total ractor count: 1
Ruby thread count for this ractor: 1

-- C level backtrace information -------------------------------------------
/lib/x86_64-linux-gnu/libasan.so.5(__interceptor_backtrace+0x40) [0x7f13b793bd40] ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:4022
/home/ruby/build/ruby(rb_print_backtrace+0x11) [0x558d33041da9] ../vm_dump.c:843
/home/ruby/build/ruby(rb_vm_bugreport) ../vm_dump.c:1175
/home/ruby/build/ruby(rb_bug_without_die_internal+0xc5) [0x558d32704b21] ../error.c:1097
/home/ruby/build/ruby(rb_bug) ../error.c:1115
/home/ruby/build/ruby(pm_compile_for_node_index+0x117) [0x558d32ee742c] ../prism_compile.c:5340
/home/ruby/build/ruby(pm_compile_scope_node) ../prism_compile.c:6911
/home/ruby/build/ruby(pm_compile_node+0x1b50) [0x558d32e88490] ../prism_compile.c:10201
/home/ruby/build/ruby(pm_iseq_compile_node+0x437) [0x558d32eea437] ../prism_compile.c:10512
/home/ruby/build/ruby(pm_iseq_new_with_opt_try+0x3e) [0x558d32824c5e] ../iseq.c:1050
/home/ruby/build/ruby(rb_protect+0x30f) [0x558d327183ff] ../eval.c:1059
/home/ruby/build/ruby(pm_iseq_new_with_opt+0x482) [0x558d32832c12] ../iseq.c:1103
/home/ruby/build/ruby(pm_new_child_iseq+0x19a) [0x558d32dbdc7a] ../prism_compile.c:1261
/home/ruby/build/ruby(pm_compile_node+0x15296) [0x558d32e9bbd6] ../prism_compile.c:9199
/home/ruby/build/ruby(pm_compile_node+0x529d) [0x558d32e8bbdd] ../prism_compile.c:10330
/home/ruby/build/ruby(pm_compile_scope_node+0x3f42) [0x558d32ee3382] ../prism_compile.c:7012
/home/ruby/build/ruby(pm_compile_node+0x1b50) [0x558d32e88490] ../prism_compile.c:10201
/home/ruby/build/ruby(APPEND_LIST+0x0) [0x558d32eea2a4] ../prism_compile.c:10502
/home/ruby/build/ruby(pm_iseq_compile_node) ../prism_compile.c:10506
/home/ruby/build/ruby(pm_iseq_new_with_opt_try+0x3e) [0x558d32824c5e] ../iseq.c:1050
/home/ruby/build/ruby(rb_protect+0x30f) [0x558d327183ff] ../eval.c:1059
/home/ruby/build/ruby(pm_iseq_new_with_opt+0x482) [0x558d32832c12] ../iseq.c:1103
/home/ruby/build/ruby(pm_iseq_new_main+0xbc) [0x558d328332ac] ../iseq.c:951
/home/ruby/build/ruby(process_options+0x2d32) [0x558d329d2b12] ../ruby.c:2641
/home/ruby/build/ruby(ruby_process_options+0x3f0) [0x558d329d5290] ../ruby.c:3199
/home/ruby/build/ruby(ruby_options+0x2a7) [0x558d32715407] ../eval.c:117
/home/ruby/build/ruby(rb_main+0x19) [0x558d327067ff] ../main.c:42
/home/ruby/build/ruby(main) ../main.c:62
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7f13b7487083]
/home/ruby/build/ruby(_start) [0x558d32707dce]

-- Other runtime information -----------------------------------------------

* Loaded script: bug-1.rb

* Loaded features:

    0 enumerator.so
    1 thread.rb
    2 fiber.so
    3 rational.so
    4 complex.so
    5 ruby2_keywords.rb
    6 set.rb

Aborted

```

### Environment

Ruby version: `ruby 3.5.0dev (2025-06-11 commit 970813d982) +PRISM`

Platform: `x86_64-linux`

Built from source using latest master

Parser backend: `Prism (default)`





-- 
https://bugs.ruby-lang.org/
______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:122521] [Ruby Bug#21439] Crash with PM_SPLAT_NODE compiler error (Prism)
  2025-06-11 20:35 [ruby-core:122519] [Ruby Bug#21439] Crash with PM_SPLAT_NODE compiler error (Prism) bendrissou (Bachir Bendrissou) via ruby-core
@ 2025-06-12 12:39 ` byroot (Jean Boussier) via ruby-core
  2025-06-12 14:32 ` [ruby-core:122522] " ufuk (Ufuk Kayserilioglu) via ruby-core
  1 sibling, 0 replies; 3+ messages in thread
From: byroot (Jean Boussier) via ruby-core @ 2025-06-12 12:39 UTC (permalink / raw)
  To: ruby-core; +Cc: byroot (Jean Boussier)

Issue #21439 has been updated by byroot (Jean Boussier).

Assignee set to prism

----------------------------------------
Bug #21439: Crash with PM_SPLAT_NODE compiler error (Prism)
https://bugs.ruby-lang.org/issues/21439#change-113744

* Author: bendrissou (Bachir Bendrissou)
* Status: Open
* Assignee: prism
* ruby -v: 3.5.0
* Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
Hi Ruby team,

I'm encountering a crash when using a splat (*) on the left-hand side of a for loop in the latest Ruby build from master. The error occurs during compilation, and seems related to Prism’s handling of PM_SPLAT_NODE.

### Input

The following minimal script crashes:

```
for *y in [4, 5]
  p y
end
```

### Expected Output

```
[4]
[5]
```

### Actual Output

```
bug-1.rb: [BUG] Unexpected node type for index in for node: PM_SPLAT_NODE
ruby 3.5.0dev (2025-06-11T18:07:43Z master 970813d982) +PRISM [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0001 p:0000 s:0003 E:000720 DUMMY  [FINISH]


-- Threading information ---------------------------------------------------
Total ractor count: 1
Ruby thread count for this ractor: 1

-- C level backtrace information -------------------------------------------
/lib/x86_64-linux-gnu/libasan.so.5(__interceptor_backtrace+0x40) [0x7f13b793bd40] ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:4022
/home/ruby/build/ruby(rb_print_backtrace+0x11) [0x558d33041da9] ../vm_dump.c:843
/home/ruby/build/ruby(rb_vm_bugreport) ../vm_dump.c:1175
/home/ruby/build/ruby(rb_bug_without_die_internal+0xc5) [0x558d32704b21] ../error.c:1097
/home/ruby/build/ruby(rb_bug) ../error.c:1115
/home/ruby/build/ruby(pm_compile_for_node_index+0x117) [0x558d32ee742c] ../prism_compile.c:5340
/home/ruby/build/ruby(pm_compile_scope_node) ../prism_compile.c:6911
/home/ruby/build/ruby(pm_compile_node+0x1b50) [0x558d32e88490] ../prism_compile.c:10201
/home/ruby/build/ruby(pm_iseq_compile_node+0x437) [0x558d32eea437] ../prism_compile.c:10512
/home/ruby/build/ruby(pm_iseq_new_with_opt_try+0x3e) [0x558d32824c5e] ../iseq.c:1050
/home/ruby/build/ruby(rb_protect+0x30f) [0x558d327183ff] ../eval.c:1059
/home/ruby/build/ruby(pm_iseq_new_with_opt+0x482) [0x558d32832c12] ../iseq.c:1103
/home/ruby/build/ruby(pm_new_child_iseq+0x19a) [0x558d32dbdc7a] ../prism_compile.c:1261
/home/ruby/build/ruby(pm_compile_node+0x15296) [0x558d32e9bbd6] ../prism_compile.c:9199
/home/ruby/build/ruby(pm_compile_node+0x529d) [0x558d32e8bbdd] ../prism_compile.c:10330
/home/ruby/build/ruby(pm_compile_scope_node+0x3f42) [0x558d32ee3382] ../prism_compile.c:7012
/home/ruby/build/ruby(pm_compile_node+0x1b50) [0x558d32e88490] ../prism_compile.c:10201
/home/ruby/build/ruby(APPEND_LIST+0x0) [0x558d32eea2a4] ../prism_compile.c:10502
/home/ruby/build/ruby(pm_iseq_compile_node) ../prism_compile.c:10506
/home/ruby/build/ruby(pm_iseq_new_with_opt_try+0x3e) [0x558d32824c5e] ../iseq.c:1050
/home/ruby/build/ruby(rb_protect+0x30f) [0x558d327183ff] ../eval.c:1059
/home/ruby/build/ruby(pm_iseq_new_with_opt+0x482) [0x558d32832c12] ../iseq.c:1103
/home/ruby/build/ruby(pm_iseq_new_main+0xbc) [0x558d328332ac] ../iseq.c:951
/home/ruby/build/ruby(process_options+0x2d32) [0x558d329d2b12] ../ruby.c:2641
/home/ruby/build/ruby(ruby_process_options+0x3f0) [0x558d329d5290] ../ruby.c:3199
/home/ruby/build/ruby(ruby_options+0x2a7) [0x558d32715407] ../eval.c:117
/home/ruby/build/ruby(rb_main+0x19) [0x558d327067ff] ../main.c:42
/home/ruby/build/ruby(main) ../main.c:62
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7f13b7487083]
/home/ruby/build/ruby(_start) [0x558d32707dce]

-- Other runtime information -----------------------------------------------

* Loaded script: bug-1.rb

* Loaded features:

    0 enumerator.so
    1 thread.rb
    2 fiber.so
    3 rational.so
    4 complex.so
    5 ruby2_keywords.rb
    6 set.rb

Aborted

```

### Environment

Ruby version: `ruby 3.5.0dev (2025-06-11 commit 970813d982) +PRISM`

Platform: `x86_64-linux`

Built from source using latest master

Parser backend: `Prism (default)`





-- 
https://bugs.ruby-lang.org/
______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:122522] [Ruby Bug#21439] Crash with PM_SPLAT_NODE compiler error (Prism)
  2025-06-11 20:35 [ruby-core:122519] [Ruby Bug#21439] Crash with PM_SPLAT_NODE compiler error (Prism) bendrissou (Bachir Bendrissou) via ruby-core
  2025-06-12 12:39 ` [ruby-core:122521] " byroot (Jean Boussier) via ruby-core
@ 2025-06-12 14:32 ` ufuk (Ufuk Kayserilioglu) via ruby-core
  1 sibling, 0 replies; 3+ messages in thread
From: ufuk (Ufuk Kayserilioglu) via ruby-core @ 2025-06-12 14:32 UTC (permalink / raw)
  To: ruby-core; +Cc: ufuk (Ufuk Kayserilioglu)

Issue #21439 has been updated by ufuk (Ufuk Kayserilioglu).

Backport changed from 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN to 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: REQUIRED

I have a PR for it here: https://github.com/ruby/ruby/pull/13597

----------------------------------------
Bug #21439: Crash with PM_SPLAT_NODE compiler error (Prism)
https://bugs.ruby-lang.org/issues/21439#change-113745

* Author: bendrissou (Bachir Bendrissou)
* Status: Open
* Assignee: prism
* ruby -v: 3.5.0
* Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: REQUIRED
----------------------------------------
Hi Ruby team,

I'm encountering a crash when using a splat (*) on the left-hand side of a for loop in the latest Ruby build from master. The error occurs during compilation, and seems related to Prism’s handling of PM_SPLAT_NODE.

### Input

The following minimal script crashes:

```
for *y in [4, 5]
  p y
end
```

### Expected Output

```
[4]
[5]
```

### Actual Output

```
bug-1.rb: [BUG] Unexpected node type for index in for node: PM_SPLAT_NODE
ruby 3.5.0dev (2025-06-11T18:07:43Z master 970813d982) +PRISM [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0001 p:0000 s:0003 E:000720 DUMMY  [FINISH]


-- Threading information ---------------------------------------------------
Total ractor count: 1
Ruby thread count for this ractor: 1

-- C level backtrace information -------------------------------------------
/lib/x86_64-linux-gnu/libasan.so.5(__interceptor_backtrace+0x40) [0x7f13b793bd40] ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:4022
/home/ruby/build/ruby(rb_print_backtrace+0x11) [0x558d33041da9] ../vm_dump.c:843
/home/ruby/build/ruby(rb_vm_bugreport) ../vm_dump.c:1175
/home/ruby/build/ruby(rb_bug_without_die_internal+0xc5) [0x558d32704b21] ../error.c:1097
/home/ruby/build/ruby(rb_bug) ../error.c:1115
/home/ruby/build/ruby(pm_compile_for_node_index+0x117) [0x558d32ee742c] ../prism_compile.c:5340
/home/ruby/build/ruby(pm_compile_scope_node) ../prism_compile.c:6911
/home/ruby/build/ruby(pm_compile_node+0x1b50) [0x558d32e88490] ../prism_compile.c:10201
/home/ruby/build/ruby(pm_iseq_compile_node+0x437) [0x558d32eea437] ../prism_compile.c:10512
/home/ruby/build/ruby(pm_iseq_new_with_opt_try+0x3e) [0x558d32824c5e] ../iseq.c:1050
/home/ruby/build/ruby(rb_protect+0x30f) [0x558d327183ff] ../eval.c:1059
/home/ruby/build/ruby(pm_iseq_new_with_opt+0x482) [0x558d32832c12] ../iseq.c:1103
/home/ruby/build/ruby(pm_new_child_iseq+0x19a) [0x558d32dbdc7a] ../prism_compile.c:1261
/home/ruby/build/ruby(pm_compile_node+0x15296) [0x558d32e9bbd6] ../prism_compile.c:9199
/home/ruby/build/ruby(pm_compile_node+0x529d) [0x558d32e8bbdd] ../prism_compile.c:10330
/home/ruby/build/ruby(pm_compile_scope_node+0x3f42) [0x558d32ee3382] ../prism_compile.c:7012
/home/ruby/build/ruby(pm_compile_node+0x1b50) [0x558d32e88490] ../prism_compile.c:10201
/home/ruby/build/ruby(APPEND_LIST+0x0) [0x558d32eea2a4] ../prism_compile.c:10502
/home/ruby/build/ruby(pm_iseq_compile_node) ../prism_compile.c:10506
/home/ruby/build/ruby(pm_iseq_new_with_opt_try+0x3e) [0x558d32824c5e] ../iseq.c:1050
/home/ruby/build/ruby(rb_protect+0x30f) [0x558d327183ff] ../eval.c:1059
/home/ruby/build/ruby(pm_iseq_new_with_opt+0x482) [0x558d32832c12] ../iseq.c:1103
/home/ruby/build/ruby(pm_iseq_new_main+0xbc) [0x558d328332ac] ../iseq.c:951
/home/ruby/build/ruby(process_options+0x2d32) [0x558d329d2b12] ../ruby.c:2641
/home/ruby/build/ruby(ruby_process_options+0x3f0) [0x558d329d5290] ../ruby.c:3199
/home/ruby/build/ruby(ruby_options+0x2a7) [0x558d32715407] ../eval.c:117
/home/ruby/build/ruby(rb_main+0x19) [0x558d327067ff] ../main.c:42
/home/ruby/build/ruby(main) ../main.c:62
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7f13b7487083]
/home/ruby/build/ruby(_start) [0x558d32707dce]

-- Other runtime information -----------------------------------------------

* Loaded script: bug-1.rb

* Loaded features:

    0 enumerator.so
    1 thread.rb
    2 fiber.so
    3 rational.so
    4 complex.so
    5 ruby2_keywords.rb
    6 set.rb

Aborted

```

### Environment

Ruby version: `ruby 3.5.0dev (2025-06-11 commit 970813d982) +PRISM`

Platform: `x86_64-linux`

Built from source using latest master

Parser backend: `Prism (default)`





-- 
https://bugs.ruby-lang.org/
______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-06-12 14:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-11 20:35 [ruby-core:122519] [Ruby Bug#21439] Crash with PM_SPLAT_NODE compiler error (Prism) bendrissou (Bachir Bendrissou) via ruby-core
2025-06-12 12:39 ` [ruby-core:122521] " byroot (Jean Boussier) via ruby-core
2025-06-12 14:32 ` [ruby-core:122522] " ufuk (Ufuk Kayserilioglu) via ruby-core

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).