gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r36932 - in libmicrohttpd: . src/include src/microhttpd


From: gnunet
Subject: [GNUnet-SVN] r36932 - in libmicrohttpd: . src/include src/microhttpd
Date: Tue, 15 Mar 2016 21:54:16 +0100

Author: grothoff
Date: 2016-03-15 21:54:16 +0100 (Tue, 15 Mar 2016)
New Revision: 36932

Modified:
   libmicrohttpd/ChangeLog
   libmicrohttpd/src/include/microhttpd.h
   libmicrohttpd/src/microhttpd/daemon.c
Log:
Dan Dedrick wrote:

If pthread_create fails for some reason we need to not access the
thread pointer as it will not be valid. Without this check a failed
return code from pthread_create would cause a SIGSEGV to occur.

An instance that pthread_create could fail is if enough connections were
established that we ran out of space in our mapping to create another
thread stack. Specifically I have seen this occur with
systemd-journal-gatewayd where there was a bug with not releasing
connections after they had disconnected. I submitted a fix for that
here: https://github.com/systemd/systemd/pull/2287 but it would really
be best if libmicrohttpd didn't SIGSEGV under these conditions.


Modified: libmicrohttpd/ChangeLog
===================================================================
--- libmicrohttpd/ChangeLog     2016-03-15 19:31:42 UTC (rev 36931)
+++ libmicrohttpd/ChangeLog     2016-03-15 20:54:16 UTC (rev 36932)
@@ -1,3 +1,6 @@
+Tue Mar 15 21:52:27 CET 2016
+       Do not crash if pthread_create() fails. -DD
+
 Tue Mar 15 20:29:34 CET 2016
        Do not use eready DLL data structure unless
        we are actually using epoll(). -DD/CG

Modified: libmicrohttpd/src/include/microhttpd.h
===================================================================
--- libmicrohttpd/src/include/microhttpd.h      2016-03-15 19:31:42 UTC (rev 
36931)
+++ libmicrohttpd/src/include/microhttpd.h      2016-03-15 20:54:16 UTC (rev 
36932)
@@ -130,7 +130,7 @@
  * Current version of the library.
  * 0x01093001 = 1.9.30-1.
  */
-#define MHD_VERSION 0x00094803
+#define MHD_VERSION 0x00094804
 
 /**
  * MHD-internal return code for "YES".

Modified: libmicrohttpd/src/microhttpd/daemon.c
===================================================================
--- libmicrohttpd/src/microhttpd/daemon.c       2016-03-15 19:31:42 UTC (rev 
36931)
+++ libmicrohttpd/src/microhttpd/daemon.c       2016-03-15 20:54:16 UTC (rev 
36932)
@@ -1283,7 +1283,8 @@
   ret = pthread_create (thread, pattr,
                        start_routine, arg);
 #ifdef HAVE_PTHREAD_SETNAME_NP
-  (void) pthread_setname_np (*thread, "libmicrohttpd");
+  if (0 == ret)
+    (void) pthread_setname_np (*thread, "libmicrohttpd");
 #endif /* HAVE_PTHREAD_SETNAME_NP */
   if (0 != daemon->thread_stack_size)
     pthread_attr_destroy (&attr);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]