You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Claudio Cicali <c....@mclink.it> on 2000/12/01 10:52:14 UTC

apache-api/6917: couldn't get any error code while apache refused to start itself when it failed to load a module

>Number:         6917
>Category:       apache-api
>Synopsis:       couldn't get any error code while apache refused to start itself when it failed to load a module
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    apache
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Fri Dec 01 02:00:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     c.cicali@mclink.it
>Release:        1.3.14
>Organization:
apache
>Environment:
Windows NT 4 SP6a
>Description:
Im working on a module for Apache for Windows NT and, while
trying to have the job done, I discovered a (little) bug in the
source file util_win32.c.

Bug description:
I couldn't get any error code while apache refused to start itself
up, being unable to load my module.
The module itself loads up another DLL. This load is not performed via the
LoadLibrary Windows API function, but using the __declspec(dllimport)
feature, linking the module against the .lib the comes out after the
building of the (second) DLL.

Bug discover and trapped !
The problem is in the function ap_os_dso_error(). It simply lacks
of the inizialization of the variable "len".

>How-To-Repeat:

>Fix:
So, where I read:
   
    nErrorCode = GetLastError();
    len = ap_snprintf(errstr, sizeof(errstr) - len, "(%d) ", nErrorCode);

I'll read:

    nErrorCode = GetLastError();
    len = 0;
    len = ap_snprintf(errstr, sizeof(errstr) - len, "(%d) ", nErrorCode);

In this way the error is correctly displayed.
>Release-Note:
>Audit-Trail:
>Unformatted:
 [In order for any reply to be added to the PR database, you need]
 [to include <ap...@Apache.Org> in the Cc line and make sure the]
 [subject line starts with the report component and number, with ]
 [or without any 'Re:' prefixes (such as "general/1098:" or      ]
 ["Re: general/1098:").  If the subject doesn't match this       ]
 [pattern, your message will be misfiled and ignored.  The       ]
 ["apbugs" address is not added to the Cc line of messages from  ]
 [the database automatically because of the potential for mail   ]
 [loops.  If you do not include this Cc, your reply may be ig-   ]
 [nored unless you are responding to an explicit request from a  ]
 [developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]