httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Bug 54311] New: The return error is never checked for inappropriate ThreadStackSize
Date Sun, 16 Dec 2012 03:08:11 GMT

            Bug ID: 54311
           Summary: The return error is never checked for inappropriate
           Product: Apache httpd-2
           Version: 2.4.3
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mpm_event
    Classification: Unclassified

Created attachment 29768
patch to check the return value and print the error setting


In both mpm_event and mpm_worker, the error return of inappropriate
ThreadStackSize setting is not checked and printed out. This brings difficult
to users who wants to set small ThreadStackSize. In my case, I cannot easily
know whether the my setting is accepted or not without any log message.

The code is shown as follows:
if (ap_thread_stacksize != 0) {
    apr_threadattr_stacksize_set(thread_attr, ap_thread_stacksize);

The return value of apr_threadattr_stacksize_set() tells whether the setting is
valid or not. But the current code does not check the return value.

I suggest to add a patch to check the return value and print out an error
message, as follows (the patch is tested).

     if (ap_thread_stacksize != 0) {
-        rv = apr_threadattr_stacksize_set(thread_attr, ap_thread_stacksize);
-        if(rv != APR_SUCCESS) {
-            ap_log_error(APLOG_MARK, APLOG_WARNING | APLOG_STARTUP, 0, NULL,
-                         "WARNING: ThreadStackSize of %ld is inappropriate,
change back to the default", 
-                         ap_thread_stacksize);
-        }
+        apr_threadattr_stacksize_set(thread_attr, ap_thread_stacksize);

The only thing I'm not sure is the APLOGNO. I don't know the rule of the number
assignment. And it seems that adding a log message will break the sequential
APLOGNO series.

You are receiving this mail because:
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message