I have this working in a branch restart_nocrash. Most of the work here was in #24337 (moved); this is just some additionl cleanup.
Note that this is NOT a complete fix for the parent bug: it's just a fix for the crashing part. I was, however, enable to use a socks port after restarting in-process, so that's something.
The changes look good to me. If this fix allows restarting in the same process where we didn't before, does restarting cause anything dangerous to happen with OpenSSL, like PRNG state? Maybe we could document that there might be some security risks with restarting until we track them down.
good idea. I'll add a note about possible security issues, and merge, if that's okay with you. I'll look at PRNG in particular. Can you help me brainstorm other things to check for?
merged to master, with an extra commit for openssl as 42751e2123f6dcc87f3992d38c1889f7da981a7b. The PRNG wasn't being left unseeded or anything, but we were failing to re-seed on restart.
Trac: Resolution: N/Ato implemented Status: needs_review to closed