[#56982] [ruby-trunk - Bug #8854][Open] Update URL for bug reports — "stomar (Marcus Stollsteimer)" <redmine@...>
7 messages
2013/09/03
[#57038] [ruby-trunk - Feature #3620] Add Queue, SIzedQueue and ConditionVariable implementations in C in addition to ruby ones — "Glass_saga (Masaki Matsushita)" <glass.saga@...>
4 messages
2013/09/05
[#57040] Re: [ruby-trunk - Feature #3620] Add Queue, SIzedQueue and ConditionVariable implementations in C in addition to ruby ones
— SASADA Koichi <ko1@...>
2013/09/05
(2013/09/05 20:52), Glass_saga (Masaki Matsushita) wrote:
[#57058] [ruby-trunk - Bug #8875][Open] Select is not usable with SSLSocket — "headius (Charles Nutter)" <headius@...>
11 messages
2013/09/07
[#57092] [ruby-trunk - Bug #8883][Open] Rational canonicalization unexpectedly converts to Fixnum — "melquiades (Paul Cantrell)" <cantrell@...>
16 messages
2013/09/09
[#57111] [ruby-trunk - Feature #8887][Open] min(n), max(n), min_by(n), max_by(n) — "akr (Akira Tanaka)" <akr@...>
13 messages
2013/09/10
[#57117] [ruby-trunk - Feature #8890][Open] [PATCH] Eliminate less-than-zero checks for unsigned variables — "tonyo (Anton Ovchinnikov)" <revolver112@...>
5 messages
2013/09/10
[#57134] [CommonRuby - Feature #8896][Open] #tap with missing block — "prijutme4ty (Ilya Vorontsov)" <prijutme4ty@...>
5 messages
2013/09/11
[#57138] [ruby-trunk - Feature #8897][Open] client side TCP fast open — "Glass_saga (Masaki Matsushita)" <glass.saga@...>
5 messages
2013/09/11
[#57195] [ruby-trunk - Feature #8897][Assigned] client side TCP fast open
— "Glass_saga (Masaki Matsushita)" <glass.saga@...>
2013/09/14
[#57186] [ruby-trunk - Feature #8909][Open] Expand "f" frozen suffix to literal arrays and hashes — "headius (Charles Nutter)" <headius@...>
37 messages
2013/09/14
[#57224] [ruby-trunk - Feature #8909] Expand "f" frozen suffix to literal arrays and hashes
— "headius (Charles Nutter)" <headius@...>
2013/09/15
[#57262] [ruby-trunk - Feature #8921][Open] Allow select, reject, etc to accept a regex — "kyledecot (Kyle Decot)" <kyle.decot@...>
13 messages
2013/09/18
[#57264] [ruby-trunk - Feature #8921] Allow select, reject, etc to accept a regex
— "kyledecot (Kyle Decot)" <kyle.decot@...>
2013/09/18
[#57265] Re: [ruby-trunk - Feature #8921] Allow select, reject, etc to accept a regex
— Fuad Saud <fuadksd@...>
2013/09/18
Shouldn't select/reject use threequals?
[#57292] [ruby-trunk - Feature #8931][Open] Update URL in REPORTBUG_MSG — "zzak (Zachary Scott)" <e@...>
4 messages
2013/09/20
[#57315] [ruby-trunk - Feature #8938][Open] it keyword — "Sing9898 (Sing Lou)" <3b06e8d4@...>
5 messages
2013/09/23
[#57367] [ruby-trunk - Feature #8951][Open] Please add a hash-to-hash alternative of the map method to Hash — "behrangsa (Behrang Saeedzadeh)" <behrangsa@...>
8 messages
2013/09/25
[#57385] [ruby-trunk - Bug #8953][Open] `str =~ /pattern/` does not call =~ method if (1) str is a String, (2) /pattern/ is a Regexp literal — "gfx (Goro Fuji)" <gfuji@...>
12 messages
2013/09/26
[#57394] [ruby-trunk - Bug #8955][Open] LocalJumpError - no block given (yield) after implementation of class hierarchy method cache invalidation — "mfla (Morten Fla)" <mmflaa@...>
4 messages
2013/09/26
[#57462] [ruby-trunk - misc #8962][Open] [DOC] add step to enable Generational GC merits in README.EXT* — "tad (Tadashi Saito)" <redmine@...>
6 messages
2013/09/28
[ruby-core:57468] Re: [ruby-trunk - Feature #6647] Exceptions raised in threads should be logged
From:
Avdi Grimm <avdi@...>
Date:
2013-09-29 22:34:06 UTC
List:
ruby-core #57468
This would indeed eliminate a huge amount of confusion for people getting
started with threads. Or for people years of experience with threads, for
that matter...
On Fri, Sep 27, 2013 at 7:18 AM, headius (Charles Nutter) <
headius@headius.com> wrote:
>
> Issue #6647 has been updated by headius (Charles Nutter).
>
>
> So, can we do this for 2.1? I have heard from many other users that really
> would like exceptions bubbling out of threads to be reported in some way.
> We have had numerous bug reports relating to code where threads disappear
> without a trace.
> ----------------------------------------
> Feature #6647: Exceptions raised in threads should be logged
> https://bugs.ruby-lang.org/issues/6647#change-42043
>
> Author: headius (Charles Nutter)
> Status: Assigned
> Priority: Normal
> Assignee: matz (Yukihiro Matsumoto)
> Category: core
> Target version: next minor
>
>
> Many applications and users I have dealt with have run into bugs due to
> Ruby's behavior of quietly swallowing exceptions raised in threads. I
> believe this is a bug, and threads should always at least log exceptions
> that bubble all the way out and terminate them.
>
> The implementation should be simple, but I'm not yet familiar enough with
> the MRI codebase to provide a patch. The exception logging should be logged
> in the same way top-level exceptions get logged, but perhaps with
> information about the thread that was terminated because of the exception.
>
> Here is a monkey patch that simulates what I'm hoping to achieve with this
> bug:
>
>
> class << Thread
> alias old_new new
>
> def new(*args, &block)
> old_new(*args) do |*bargs|
> begin
> block.call(*bargs)
> rescue Exception => e
> raise if Thread.abort_on_exception ||
> Thread.current.abort_on_exception
> puts "Thread for block #{block.inspect} terminated with exception:
> #{e.message}"
> puts e.backtrace.map {|line| " #{line}"}
> end
> end
> end
> end
>
> Thread.new { 1 / 0 }.join
> puts "After thread"
>
> __END__
>
> Output:
>
> system ~/projects/jruby $ ruby thread_error.rb
> Thread for block #<Proc:0x000000010d008a80@thread_error.rb:17> terminated
> with exception: divided by 0
> thread_error.rb:17:in `/'
> thread_error.rb:17
> thread_error.rb:7:in `call'
> thread_error.rb:7:in `new'
> thread_error.rb:5:in `initialize'
> thread_error.rb:5:in `old_new'
> thread_error.rb:5:in `new'
> thread_error.rb:17
> After thread
>
>
>
> --
> http://bugs.ruby-lang.org/
>
--
Avdi Grimm
http://avdi.org
I only check email twice a day. to reach me sooner, go to
http://awayfind.com/avdi