After the recent patches fixed a lot of the problems with building & running 
the mingw64 cross gnu toolchain with
"--with-default-msvcrt=ucrtbase" option, I have run some further tests 
concerning the seemingly broken pipe / fd handling probs:

Status:
---------
- Cross-Toolchain built with standard binary cygwin x86_64-w64-mingw32 
cross-toolchain packages:
=> OK.
- Cross-Toolchain built myself from source with cygwin environment using 
x86_64-w64-mingw32 cross-toolchain sources 
  _without_ "--with-default-msvcrt=ucrtbase" option: 
=> OK.

- Cross-Toolchain built myself from source with cygwin environment using 
x86_64-w64-mingw32 cross-toolchain sources 
  _with_ "--with-default-msvcrt=ucrtbase" option:
=> NOT OK !
Problems: Broken in/output handling, broken pipes, errors opening a named pipe, 
maybe broken crt initialization/handling of standard file descriptors:
- mingwcrt "make check-TESTS" showed undefined references : _setjmp , __pioinfo 
& wprintf (last one should be easy to fix)
- libuv "make check" showed broken outputs & all tests failed with messed up 
output.
- Julia "make testall" showed a broken pipe error in the first test & stopped.

I don't know much in detail about the crt initialization & handling of 
(standard) file descriptors, but the broken pipes & messed up outputs seem to
point in this direction. I have no idea where exactly to look to fix this 
problem.

==> Maybe some of the mingw64 developers have some ideas about these problems - 
it happens only in the ucrtbase version of the cross toolchain. ?

I have attached all outputs from the tests with and without the "ucrtbase" 
option to this post & hope this might help in further problem analysis & 
potential
fixes.

Thanks & Cheers
- Sven

P.S.: I used the current mingw64 master branch

-----Original Message-----
From: Sven Kretzschmar [mailto:sven.kretzsch...@gmx.de] 
Sent: 26 November 2017 18:07
To: 'mingw-w64-public@lists.sourceforge.net' 
<mingw-w64-public@lists.sourceforge.net>
Subject: RE: [Mingw-w64-public] [PATCH] ucrtbase: Don't include a import 
library alias "tzset"


Hi Martin,

Thanks for your patch. It fixed the problem.

When running the compiled Julia, I now get an error in its initialization when 
it tries to open a named pipe for stderr - fd 2 (it uses libuv).
Also , it immediately finishes after start & messes up stdout in the Cygwin 
shell (no more stdin echo to stdout)...
If I start it via a native Windows cmd shell, it (Julia.exe) seems to behave 
normally with non-messed up stdout...
As soon as stdin/out/err is involved, it seems to behave erratically.

I will check this further & report back here when I found a more specific 
reason / error description.

Thanks :)
- Sven

-----Original Message-----
From: Martin Storsjö [mailto:mar...@martin.st] 
Sent: 25 November 2017 21:13
To: mingw-w64-public@lists.sourceforge.net
Subject: [Mingw-w64-public] [PATCH] ucrtbase: Don't include a import library 
alias "tzset"

This was missed in 483ddaaf1b09590756ff8c59bc2db7501d7364f9.

Signed-off-by: Martin Storsjö <mar...@martin.st>
---
 mingw-w64-crt/def-include/msvcrt-common.def.in | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mingw-w64-crt/def-include/msvcrt-common.def.in 
b/mingw-w64-crt/def-include/msvcrt-common.def.in
index 9fb8dc2..c0418fc 100644
--- a/mingw-w64-crt/def-include/msvcrt-common.def.in
+++ b/mingw-w64-crt/def-include/msvcrt-common.def.in
@@ -92,7 +92,9 @@ ADD_UNDERSCORE(strupr)
 ADD_UNDERSCORE(swab)
 ADD_UNDERSCORE(tell)
 ADD_UNDERSCORE(tempnam)
+#ifndef UCRTBASE
 ADD_UNDERSCORE(tzset)
+#endif
 ADD_UNDERSCORE(umask)
 ADD_UNDERSCORE(ungetch)
 ADD_UNDERSCORE(unlink)
-- 
2.7.4

configure options used for gcc 6.4.0:
../../src/gcc/configure --prefix=/CROSS64 --build=x86_64-pc-cygwin 
--host=x86_64-pc-cygwin --target=x86_64-w64-mingw32 --with-sysroot=/CROSS64 
--with-build-sysroot=/CROSS64 --enable-languages=c,c++,fortran,lto 
--disable-multilib --disable-win32-registry --enable-fully-dynamic-string 
--enable-graphite --enable-libgomp --enable-libquadmath 
--enable-libquadmath-support --enable-libssp 
--enable-version-specific-runtime-libs --with-dwarf2 --with-gnu-ld 
--with-gnu-as --with-tune=generic --with-system-zlib --enable-threads=posix 
--disable-bootstrap --enable-lto --enable-checking=release --disable-rpath 
--disable-werror --without-libiconv-prefix --without-libintl-prefix 
--disable-symvers --enable-wchar_t

==================================================================================
OUTPUT with mingw64 toochain built _with_ "--with-default-msvcrt=ucrtbase" 
option:
==================================================================================
configure options used for mingw64-headers:
../../src/mingw-w64/mingw-w64-headers/configure 
--prefix=/CROSS64/x86_64-w64-mingw32 --build=x86_64-pc-cygwin 
--host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --enable-sdk=all 
--enable-secure-api --enable-idl --without-widl --with-default-msvcrt=ucrtbase

configure options used for mingw64-crt:
../../src/mingw-w64/mingw-w64-crt/configure 
--prefix=/CROSS64/x86_64-w64-mingw32 --with-sysroot=/CROSS64/x86_64-w64-mingw32 
--build=x86_64-pc-cygwin --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 
--enable-lib64 --disable-lib32 --enable-wildcard --with-default-msvcrt=ucrtbase


mingw64-crt tests
------------------
$ make -k check-TESTS
make[1]: Entering directory '/home/sven/buildtmp/build/mingw-crt'
PASS: testcases/tstmainc
PASS: testcases/tstmaincpp
PASS: testcases/tstmain_sys_xxx
PASS: testcases/t_ansi_io
PASS: testcases/t_findfirst
PASS: testcases/t_float
PASS: testcases/t_fstat
PASS: testcases/t_intrinc
PASS: testcases/t_imagebase
PASS: testcases/t_matherr
../../src/mingw-w64/mingw-w64-crt/build-aux/test-driver: line 107: 367820 
Segmentation fault      "$@" > $log_file 2>&1
XFAIL: testcases/t_nullptrexception
PASS: testcases/t_readdir
x86_64-w64-mingw32-gcc -pipe -std=gnu99 -D_CRTBLD -D_WIN32_WINNT=0x0f00 
-D__MSVCRT_VERSION__=0x700 -Wall -Wextra -Wformat -Wstrict-aliasing -Wshadow 
-Wpacked -Winline -Wimplicit-function-declaration -Wmissing-noreturn 
-Wmissing-prototypes -g -O2   -o testcases/t_setjmp testcases/t_setjmp.o
testcases/t_setjmp.o: In function `main':
/home/sven/buildtmp/build/mingw-crt/../../src/mingw-w64/mingw-w64-crt/testcases/t_setjmp.c:14:
 undefined reference to `_setjmp'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:16532: testcases/t_setjmp] Error 1
x86_64-w64-mingw32-gcc -pipe -std=gnu99 -D_CRTBLD -D_WIN32_WINNT=0x0f00 
-D__MSVCRT_VERSION__=0x700 -Wall -Wextra -Wformat -Wstrict-aliasing -Wshadow 
-Wpacked -Winline -Wimplicit-function-declaration -Wmissing-noreturn 
-Wmissing-prototypes -g -O2   -o testcases/t_sigv testcases/t_sigv.o
testcases/t_sigv.o: In function `main':
/home/sven/buildtmp/build/mingw-crt/../../src/mingw-w64/mingw-w64-crt/testcases/t_sigv.c:18:
 undefined reference to `_setjmp'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:16538: testcases/t_sigv] Error 1
PASS: testcases/t_speed_powl
PASS: testcases/t_stat
PASS: testcases/t_stdint
PASS: testcases/t_time
FAIL: testcases/t_tls1
FAIL: testcases/t_trycatch
x86_64-w64-mingw32-gcc -pipe -std=gnu99 -D_CRTBLD -D_WIN32_WINNT=0x0f00 
-D__MSVCRT_VERSION__=0x700 -Wall -Wextra -Wformat -Wstrict-aliasing -Wshadow 
-Wpacked -Winline -Wimplicit-function-declaration -Wmissing-noreturn 
-Wmissing-prototypes -g -O2   -o testcases/t_stat_slash testcases/t_stat_slash.o
testcases/t_stat_slash.o: In function `wtest':
/home/sven/buildtmp/build/mingw-crt/../../src/mingw-w64/mingw-w64-crt/testcases/t_stat_slash.c:22:
 undefined reference to `wprintf'
/home/sven/buildtmp/build/mingw-crt/../../src/mingw-w64/mingw-w64-crt/testcases/t_stat_slash.c:24:
 undefined reference to `wprintf'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:16556: testcases/t_stat_slash] Error 1
PASS: testcases/t_wreaddir
x86_64-w64-mingw32-gcc -pipe -std=gnu99 -D_CRTBLD -D_WIN32_WINNT=0x0f00 
-D__MSVCRT_VERSION__=0x700 -Wall -Wextra -Wformat -Wstrict-aliasing -Wshadow 
-Wpacked -Winline -Wimplicit-function-declaration -Wmissing-noreturn 
-Wmissing-prototypes -g -O2   -o testcases/t_fseeko64 testcases/t_fseeko64.o
/CROSS64/lib/gcc/x86_64-w64-mingw32/6.4.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingwex.a(lib64_libmingwex_a-fseeko64.o):fseeko64.c:(.rdata$.refptr.__imp___pioinfo[.refptr.__imp___pioinfo]+0x0):
 undefined reference to `__imp___pioinfo'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:16484: testcases/t_fseeko64] Error 1
PASS: testcases/t_municode
PASS: testcases/t_tmain
PASS: tests64/cimag
PASS: tests64/creal
PASS: tests64/cabs
PASS: tests64/cacos
PASS: tests64/cacosh
PASS: tests64/carg
PASS: tests64/casin
PASS: tests64/casinh
PASS: tests64/catan
PASS: tests64/catanh
PASS: tests64/ccos
PASS: tests64/ccosh
PASS: tests64/cexp
PASS: tests64/clog
PASS: tests64/conj
SKIP: tests64/cpow
PASS: tests64/cproj
PASS: tests64/csin
PASS: tests64/csinh
PASS: tests64/csqrt
PASS: tests64/ctan
PASS: tests64/ctanh
make[1]: Target 'test-suite.log' not remade because of errors.
make[1]: Leaving directory '/home/sven/buildtmp/build/mingw-crt'
make: *** [Makefile:61983: check-TESTS] Error 2

X==>...partly broken (_setjump, __pioinfo, (wprintf) )


libuv tests:
-------------
$ make check
make  test/run-tests.exe
[...]
[%   0|+   0|-   0|T   0|S   0]: platform_output
`platform_output` failed: exit code 255
Output from process `platform_output`:

`???????t?????r?????????t??????????e????p??????????????????t????????????????e????1????2????3????1????2????3????4????5?????1?????2?????3??????????e????????????????????????????????????????????????e???y????????????n???????????e???????????????????????????????????????????n??????g????????????????6???????????????g???????????????t???????n??????t?????????????????????????????n???????????????????e??????????????e????????????????????????????????????????????????????t????????????????????????????????s???????????d???????????t??`
 failed: No test with that name: 
???????t?????r?????????t??????????e????p??????????????????t????????????????e????1????2????3????1????2????3????4????5?????1?????2?????3??????????e????????????????????????????????????????????????e???y????????????n???????????e???????????????????????????????????????????n??????g????????????????6???????????????g???????????????t???????n??????t?????????????????????????????n???????????????????e??????????????e????????????????????????????????????????????????????t????????????????????????????????s???????????d???????????t??
=============================================================
=============================================================

[%   0|+   0|-   1|T   0|S   0]: close_order
`close_order` failed: exit code 255
Output from process `close_order`:

`?????r?????????t??????????e????p??????????????????t????????????????e????1????2????3????1????2????3????4????5?????1?????2?????3??????????e????????????????????????????????????????????????e???y????????????n???????????e???????????????????????????????????????????n??????g????????????????6???????????????g???????????????t???????n??????t?????????????????????????????n???????????????????e??????????????e????????????????????????????????????????????????????t????????????????????????????????s???????????d???????????t?????????t`
 failed: No test with that name: 
?????r?????????t??????????e????p??????????????????t????????????????e????1????2????3????1????2????3????4????5?????1?????2?????3??????????e????????????????????????????????????????????????e???y????????????n???????????e???????????????????????????????????????????n??????g????????????????6???????????????g???????????????t???????n??????t?????????????????????????????n???????????????????e??????????????e????????????????????????????????????????????????????t????????????????????????????????s???????????d???????????t?????????t
=============================================================

X==>...output broken, maybe fd handling broken too ?


Julia tests:
------------
make -j12 testall
[...]
$ ERROR: write: broken pipe (EPIPE)
Stacktrace:
 [1] try_yieldto(::Base.##296#297{Task}, ::Task) at .\event.jl:189
 [2] wait() at .\event.jl:234
 [3] uv_write(::Base.PipeEndpoint, ::Ptr{UInt8}, ::UInt64) at .\stream.jl:811
 [4] unsafe_write(::Base.PipeEndpoint, ::Ptr{UInt8}, ::UInt64) at 
.\stream.jl:832
 [5] print at .\strings\io.jl:122 [inlined]
 [6] start_worker(::Base.PipeEndpoint, ::String) at .\distributed\cluster.jl:165
 [7] process_options(::Base.JLOptions) at .\client.jl:262
 [8] _start() at .\client.jl:371
 
X==>...broken pipe, problems opening a named pipe, crt standard fd 
initialization/handling broken ?

=====================================================================================
OUTPUT with mingw64 toochain built _without_ "--with-default-msvcrt=ucrtbase" 
option:
=====================================================================================

configure options used for mingw64-headers:
../../src/mingw-w64/mingw-w64-headers/configure 
--prefix=/CROSS64/x86_64-w64-mingw32 --build=x86_64-pc-cygwin 
--host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --enable-sdk=all 
--enable-secure-api --enable-idl --without-widl

configure options used for mingw64-crt:
../../src/mingw-w64/mingw-w64-crt/configure 
--prefix=/CROSS64/x86_64-w64-mingw32 --with-sysroot=/CROSS64/x86_64-w64-mingw32 
--build=x86_64-pc-cygwin --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 
--enable-lib64 --disable-lib32 --enable-wildcard


mingw64-crt tests
------------------
make check-TESTS
make[1]: Entering directory '/home/sven/buildtmp/build/mingw-crt'
PASS: testcases/tstmainc
PASS: testcases/tstmaincpp
PASS: testcases/tstmain_sys_xxx
PASS: testcases/t_ansi_io
PASS: testcases/t_findfirst
PASS: testcases/t_float
PASS: testcases/t_fstat
PASS: testcases/t_intrinc
PASS: testcases/t_imagebase
PASS: testcases/t_matherr
../../src/mingw-w64/mingw-w64-crt/build-aux/test-driver: line 107: 467512 
Segmentation fault      "$@" > $log_file 2>&1
XFAIL: testcases/t_nullptrexception
PASS: testcases/t_readdir
PASS: testcases/t_setjmp
PASS: testcases/t_sigv
PASS: testcases/t_speed_powl
PASS: testcases/t_stat
PASS: testcases/t_stdint
PASS: testcases/t_time
FAIL: testcases/t_tls1
FAIL: testcases/t_trycatch
PASS: testcases/t_stat_slash
PASS: testcases/t_wreaddir
PASS: testcases/t_fseeko64
PASS: testcases/t_municode
PASS: testcases/t_tmain
PASS: tests64/cimag
PASS: tests64/creal
PASS: tests64/cabs
PASS: tests64/cacos
PASS: tests64/cacosh
PASS: tests64/carg
PASS: tests64/casin
PASS: tests64/casinh
PASS: tests64/catan
PASS: tests64/catanh
PASS: tests64/ccos
PASS: tests64/ccosh
PASS: tests64/cexp
PASS: tests64/clog
PASS: tests64/conj
SKIP: tests64/cpow
PASS: tests64/cproj
PASS: tests64/csin
PASS: tests64/csinh
PASS: tests64/csqrt
PASS: tests64/ctan
PASS: tests64/ctanh
============================================================================
Testsuite summary for mingw-w64-runtime 4.0b
============================================================================
# TOTAL: 47
# PASS:  43
# SKIP:  1
# XFAIL: 1
# FAIL:  2
# XPASS: 0
# ERROR: 0

...OK, so far...


libuv tests:
-------------
$ make check
make  test/run-tests.exe
[...]
[%   0|+   0|-   0|T   0|S   0]: platform_output
Output from process `platform_output`:
uv_get_process_title: invisible cygwin console
uv_cwd: 
C:\cygwin64\home\sven\buildtmp\julia\deps\scratch\libuv-52d72a52cc7ccd570929990f010ed16e2ec604c8
uv_resident_set_memory: 5971968
[...]
=============================================================

[%   0|+   1|-   0|T   0|S   0]: close_order
[%   0|+   2|-   0|T   0|S   0]: run_once
[%   1|+   3|-   0|T   0|S   0]: run_nowait
[%   1|+   4|-   0|T   0|S   0]: loop_alive
[%   1|+   5|-   0|T   0|S   0]: loop_close
[%   2|+   6|-   0|T   0|S   0]: loop_stop
[%   2|+   7|-   0|T   0|S   0]: loop_update_time
[%   2|+   8|-   0|T   0|S   0]: loop_backend_timeout
[%   3|+   9|-   0|T   0|S   0]: loop_configure
[%   3|+  10|-   0|T   0|S   0]: default_loop_close
[...]

...some minor failures, but looks fairly normal.


Julia tests:
------------
 make -j12 testall
cp /home/sven/buildtmp/julia/usr/lib/julia/sys.dll 
/home/sven/buildtmp/julia/local.dll && 
/home/sven/buildtmp/julia/usr/bin/julia.exe -J `cygpath -w 
/home/sven/buildtmp/julia/local.dll` -e 'true' && rm 
/home/sven/buildtmp/julia/local.dll
    JULIA test/all
Test (Worker)              | Time (s) | GC (s) | GC % | Alloc (MB) | RSS (MB)
[...]
ambiguous (2)              |    3.22  |  0.17  |  5.1 | 39.60      | 257.32
linalg/special (8)         |   26.66  |  0.49  |  1.8 | 559.18     | 276.62
linalg/schur (7)           |   29.08  |  0.50  |  1.7 | 637.93     | 282.90
linalg/svd (11)            |   33.70  |  0.51  |  1.5 | 539.17     | 279.77
linalg/pinv (7)            |   11.66  |  0.24  |  2.0 | 695.38     | 357.54
linalg/givens (11)         |    7.99  |  0.07  |  0.8 | 123.73     | 288.54
linalg/lapack (12)         |   60.95  |  0.79  |  1.3 | 1338.47    | 308.29
linalg/tridiag (13)        |   60.96  |  0.78  |  1.3 | 1398.04    | 328.68
[...]

...some minor warnings, nothing fatal.



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to