Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI freebsd,openbsd broken: tests/stdlib/tssl.nim fails (high failure rate) #15713

Open
timotheecour opened this issue Oct 25, 2020 · 3 comments

Comments

@timotheecour
Copy link
Member

timotheecour commented Oct 25, 2020

/cc @euantorano since you're tracking those OS's

tests/stdlib/tssl.nim seems to fail very often since approximately oct 22 2020 for openbsd,freebsd

https://builds.sr.ht/~araq/job/326733
#15705

NOTINBATCH: lib/packages/docutils/rstgen.nim C
Error: execution of an external program failed: '/home/build/Nim/testament/testament --pedantic --batch:1_3 all -d:nimCoroutines'
FAILURE
+ nim c -r tools/ci_testresults.nim
Hint: used config file '/home/build/Nim/config/nim.cfg' [Conf]
Hint: used config file '/home/build/Nim/config/config.nims' [Conf]
..........................CC: stdlib_assertions.nim
CC: stdlib_io.nim
CC: stdlib_system.nim
CC: stdlib_parseutils.nim
CC: stdlib_math.nim
CC: stdlib_unicode.nim
CC: stdlib_strutils.nim
CC: stdlib_posix.nim
CC: stdlib_times.nim
CC: stdlib_os.nim
CC: stdlib_hashes.nim
CC: stdlib_tables.nim
CC: stdlib_streams.nim
CC: stdlib_lexbase.nim
CC: stdlib_parsejson.nim
CC: stdlib_json.nim
CC: stdlib_sets.nim
CC: stdlib_strformat.nim
CC: ci_testresults.nim

Hint:  [Link]
Hint: 57361 lines; 2.953s; 75.848MiB peakmem; Debug build; proj: /home/build/Nim/tools/ci_testresults.nim; out: /home/build/Nim/tools/ci_testresults [SuccessX]
Hint: /home/build/Nim/tools/ci_testresults  [Exec]
Category: stdlib
Name: tests/stdlib/tssl.nim C
Action: run
Result: reExitcodesDiffer
-------- Expected -------
exitcode: 0
--------- Given  --------
exitcode: 1

Output:
tssl.nim(134)            tssl
tssl.nim(69)             main
net.nim(1653)            send
net.nim(896)             socketError
net.nim(495)             raiseSSLError
Error: unhandled exception: error:02FFF036:system library:func(4095):Connection reset by peer: error:02FFF036:system library:func(4095):Connection reset by peer [SslError]
-------------------------

+ exit 1
@timotheecour timotheecour changed the title CI broken: tests/stdlib/tssl.nim fails (100% failure) CI freebsd broken: tests/stdlib/tssl.nim fails (100% failure) Oct 25, 2020
timotheecour added a commit to timotheecour/Nim that referenced this issue Oct 25, 2020
@timotheecour timotheecour changed the title CI freebsd broken: tests/stdlib/tssl.nim fails (100% failure) CI freebsd broken: tests/stdlib/tssl.nim fails (high failure rate) Oct 25, 2020
@timotheecour timotheecour changed the title CI freebsd broken: tests/stdlib/tssl.nim fails (high failure rate) CI freebsd,openbsd broken: tests/stdlib/tssl.nim fails (high failure rate) Oct 25, 2020
@euantorano
Copy link
Contributor

euantorano commented Oct 25, 2020 via email

@euantorano
Copy link
Contributor

I'm fairly surprised this affects both FreeBSD and OpenBSD, as FreeBSD uses OpenSSL and OpenBSD uses LibreSSL. The error indicates the connection is being shut prematurely for some reason.

@omar-polo
Copy link

omar-polo commented Mar 11, 2022

Hello,

On OpenBSD tests/stdlib/tssl.nim hangs forever.

With @VlkrS we managed to track this to the selectSigpipe call in close* in net.nim (which was added in c619ced.) The SIGPIPE is not really delivered, so the process waits forever on sigwait. The tls library doesn't matter, is just signal handling not working as expected.

How to solve this? I'm not sure. AFAIK OpenBSD doesn't have SO_NOSIGPIPE (freebsd does judging by setsockopt(2)).

My humble opinion (and i'm not a nim developer, i was just helping out updating the package on OpenBSD) is that the whole bockSigpipe stuff is a mess and should be avoided. (also, why blocking SIGPIPE in the close method but not in the other I/O methods?)
Just tell people to signal(SIGPIPE, SIG_IGN) once at startup as everyone else is doing. Or maybe nim could do something more elaborate like what go does by default i.e. allowing the process to die from SIGPIPE on file descriptors 0, 1 and 2 (like any other UNIX program) but not from other file descriptors.

Hope this helps,

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants