You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While performing many queries in a row to our API the code at some point errors out with a SIGSEGV. This comes from ssl3_read_bytes which in turn is called from https://github.com/nim-lang/Nim/blob/version-2-0/lib/pure/asyncnet.nim#L328. Starting each AsyncHttpClient with their own SSLContext seems to have helped somewhat, but the error still occurs occasionally. My best guess is that there is some condition where SSL needs some extra care that AsyncHttpClient doesn't provide, and this corrupts the SSLContext leading to the SIGSEGV. But that is just speculation based on the fact that this only happens sometimes.
Nim Version
Tested with 2.0.8
Current Output
This is a backtrace from GDB when the crash happens, line 112 in mycode.nim (redacted name and SSL buffer contents) is a call to waitFor on multiple connections combined with all.
#0 0x00007ffff7c39e4a in ssl3_read_bytes (ssl=<optimized out>, type=23 '\027', recvd_type=0x0,
buf=0x7ffff7ba3046 "<data>"..., len=4000, peek=0, readbytes=0x7fffffffd030) at ssl/record/rec_layer_s3.c:687
#1 0x00007ffff7be6989 in ssl3_read_internal (s=0x5555560006f0, buf=0x7ffff7ba3046, len=4000, peek=0,
readbytes=0x7fffffffd030) at ssl/s3_lib.c:4527
#2 0x00007ffff7bee56b in SSL_read (s=<optimized out>, buf=<optimized out>, num=<optimized out>) at ssl/ssl_lib.c:2328
#3 0x00005555555cdc96 in _ZN4recv19recvX20X28AsyncX29_E (ClE_0=0x7fffeab86280)
at /home/peter/.choosenim/toolchains/nim-2.0.8/lib/pure/asyncnet.nim:328
#4 0x00005555555c92f7 in _ZN4recv20recvNimAsyncContinueE (ClE_0=0x7ffff7b824c0)
at /home/peter/.choosenim/toolchains/nim-2.0.8/lib/pure/asyncmacro.nim:33
#5 0x00005555555bc2b7 in _ZN13asyncdispatch23processPendingCallbacksE3refIN13asyncdispatch31PDispatcherBasecolonObjectType_EE3varI4boolE (p_p0=p_p0@entry=0x7ffff7b54120, didSomeWork_p1=didSomeWork_p1@entry=0x7fffffffd1bf)
at /home/peter/.choosenim/toolchains/nim-2.0.8/lib/pure/asyncdispatch.nim:269
#6 0x00005555555bc5ac in _ZN13asyncdispatch7runOnceE3int (timeout_p0=timeout_p0@entry=500)
at /home/peter/.choosenim/toolchains/nim-2.0.8/lib/pure/asyncdispatch.nim:1452
#7 0x00005555555bc94a in _ZN13asyncdispatch4pollE3int (timeout_p0=timeout_p0@entry=500)
at /home/peter/.choosenim/toolchains/nim-2.0.8/lib/pure/asyncdispatch.nim:1711
#8 0x00005555555bfd9f in _ZN13asyncdispatch7waitForE6FutureI4voidE (fut_p0=fut_p0@entry=0x7ffff7b5a760)
at /home/peter/.choosenim/toolchains/nim-2.0.8/lib/pure/asyncdispatch.nim:2022
#9 0x0000555555603287 in NimMainModule () at mycode.nim:112
The text was updated successfully, but these errors were encountered:
Description
While performing many queries in a row to our API the code at some point errors out with a SIGSEGV. This comes from
ssl3_read_bytes
which in turn is called from https://github.com/nim-lang/Nim/blob/version-2-0/lib/pure/asyncnet.nim#L328. Starting eachAsyncHttpClient
with their ownSSLContext
seems to have helped somewhat, but the error still occurs occasionally. My best guess is that there is some condition where SSL needs some extra care thatAsyncHttpClient
doesn't provide, and this corrupts theSSLContext
leading to the SIGSEGV. But that is just speculation based on the fact that this only happens sometimes.Nim Version
Tested with 2.0.8
Current Output
This is a backtrace from GDB when the crash happens, line 112 in
mycode.nim
(redacted name and SSL buffer contents) is a call towaitFor
on multiple connections combined withall
.The text was updated successfully, but these errors were encountered: