ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:95434] [Ruby master Bug#16265] Test (spec) failure using current MSYS2 tools, related to -fstack-protector and possibly D_FORTIFY_SOURCE=2
       [not found] <redmine.issue-16265.20191019174647@ruby-lang.org>
@ 2019-10-19 17:46 ` Greg.mpls
  2019-10-20 22:51 ` [ruby-core:95443] " Greg.mpls
  2019-12-03 15:09 ` [ruby-core:96083] " Greg.mpls
  2 siblings, 0 replies; 3+ messages in thread
From: Greg.mpls @ 2019-10-19 17:46 UTC (permalink / raw)
  To: ruby-core

Issue #16265 has been reported by MSP-Greg (Greg L).

----------------------------------------
Bug #16265: Test (spec) failure using current MSYS2 tools, related to -fstack-protector and possibly D_FORTIFY_SOURCE=2
https://bugs.ruby-lang.org/issues/16265

* Author: MSP-Greg (Greg L)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.7.0dev (2019-10-19T08:19:27Z master 1d435bd51a) [x64-mingw32]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
GH PR https://github.com/ruby/ruby/pull/2573 was a work-around that forced using some non-current MSYS2 packages libraries for building.  These libraries are only available on Appveyor because their images are out-of-date, a new MSYS2 install would not have them.

Using current MSYS2 libraries requires adding '-fstack-protector' to LDFLAGS.  I also experimented with adding 'D_FORTIFY_SOURCE=2' to CFLAGS.

Ruby build/compiles with those flags added.  test-all passes.  But spec tests always lock up when running:
```
C-API Thread function rb_thread_call_without_gvl
- runs a C function with the global lock unlocked
- runs a C function with the global lock unlocked amd unlocks IO with the generic RUBY_UBF_IO
```

The tests are in spec/ruby/optional/capi/thread_spec.rb, as shown:

https://github.com/ruby/ruby/blob/1d435bd51aeca75f6e437bc92de2271a716a1ced/spec/ruby/optional/capi/thread_spec.rb#L124-L141

and the freeze occurs on line 137.

I've run this once in ruby-loco, twice in my ruby fork, and several times locally.  In all runs, test-all passed, and spec stopped at the test above.  This uses gcc 9.2.0, and the problem would occur with anyone doing a 'fresh' install of MSYS2.

Not being a c type, this is way beyond what I can fix.  Happy to try patches, etc.  Thanks, Greg




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

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

* [ruby-core:95443] [Ruby master Bug#16265] Test (spec) failure using current MSYS2 tools, related to -fstack-protector and possibly D_FORTIFY_SOURCE=2
       [not found] <redmine.issue-16265.20191019174647@ruby-lang.org>
  2019-10-19 17:46 ` [ruby-core:95434] [Ruby master Bug#16265] Test (spec) failure using current MSYS2 tools, related to -fstack-protector and possibly D_FORTIFY_SOURCE=2 Greg.mpls
@ 2019-10-20 22:51 ` Greg.mpls
  2019-12-03 15:09 ` [ruby-core:96083] " Greg.mpls
  2 siblings, 0 replies; 3+ messages in thread
From: Greg.mpls @ 2019-10-20 22:51 UTC (permalink / raw)
  To: ruby-core

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


I bypassed the spec mentioned above:
```
C-API Thread function rb_thread_call_without_gvl
- runs a C function with the global lock unlocked and unlocks IO with the generic RUBY_UBF_IO
```

and with it bypassed, all tests/specs reliably pass on MinGW.  Since most of the CI that uses gcc is done on versions older than the current MSYS2 version (9.2.0),  I don't know whether it's a general problem or just Windows related.

Either way, anyone doing a fresh MSYS2 install and then building Ruby will have issues without changes to flags and the above test/spec.



----------------------------------------
Bug #16265: Test (spec) failure using current MSYS2 tools, related to -fstack-protector and possibly D_FORTIFY_SOURCE=2
https://bugs.ruby-lang.org/issues/16265#change-82194

* Author: MSP-Greg (Greg L)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.7.0dev (2019-10-19T08:19:27Z master 1d435bd51a) [x64-mingw32]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
GH PR https://github.com/ruby/ruby/pull/2573 was a work-around that forced using some non-current MSYS2 packages libraries for building.  These libraries are only available on Appveyor because their images are out-of-date, a new MSYS2 install would not have them.

Using current MSYS2 libraries requires adding '-fstack-protector' to LDFLAGS.  I also experimented with adding 'D_FORTIFY_SOURCE=2' to CFLAGS.

Ruby build/compiles with those flags added.  test-all passes.  But spec tests always lock up when running:
```
C-API Thread function rb_thread_call_without_gvl
- runs a C function with the global lock unlocked
- runs a C function with the global lock unlocked amd unlocks IO with the generic RUBY_UBF_IO
```

The tests are in spec/ruby/optional/capi/thread_spec.rb, as shown:

https://github.com/ruby/ruby/blob/1d435bd51aeca75f6e437bc92de2271a716a1ced/spec/ruby/optional/capi/thread_spec.rb#L124-L141

and the freeze occurs on line 137.

I've run this once in ruby-loco, twice in my ruby fork, and several times locally.  In all runs, test-all passed, and spec stopped at the test above.  This uses gcc 9.2.0, and the problem would occur with anyone doing a 'fresh' install of MSYS2.

Not being a c type, this is way beyond what I can fix.  Happy to try patches, etc.  Thanks, Greg




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

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

* [ruby-core:96083] [Ruby master Bug#16265] Test (spec) failure using current MSYS2 tools, related to -fstack-protector and possibly D_FORTIFY_SOURCE=2
       [not found] <redmine.issue-16265.20191019174647@ruby-lang.org>
  2019-10-19 17:46 ` [ruby-core:95434] [Ruby master Bug#16265] Test (spec) failure using current MSYS2 tools, related to -fstack-protector and possibly D_FORTIFY_SOURCE=2 Greg.mpls
  2019-10-20 22:51 ` [ruby-core:95443] " Greg.mpls
@ 2019-12-03 15:09 ` Greg.mpls
  2 siblings, 0 replies; 3+ messages in thread
From: Greg.mpls @ 2019-12-03 15:09 UTC (permalink / raw)
  To: ruby-core

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


PR https://github.com/ruby/ruby/pull/2718 shows this issue, and also properly updates MSYS/MinGW gcc.

----------------------------------------
Bug #16265: Test (spec) failure using current MSYS2 tools, related to -fstack-protector and possibly D_FORTIFY_SOURCE=2
https://bugs.ruby-lang.org/issues/16265#change-82932

* Author: MSP-Greg (Greg L)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.7.0dev (2019-10-19T08:19:27Z master 1d435bd51a) [x64-mingw32]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
GH PR https://github.com/ruby/ruby/pull/2573 was a work-around that forced using some non-current MSYS2 packages libraries for building.  These libraries are only available on Appveyor because their images are out-of-date, a new MSYS2 install would not have them.

Using current MSYS2 libraries requires adding '-fstack-protector' to LDFLAGS.  I also experimented with adding 'D_FORTIFY_SOURCE=2' to CFLAGS.

Ruby build/compiles with those flags added.  test-all passes.  But spec tests always lock up when running:
```
C-API Thread function rb_thread_call_without_gvl
- runs a C function with the global lock unlocked
- runs a C function with the global lock unlocked amd unlocks IO with the generic RUBY_UBF_IO
```

The tests are in spec/ruby/optional/capi/thread_spec.rb, as shown:

https://github.com/ruby/ruby/blob/1d435bd51aeca75f6e437bc92de2271a716a1ced/spec/ruby/optional/capi/thread_spec.rb#L124-L141

and the freeze occurs on line 137.

I've run this once in ruby-loco, twice in my ruby fork, and several times locally.  In all runs, test-all passed, and spec stopped at the test above.  This uses gcc 9.2.0, and the problem would occur with anyone doing a 'fresh' install of MSYS2.

Not being a c type, this is way beyond what I can fix.  Happy to try patches, etc.  Thanks, Greg




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

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

end of thread, other threads:[~2019-12-03 15:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redmine.issue-16265.20191019174647@ruby-lang.org>
2019-10-19 17:46 ` [ruby-core:95434] [Ruby master Bug#16265] Test (spec) failure using current MSYS2 tools, related to -fstack-protector and possibly D_FORTIFY_SOURCE=2 Greg.mpls
2019-10-20 22:51 ` [ruby-core:95443] " Greg.mpls
2019-12-03 15:09 ` [ruby-core:96083] " Greg.mpls

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).