Since nobody objected I've committed my workaround to 7.2, 7.4 and 7.5. As stated in the log message this seems to be a case where the write callback gets called multiple times in separate threads with the same data. It sounds like a fundamental problem that may affect more than the SSL module.
(I should add that the Roxen server didn't run on OS X; it was a Solaris installation.)
/ Jonas Walldén
Previous text:
2003-09-12 18:20: Subject: Pike 7.4.30
I've got a patch to sslfile.pike which may be of interest. It solves a problem very similar to bug #2117 (lots of warnings for destructed files when running Roxen; in my case only reproducible using Safari on OS X) but I really don't know why.
Should I commit it to 7.4 and/or only 7.5? Anyone feeling responsible for this code and willing to dig into the actual reasons why the thread callbacks are mixed up?
Index: sslfile.pike
RCS file: /pike/data/cvsroot/Pike/7.4/lib/modules/SSL.pmod/sslfile.pike,v retrieving revision 1.50 diff -u -r1.50 sslfile.pike --- sslfile.pike 29 Nov 2002 01:22:14 -0000 1.50 +++ sslfile.pike 12 Sep 2003 16:13:08 -0000 @@ -371,8 +371,13 @@ } }
+private Thread.Mutex write_mutex = Thread.Mutex();
private void ssl_write_callback(mixed id) {
- Thread.MutexKey mutex_key = write_mutex->lock(2);
- if (!socket) return;
#ifdef SSL3_DEBUG werror(sprintf("SSL.sslfile->ssl_write_callback: handshake_finished = %d\n" "blocking = %d, write_callback = %O\n",
/ Jonas Walldén