You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2006/06/18 07:25:02 UTC

DO NOT REPLY [Bug 39833] New: - process locks / pthread robust mutexes

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39833>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39833

           Summary: process locks / pthread robust mutexes
           Product: APR
           Version: HEAD
          Platform: All
        OS/Version: Solaris
            Status: NEW
          Severity: normal
          Priority: P3
         Component: APR
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: nazonazo@miobox.jp


There's a typo in APR_CHECK_PTHREAD_ROBUST_SHARED_MUTEX:

--- build/apr_threads.m4	Sun Jun 18 12:00:00 2006
+++ build/apr_threads.m4	Sun Jun 18 12:00:00 2006
@@ -263,7 +263,7 @@
         exit(2);
     if (pthread_mutexattr_setrobust_np(&attr, PTHREAD_MUTEX_ROBUST_NP))
         exit(3);
-    if (pthread_mutexattr_setprotocol(&mattr, PTHREAD_PRIO_INHERIT))
+    if (pthread_mutexattr_setprotocol(&attr, PTHREAD_PRIO_INHERIT))
         exit(4);
     if (pthread_mutex_init(&mutex, &attr))
         exit(5);
----------------------------------------------------------------------
And, on a platform that implements pthread_mutexattr_setrobust_np()
(such as Solaris), it would be nice to set pthread mutexes
as the default process lock:

--- configure.in	Sun Jun 18 12:00:00 2006
+++ configure.in	Sun Jun 18 12:00:00 2006
@@ -1637,6 +1637,8 @@
 # POSIX semaphores and cross-process pthread mutexes are not
 # used by default since they have less desirable behaviour when
 # e.g. a process holding the mutex segfaults.
+# But if the system implements pthread_mutexattr_setrobust_np(),
+# it's safe to use cross-process pthread mutexes.
 # The BEOSSEM decision doesn't require any substitutions but is
 # included here to prevent the fcntl() branch being selected
 # from the decision making.
@@ -1647,6 +1649,11 @@
             APR_DECIDE(USE_FCNTL_SERIALIZE, [SVR4-style fcntl()]))
 APR_IFALLYES(func:semget func:semctl define:SEM_UNDO,
             APR_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()]))
+APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl
+             func:pthread_mutexattr_setpshared dnl
+             custom:apr_cv_mutex_robust_shared dnl
+             file:/dev/zero,
+            APR_DECIDE(USE_PROC_PTHREAD_SERIALIZE, [POSIX Thread Mutexes]))
 APR_IFALLYES(header:OS.h func:create_sem, 
             APR_DECIDE(USE_BEOSSEM, [BeOS Semaphores])) 
 if test "x$apr_lock_method" != "x"; then
--- build/apr_hints.m4	Sun Jun 18 12:00:00 2006
+++ build/apr_hints.m4	Sun Jun 18 12:00:00 2006
@@ -234,7 +234,7 @@
     *-solaris2*)
     	PLATOSVERS=`echo $host | sed 's/^.*solaris2.//'`
 	APR_ADDTO(CPPFLAGS, [-DSOLARIS2=$PLATOSVERS -D_POSIX_PTHREAD_SEMANTICS
-D_REENTRANT])
-        APR_SETIFNULL(apr_lock_method, [USE_FCNTL_SERIALIZE])
+        APR_SETIFNULL(apr_lock_method, [USE_PROC_PTHREAD_SERIALIZE])
         # readdir64_r error handling seems broken on Solaris (at least
         # up till 2.8) -- it will return -1 at end-of-directory.
         APR_SETIFNULL(ac_cv_func_readdir64_r, [no])

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 39833] - process locks / pthread robust mutexes

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39833>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39833


jorton@redhat.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Additional Comments From jorton@redhat.com  2006-06-19 10:21 -------
Thanks for the patch; committed to trunk and 1.2.x branch:

http://svn.apache.org/viewvc?rev=415267&view=rev
http://svn.apache.org/viewvc?rev=415268&view=rev

The default choice on Solaris does deliberately avoid use of "robust" mutexes,
see this thread:

http://mail-archives.apache.org/mod_mbox/apr-dev/200406.mbox/%3c20040614104111.GA1964@redhat.com%3e

I'd suggest discussing that issue further on dev@apr.apache.org.


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 39833] - process locks / pthread robust mutexes

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39833>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39833





------- Additional Comments From nazonazo@miobox.jp  2006-06-19 17:39 -------
>I'd suggest discussing that issue further on dev@apr.apache.org.

I had tried to participate the dev@apr ML, but unfortunately rejected:
"spam score (5.2) exceeded threshold"

So, sorry to post here...
----------------------------------------------------------------------
In-Reply-To: <20...@redhat.com>

>[1] supposedly on Solaris, this is solved for pthread mutexes by setting
>the "robust" attribute, but evidence in bugzilla from at least one
>tester was that mod_include segfaults using worker on Solaris could hang
>the server. 

I guess this was caused by the bug (now fixed),
that is, the configure script didn't detect usability of
the robust attribute correctly, so robust mutexes weren't used.
With the fix, robust mutexes will be used and should work.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 39833] - process locks / pthread robust mutexes

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39833>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39833


jorton@redhat.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |CLOSED




------- Additional Comments From jorton@redhat.com  2006-09-08 12:46 -------
The configure check was only broken since APR 1.2.6, the referenced discussion
on "robust" mutexes not being "robust" on Solaris predates 1.2.6 by several years.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org