Bug #7459

at_exit { Thread.new {} } broken in r37921

Added by Ryan Davis over 1 year ago. Updated over 1 year ago.

[ruby-core:50276]
Status:Closed
Priority:Urgent
Assignee:-
Category:core
Target version:2.0.0
ruby -v:2.0 Backport:

Description

ruby -e 'p Thread.current; at_exit { p Thread.current; [Thread.new {}].map(&:join) }'

outputs:

#
#
-e:1:in new': can't alloc thread (ThreadError)
from -e:1:in
block in '

Either the main thread shouldn't be marked as dead until it actually is, or the check in threadsnew should be expanded to include whatever thread is responsible for the at_exit run.

History

#1 Updated by Ryan Davis over 1 year ago

I don't think main thread should be marked dead until after at_exit is done:

% multiruby -e 'p Thread.current; at_exit { p Thread.current }'

VERSION = mritrunk
CMD = ~/.multiruby/install/mri
trunk/bin/ruby -e p Thread.current; at_exit { p Thread.current }

#
#

RESULT = 0

VERSION = 1.8.7-p249
CMD = ~/.multiruby/install/1.8.7-p249/bin/ruby -e p Thread.current; at_exit { p Thread.current }

#
#

RESULT = 0

VERSION = 1.9.2-p320
CMD = ~/.multiruby/install/1.9.2-p320/bin/ruby -e p Thread.current; at_exit { p Thread.current }

#
#

RESULT = 0

VERSION = 1.9.3-p194
CMD = ~/.multiruby/install/1.9.3-p194/bin/ruby -e p Thread.current; at_exit { p Thread.current }

#
#

RESULT = 0

TOTAL RESULT = 0 failures out of 4

Passed: 1.9.2-p320, 1.8.7-p249, 1.9.3-p194, mri_trunk
Failed:

#2 Updated by Ryan Davis over 1 year ago

This is blocking my merge of minitest to trunk for 2.0 preview.

#3 Updated by Motohiro KOSAKI over 1 year ago

  • Status changed from Open to Closed

fixed at r37958

Also available in: Atom PDF