Bug #9198

Segfault in TestException#test_machine_stackoverflow

Added by Vit Ondruch 5 months ago. Updated 3 months ago.

[ruby-core:58797]
Status:Open
Priority:Normal
Assignee:-
Category:-
Target version:-
ruby -v:ruby 2.1.0dev (2013-11-23 trunk 43807) [x86_64-linux] Backport:1.9.3: UNKNOWN, 2.0.0: UNKNOWN

Description

I observe segfault in TestException#testmachinestackoverflow test case for -preview2. Please see attached log.

segfault.log (830 KB) Vit Ondruch, 12/02/2013 11:59 PM

History

#1 Updated by Vit Ondruch 5 months ago

Forgot to mention that I am testing of Fedora Rawhide.

#2 Updated by Vit Ondruch 4 months ago

Still observe the issue with ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-linux]

#3 Updated by Eric Wong 3 months ago

Does it go away if you wrap the test with Thread.new?
Likely the same problem I describe in

--- a/test/ruby/testexception.rb
+++ b/test/ruby/test
exception.rb
@@ -480,10 +480,12 @@ def teststackoverflow
def test
machinestackoverflow
bug9109 = ' [Bug #9109]'
assert
separately([], <<-SRC)
+ Thread.new do
assert_raise(SystemStackError, #{bug9109.dump}) {
h = {a: ->{h[:a].call}}
h[:a].call
}
+ end
SRC
rescue SystemStackError
end

#4 Updated by Vit Ondruch 3 months ago

Eric Wong wrote:

Does it go away if you wrap the test with Thread.new?

Yes, this patch helps.

#5 Updated by Vit Ondruch 3 months ago

BTW I am not using some old glibc (as you say in ruby-core:60248), but the most recent version (glibc-2.18.90-26.fc21.x86_64).

#6 Updated by Eric Wong 3 months ago

Interesting. Can you poke the Red Hat glibc/kernel folks to see if the
problem is specific to RH/Fedora systems?

Regardless, the current method of getting the address of the main thread
stack seems error prone and fragile on Linux. Perhaps we should avoid
pthreadgetattrnp in the main thread.

Also available in: Atom PDF