[#83773] [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769 — usa@...
Issue #14108 has been updated by usa (Usaku NAKAMURA).
9 messages
2017/11/15
[#83774] Re: [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769
— Eric Wong <normalperson@...>
2017/11/15
usa@garbagecollect.jp wrote:
[#83775] Re: [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769
— "U.NAKAMURA" <usa@...>
2017/11/15
Hi, Eric
[#83779] Re: [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769
— Eric Wong <normalperson@...>
2017/11/15
"U.NAKAMURA" <usa@garbagecollect.jp> wrote:
[#83781] Re: [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769
— "U.NAKAMURA" <usa@...>
2017/11/15
Hi, Eric,
[#83782] Re: [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769
— Eric Wong <normalperson@...>
2017/11/15
"U.NAKAMURA" <usa@garbagecollect.jp> wrote:
[ruby-core:83779] Re: [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769
From:
Eric Wong <normalperson@...>
Date:
2017-11-15 07:12:42 UTC
List:
ruby-core #83779
"U.NAKAMURA" <usa@garbagecollect.jp> wrote: > Hi, Eric > > In message "[ruby-core:83774] Re: [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769" > on Wed, 15 Nov 2017 04:14:37 +0000, normalperson@yhbt.net wrote: > > Oops, I will need to modify (or revert) r60769 anyways. > > It may be possible for concurrent threads to share Dir objects > > and we were relying on GVL for protect pure-Ruby code from > > stepping over each other. > > I've not checked this problem deeply yet. > > You can see our implementation of readdir on Windows in > win32/win32.c (rb_w32_readdir). > I doubt the second argument (rb_encoding *enc) is the cause. Right, enc is no problem. The problem is using DIR * from stdio is not reentrant or thread-safe. readdir_r is deprecated, even, and so it is up to the application to provide thread-safety when reading directories. Usually on modern platforms (but not guaranteed), readdir on different DIR * pointers is safe from multiple threads, so maybe we can add a mutex to "struct dir_data". I will revert r60772, r60770, and r60769 for now... Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>