Bug #9198

Segfault in TestException#test_machine_stackoverflow

Added by Vit Ondruch over 1 year ago. Updated 5 months ago.

[ruby-core:58797]
Status:Open
Priority:Normal
Assignee:-
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#test_machine_stackoverflow test case for -preview2. Please see attached log.

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

History

#1 Updated by Vit Ondruch over 1 year ago

Forgot to mention that I am testing of Fedora Rawhide.

#2 Updated by Vit Ondruch over 1 year ago

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

#3 Updated by Eric Wong over 1 year ago

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

--- a/test/ruby/test_exception.rb
+++ b/test/ruby/test_exception.rb
@@ -480,10 +480,12 @@ def test_stackoverflow
def test_machine_stackoverflow
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 over 1 year 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 over 1 year 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 over 1 year 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
pthread_getattr_np in the main thread.

#7 Updated by Vit Ondruch 5 months ago

Since this happens with recent glibc more often then it used to be, I reported this issue to glibc maintainers in Fedora [1]. I hope they can provide some help.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1195206

Also available in: Atom PDF