httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralf S. Engelschall" <...@engelschall.com>
Subject MM 1.0.9
Date Fri, 02 Jul 1999 20:25:43 GMT

Everyone who uses MM should upgrade to the latest 1.0.9 version, because today
some users have discovered two nasty bugs related to the mutex code and I've
fixed them in 1.0.9. Without the bugfix horrible race conditions can occur for
the shared memory segment access.

Fetch it from:
  http://www.engelschall.com/sw/mm/
   ftp://ftp.engelschall.com/sw/mm/

BTW, the bug was really interesting. It was a typo, but one which cannot be
catched by the compiler, because C allows empty statements. So it was a really
entertaining bug, because I've traced and traced the statements for hours
today but I couldn't see it. One is such used to the semicolons in C that the
eye totally overlooked it even inside the debugger.

Want to see the bug? Here it is...

Index: mm_alloc.c
===================================================================
RCS file: /sw/pkg/mm/cvs/mm/mm_alloc.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- mm_alloc.c  1999/06/22 13:23:51 1.10
+++ mm_alloc.c  1999/07/02 20:01:04 1.11
@@ -119,7 +119,7 @@
  */
 int mm_lock(MM *mm, mm_lock_mode mode)
 {
-    if (mm == NULL);
+    if (mm == NULL)
         return FALSE;
     return mm_core_lock((void *)mm, mode);
 }
@@ -129,7 +129,7 @@
  */
 int mm_unlock(MM *mm)
 {
-    if (mm == NULL);
+    if (mm == NULL)
         return FALSE;
     return mm_core_unlock((void *)mm);
 }
                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com

Mime
View raw message