ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:111155] [Ruby master Bug#19173] syntax_suggest segfaults on syntax error when refinement activated
@ 2022-12-02 12:44 tomstuart (Tom Stuart)
  2022-12-02 22:14 ` [ruby-core:111165] " schneems (Richard Schneeman)
  2022-12-02 23:44 ` [ruby-core:111167] " ufuk (Ufuk Kayserilioglu)
  0 siblings, 2 replies; 3+ messages in thread
From: tomstuart (Tom Stuart) @ 2022-12-02 12:44 UTC (permalink / raw)
  To: ruby-core

Issue #19173 has been reported by tomstuart (Tom Stuart).

----------------------------------------
Bug #19173: syntax_suggest segfaults on syntax error when refinement activated
https://bugs.ruby-lang.org/issues/19173

* Author: tomstuart (Tom Stuart)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.2.0dev (2022-12-02T10:47:18Z master 11871e49c4) [arm64-darwin21]
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
While reporting certain syntax errors (e.g. “Invalid yield”, “Invalid redo”), `syntax_suggest` segfaults when a refinement is activated:

```
% echo 'yield' > test.rb; ruby test.rb
test.rb:1: Invalid yield
test.rb: compile error (SyntaxError)

% echo 'using Module.new; yield' > test.rb; ruby test.rb
test.rb:1: Invalid yield
/Users/tom/.rubies/ruby-master/lib/ruby/3.2.0+3/fileutils.rb:2646: [BUG] Segmentation fault at 0x0000000000000008
[…]
-- Ruby level backtrace information ----------------------------------------
/Users/tom/.rubies/ruby-master/lib/ruby/3.2.0+3/syntax_suggest/core_ext.rb:25:in `detailed_message'
```

There’s no problem if `syntax_suggest` is disabled:

```
% echo 'using Module.new; yield' > test.rb; ruby --disable-syntax_suggest test.rb
test.rb:1: Invalid yield
test.rb: compile error (SyntaxError)
```

This bug exists on both `3.2.0-preview3` and `master`, and I’ve verified it on x86_64 as well as my arm64 machine. A crash report log is attached.

---Files--------------------------------
ruby-2022-12-02-122013.ips (16.4 KB)


-- 
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/postorius/lists/ruby-core.ml.ruby-lang.org/

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

* [ruby-core:111165] [Ruby master Bug#19173] syntax_suggest segfaults on syntax error when refinement activated
  2022-12-02 12:44 [ruby-core:111155] [Ruby master Bug#19173] syntax_suggest segfaults on syntax error when refinement activated tomstuart (Tom Stuart)
@ 2022-12-02 22:14 ` schneems (Richard Schneeman)
  2022-12-02 23:44 ` [ruby-core:111167] " ufuk (Ufuk Kayserilioglu)
  1 sibling, 0 replies; 3+ messages in thread
From: schneems (Richard Schneeman) @ 2022-12-02 22:14 UTC (permalink / raw)
  To: ruby-core

Issue #19173 has been updated by schneems (Richard Schneeman).


Line 25 is the require which seems odd https://github.com/ruby/ruby/blob/85a1c67a6550641e5de96cdbee1713be3f1e8882/lib/syntax_suggest/core_ext.rb#L25

I’ll try to reproduce when I get back to my computer.

----------------------------------------
Bug #19173: syntax_suggest segfaults on syntax error when refinement activated
https://bugs.ruby-lang.org/issues/19173#change-100450

* Author: tomstuart (Tom Stuart)
* Status: Open
* Priority: Normal
* Target version: 3.2
* ruby -v: ruby 3.2.0dev (2022-12-02T10:47:18Z master 11871e49c4) [arm64-darwin21]
* Backport: 2.7: DONTNEED, 3.0: DONTNEED, 3.1: DONTNEED
----------------------------------------
While reporting certain syntax errors (e.g. “Invalid yield”, “Invalid redo”), `syntax_suggest` segfaults when a refinement is activated:

```
% echo 'yield' > test.rb; ruby test.rb
test.rb:1: Invalid yield
test.rb: compile error (SyntaxError)

% echo 'using Module.new; yield' > test.rb; ruby test.rb
test.rb:1: Invalid yield
/Users/tom/.rubies/ruby-master/lib/ruby/3.2.0+3/fileutils.rb:2646: [BUG] Segmentation fault at 0x0000000000000008
[…]
-- Ruby level backtrace information ----------------------------------------
/Users/tom/.rubies/ruby-master/lib/ruby/3.2.0+3/syntax_suggest/core_ext.rb:25:in `detailed_message'
```

There’s no problem if `syntax_suggest` is disabled:

```
% echo 'using Module.new; yield' > test.rb; ruby --disable-syntax_suggest test.rb
test.rb:1: Invalid yield
test.rb: compile error (SyntaxError)
```

This bug exists on both `3.2.0-preview3` and `master`, and I’ve verified it on x86_64 as well as my arm64 machine. A crash report log is attached.

---Files--------------------------------
ruby-2022-12-02-122013.ips (16.4 KB)


-- 
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/postorius/lists/ruby-core.ml.ruby-lang.org/

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

* [ruby-core:111167] [Ruby master Bug#19173] syntax_suggest segfaults on syntax error when refinement activated
  2022-12-02 12:44 [ruby-core:111155] [Ruby master Bug#19173] syntax_suggest segfaults on syntax error when refinement activated tomstuart (Tom Stuart)
  2022-12-02 22:14 ` [ruby-core:111165] " schneems (Richard Schneeman)
@ 2022-12-02 23:44 ` ufuk (Ufuk Kayserilioglu)
  1 sibling, 0 replies; 3+ messages in thread
From: ufuk (Ufuk Kayserilioglu) @ 2022-12-02 23:44 UTC (permalink / raw)
  To: ruby-core

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


@schneems This seems to be less about syntax suggest than refinements. @tenderlovemaking already has a PR up that should fix it: https://github.com/ruby/ruby/pull/6853

----------------------------------------
Bug #19173: syntax_suggest segfaults on syntax error when refinement activated
https://bugs.ruby-lang.org/issues/19173#change-100452

* Author: tomstuart (Tom Stuart)
* Status: Open
* Priority: Normal
* Target version: 3.2
* ruby -v: ruby 3.2.0dev (2022-12-02T10:47:18Z master 11871e49c4) [arm64-darwin21]
* Backport: 2.7: DONTNEED, 3.0: DONTNEED, 3.1: DONTNEED
----------------------------------------
While reporting certain syntax errors (e.g. “Invalid yield”, “Invalid redo”), `syntax_suggest` segfaults when a refinement is activated:

```
% echo 'yield' > test.rb; ruby test.rb
test.rb:1: Invalid yield
test.rb: compile error (SyntaxError)

% echo 'using Module.new; yield' > test.rb; ruby test.rb
test.rb:1: Invalid yield
/Users/tom/.rubies/ruby-master/lib/ruby/3.2.0+3/fileutils.rb:2646: [BUG] Segmentation fault at 0x0000000000000008
[…]
-- Ruby level backtrace information ----------------------------------------
/Users/tom/.rubies/ruby-master/lib/ruby/3.2.0+3/syntax_suggest/core_ext.rb:25:in `detailed_message'
```

There’s no problem if `syntax_suggest` is disabled:

```
% echo 'using Module.new; yield' > test.rb; ruby --disable-syntax_suggest test.rb
test.rb:1: Invalid yield
test.rb: compile error (SyntaxError)
```

This bug exists on both `3.2.0-preview3` and `master`, and I’ve verified it on x86_64 as well as my arm64 machine. A crash report log is attached.

---Files--------------------------------
ruby-2022-12-02-122013.ips (16.4 KB)


-- 
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/postorius/lists/ruby-core.ml.ruby-lang.org/

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

end of thread, other threads:[~2022-12-02 23:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-02 12:44 [ruby-core:111155] [Ruby master Bug#19173] syntax_suggest segfaults on syntax error when refinement activated tomstuart (Tom Stuart)
2022-12-02 22:14 ` [ruby-core:111165] " schneems (Richard Schneeman)
2022-12-02 23:44 ` [ruby-core:111167] " ufuk (Ufuk Kayserilioglu)

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 read-only IMAP folder(s) and NNTP newsgroup(s).