Project

General

Profile

Actions

Bug #18130

closed

Showing exceptions from Ractor on console causes errors

Added by tagomoris (Satoshi Tagomori) about 3 years ago. Updated almost 3 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 3.1.0dev (2021-08-13T06:26:44Z master ac4d53bd46) [arm64-darwin20]
[ruby-core:105059]

Description

ErrorHighlight.formatter fetches a default (or configured) exception formatter from the module variable, and if it occurs in Ractor, it causes additional exceptions.

/Users/tagomoris/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/error_highlight/formatter.rb:21:in `formatter': can not access non-shareable objects in constant ErrorHighlight::DEFAULT_FORMATTER by non-main ractor. (Ractor::IsolationError)
	from /Users/tagomoris/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/error_highlight/core_ext.rb:36:in `to_s'
	from /Users/tagomoris/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/did_you_mean/core_ext/name_error.rb:21:in `rescue in to_s'
	from /Users/tagomoris/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/did_you_mean/core_ext/name_error.rb:14:in `to_s'
	from snippets/ractor_server.rb:21:in `message'
	from snippets/ractor_server.rb:21:in `full_message'
	from snippets/ractor_server.rb:21:in `rescue in block (2 levels) in <main>'
	from snippets/ractor_server.rb:10:in `block (2 levels) in <main>'

Updated by mame (Yusuke Endoh) about 3 years ago

  • Status changed from Open to Assigned
  • Assignee set to ko1 (Koichi Sasada)

Thanks. I have another PR for the same issue in https://github.com/ruby/error_highlight/pull/11

I'm okay for the change, but I'd like @ko1 (Koichi Sasada) to review the change.

Updated by ko1 (Koichi Sasada) almost 3 years ago

  • Status changed from Assigned to Closed

The GH ticket is closed, so I close it too.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0