ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:70571] [Ruby trunk - Bug #11482] [Open] Multiple versions of Ruby crashing with simple threaded client/server test
       [not found] <redmine.issue-11482.20150824154351@ruby-lang.org>
@ 2015-08-24 15:43 ` sean.p.oneil
  2019-07-23 18:56 ` [ruby-core:93891] [Ruby master Bug#11482] " merch-redmine
  1 sibling, 0 replies; 2+ messages in thread
From: sean.p.oneil @ 2015-08-24 15:43 UTC (permalink / raw
  To: ruby-core

Issue #11482 has been reported by Sean O'Neil.

----------------------------------------
Bug #11482: Multiple versions of Ruby crashing with simple threaded client/server test
https://bugs.ruby-lang.org/issues/11482

* Author: Sean O'Neil
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: 
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
Using the attached client and server scripts, I have been able to quickly crash every version of Ruby I tested from 1.9.3 to 2.2.3. Sometimes only the client crashes, sometimes only the server, and a few times I've seen both crash at the same time. Sometimes it has to run a while before either crashes, but it usually happens pretty quickly.

I've only tested it on Windows (built with multiple compilers), but it may happen on other operating systems as well. I have tested:

* v1.9.3-p374 built with Visual Studio 2012 (x86 and x64)
* v2.1.5 built with Visual Studio 2012 and 2015 (x86 and x64)
* v2.1.7 built with Visual Studio 2012 and 2015 (x86 and x64)
* v2.2.2 built with Visual Studio 2012 and 2015 (x86 and x64)
* v2.2.3 built with Visual Studio 2012 and 2015 (x86 and x64)
* The RubyInstaller v2.2.2 (x64-mingw32)
* The current ruby_2_2 branch built with Visual Studio 2015 (x86 and x64)

vs2015.patch: I applied this patch to the 2.x versions to get it compiling and running in Visual Studio 2015. This patch is a combination of other patches I've seen online, and it has worked well so far (aside from the crashes that seem to be occurring when built with other compilers as well).

The crash dump always seems to point to gc.c or st.c. It's hard to see what's causing it in gc.c in Visual Studio, but when it crashes in st.c, it is usually due to st_table_entry::next and st_table_entry::prev being set to an invalid non-NULL value (so far it always appears to be set to 0x1 or 0x32, which can cause it to crash in various places in st.c, but I haven't figured out where/how they're being set to those values).

The only reason I tried so many different versions is because I was hoping to find one that worked to choose as a "stable" version to use, but in the end I had to give up and submit this problem to the experts.


---Files--------------------------------
client.rb (540 Bytes)
server.rb (588 Bytes)
vs2015.patch (7.44 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [ruby-core:93891] [Ruby master Bug#11482] Multiple versions of Ruby crashing with simple threaded client/server test
       [not found] <redmine.issue-11482.20150824154351@ruby-lang.org>
  2015-08-24 15:43 ` [ruby-core:70571] [Ruby trunk - Bug #11482] [Open] Multiple versions of Ruby crashing with simple threaded client/server test sean.p.oneil
@ 2019-07-23 18:56 ` merch-redmine
  1 sibling, 0 replies; 2+ messages in thread
From: merch-redmine @ 2019-07-23 18:56 UTC (permalink / raw
  To: ruby-core

Issue #11482 has been updated by jeremyevans0 (Jeremy Evans).

Status changed from Open to Closed

I wasn't able to get Ruby to crash with this (maybe I didn't wait long enough?).  I tried multiple Ruby versions, all using RubyInstaller:

```
Ruby 2.1: 21925 successes, 175 failures
Ruby 2.2: 20252 successes, 148 failures
Ruby 2.3: 29900 successes, 0 failures
Ruby 2.4: 9265 successes, 635 failures*
Ruby 2.5: 24200 successes, 0 failures
Ruby 2.6: 29400 successes, 0 failures
```

Ruby 2.4 server output showed:

```
[2019-07-23 11:51:13] ERROR Errno::EBADF: Bad file descriptor - not a socket file descriptor
        C:/Ruby24-x64/lib/ruby/2.4.0/webrick/server.rb:257:in `accept'
```

And after that it looked like the client continually failed.

Anyway, it appears that this issue has been addressed in recent versions.

----------------------------------------
Bug #11482: Multiple versions of Ruby crashing with simple threaded client/server test
https://bugs.ruby-lang.org/issues/11482#change-79914

* Author: s_p_oneil (Sean O'Neil)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
Using the attached client and server scripts, I have been able to quickly crash every version of Ruby I tested from 1.9.3 to 2.2.3. Sometimes only the client crashes, sometimes only the server, and a few times I've seen both crash at the same time. Sometimes it has to run a while before either crashes, but it usually happens pretty quickly.

I've only tested it on Windows (built with multiple compilers), but it may happen on other operating systems as well. I have tested:

* v1.9.3-p374 built with Visual Studio 2012 (x86 and x64)
* v2.1.5 built with Visual Studio 2012 and 2015 (x86 and x64)
* v2.1.7 built with Visual Studio 2012 and 2015 (x86 and x64)
* v2.2.2 built with Visual Studio 2012 and 2015 (x86 and x64)
* v2.2.3 built with Visual Studio 2012 and 2015 (x86 and x64)
* The RubyInstaller v2.2.2 (x64-mingw32)
* The current ruby_2_2 branch built with Visual Studio 2015 (x86 and x64)

vs2015.patch: I applied this patch to the 2.x versions to get it compiling and running in Visual Studio 2015. This patch is a combination of other patches I've seen online, and it has worked well so far (aside from the crashes that seem to be occurring when built with other compilers as well).

The crash dump always seems to point to gc.c or st.c. It's hard to see what's causing it in gc.c in Visual Studio, but when it crashes in st.c, it is usually due to st_table_entry::next and st_table_entry::prev being set to an invalid non-NULL value (so far it always appears to be set to 0x1 or 0x32, which can cause it to crash in various places in st.c, but I haven't figured out where/how they're being set to those values).

The only reason I tried so many different versions is because I was hoping to find one that worked to choose as a "stable" version to use, but in the end I had to give up and submit this problem to the experts.


---Files--------------------------------
client.rb (540 Bytes)
server.rb (588 Bytes)
vs2015.patch (7.44 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-23 18:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <redmine.issue-11482.20150824154351@ruby-lang.org>
2015-08-24 15:43 ` [ruby-core:70571] [Ruby trunk - Bug #11482] [Open] Multiple versions of Ruby crashing with simple threaded client/server test sean.p.oneil
2019-07-23 18:56 ` [ruby-core:93891] [Ruby master Bug#11482] " merch-redmine

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).