Issue #13856 has been updated by MSP-Greg (Greg L).


Shirosaki-san,

'Breakfast build' is finished, passed `test-all`, and the following also passed:
```
ruby runner.rb -I../lib -I. --repeat-count=50 --show-skip socket/test_socket.rb -ntest_closed_read
```

This has been an intermittent failure, but I've never had it complete 50 before.

Hence, along with usa, I believe you've fixed the issue.  Thanks again for your work.

I'm not sure how everyone would prefer to be addressed.  If you'd like to address me, please call me Greg.  The first code I wrote was on a teletype...

----------------------------------------
Bug #13856: MinGW / mswin intermittent failure in test/socket/test_socket.rb
https://bugs.ruby-lang.org/issues/13856#change-66821

* Author: MSP-Greg (Greg L)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.5.0dev (2017-09-11 trunk 59829) [x64-mingw32]
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
Recently, there have been two Appveyor fails, [first](https://ci.appveyor.com/project/ruby/ruby/build/1.0.5036) and [second](https://ci.appveyor.com/project/ruby/ruby/build/1.0.5078).

Both listed the following as the error:

```
running file: C:/projects/ruby/test/socket/test_socket.rb

Some worker was crashed. It seems ruby interpreter's bug
or, a bug of test/unit/parallel.rb. try again without -j
option.
```

I have a similar intermittent error as a silent segfault in MinGW builds.  I've attached the patch file I use, it patches the [TestSocket#test_closed_read](https://github.com/ruby/ruby/blob/ed740754bd96e845bc86f070b90267efc1ad5136/test/socket/test_socket.rb#L528-L548) method, and simply adds `sock.autoclose = false` after `sock` is created.

I haven't done much Ruby socket coding, so I've never looked into the issue, but the test passes and is stable with the patch.  For all I know, the patch may 'end-around' the whole point of the test.

I don't know if this helps identify the real issue or not. If not, feel free to close.

---Files--------------------------------
segv-test-socket-test_socket.rb.patch (782 Bytes)
0001-io.c-fix-segfault-with-closing-socket-on-MinGW.patch (1.76 KB)


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

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>