zirias@
Developer
Context: I'm working on a web service here: https://github.com/Zirias/swad ... this uses my library https://github.com/Zirias/poser which offers a "reactor" design, and for performance reasons, I'm extending it to allow a "multi-reactor" (multiple threads each with their own event loop) with "acceptor-connector" scheme (main thread accepts connection, some other thread creates the local connection object and manages it in its event loop). Was quite an effort so far, and I know there are still some issues, but for the basic operation, everything seems fine now except it crashes with LibreSSL, and I can't find a good way to debug this.
Copying a text I already posted on mastodon for further details:
On FreeBSD, with all ports built with LibreSSL, can I somehow use the clang thread sanitizer on a binary actually using LibreSSL and get sane output?
What I now observe debugging swad:
Copying a text I already posted on mastodon for further details:
On FreeBSD, with all ports built with LibreSSL, can I somehow use the clang thread sanitizer on a binary actually using LibreSSL and get sane output?
What I now observe debugging swad:
- A version built with OpenSSL (from base) doesn't crash. At least I tried very hard, really stressing it with jmeter, to no avail. Built with LibreSSL, it does crash.
- Less relevant: the OpenSSL version also performs slightly better, but needs almost twice the RAM
- The thread sanitizer finds nothing to complain when built with OpenSSL
- It complains a lot with LibreSSL, but the reports look "fishy", e.g. it seems to intercept some OpenSSL API functions (like SHA384_Final)
- It even complains when running with a single-thread event loop.
- I use a single SSL_CTX per listening socket, creating SSL objects from it per connection ... also with multithreading; according to a few sources, this should be supported and safe.
- I can't imagine doing that on a *single* thread could break with LibreSSL, I mean, this would make SSL_CTX pretty much pointless
- I *could* imagine sharing the SSL_CTX with multiple threads to create their SSL objects from *might* not be safe with LibreSSL, but no idea how to verify as long as the thread sanitizer gives me "delusional" output