Issue #11680 has been reported by Hiroshi Shirosaki. ---------------------------------------- Bug #11680: LD_PRELOAD setting causes child process crash on mingw https://bugs.ruby-lang.org/issues/11680 * Author: Hiroshi Shirosaki * Status: Open * Priority: Normal * Assignee: * ruby -v: ruby 2.3.0dev (2015-11-11 trunk 47767) [x64-mingw32] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- I see make test-all failures on mingw with msys2. ``` TestMiniTestUnitTestCase#test_assert_equal_different_long = 0 [main] diff 8736 C:\Users\h.shirosaki\work\rubyinsta ller\sandbox\devkit\usr\bin\diff.exe: *** fatal error - error while loading shared libraries: C: cannot open shared obje ct file: No such file or directory 434 [main] diff 8736 cygwin_exception::open_stackdumpfile: Dumping stack trace to diff.exe.stackdump 0 [main] diff 8048 C:\Users\h.shirosaki\work\rubyinstaller\sandbox\devkit\usr\bin\diff.exe: *** fatal error - erro r while loading shared libraries: C: cannot open shared object file: No such file or directory 388 [main] diff 8048 cygwin_exception::open_stackdumpfile: Dumping stack trace to diff.exe.stackdump 0.06 s = F ``` diff.exe of msys2 crashed. LD_PRELOAD is set in tool/runruby.rb on test-all. If I set `ENV['LD_PRELOAD'] = nil`, diff.exe doesn't crash. LD_PRELOAD may not usable on msys2(cygwin). ``` diff --git a/configure.in b/configure.in index 0d253a9..e97871d 100644 --- a/configure.in +++ b/configure.in @@ -3126,6 +3126,7 @@ if test "$with_dln_a_out" != yes; then XLDFLAGS="$XLDFLAGS -Wl,--stack,0x00200000,--enable-auto-import" DLDFLAGS="${DLDFLAGS} -Wl,--enable-auto-image-base,--enable-auto-import" : ${LIBPATHENV=""} + : ${PRELOADENV=""} rb_cv_dlopen=yes], [hiuxmpp], [ : ${LDSHARED='$(LD) -r'}], [atheos*], [ : ${LDSHARED='$(CC) -shared'} ``` -- https://bugs.ruby-lang.org/