You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2012/06/15 16:00:51 UTC

[jira] [Commented] (DAEMON-252) [procrun] Thread Dump command fails with "Unable to open the Event Mutex"

    [ https://issues.apache.org/jira/browse/DAEMON-252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13295665#comment-13295665 ] 

Sebb commented on DAEMON-252:
-----------------------------

It looks like the thread Dump uses the the following method to implement the function:

prunmgr.c:static void signalService(LPCWSTR szServiceName)

This creates the String en="Global\\<szServiceName>SIGNAL" which it then processes as follows:

{code}
for (i = 7; i < lstrlenW(en); i++) {
    if (en[i] >= L'a' && en[i] <= L'z')
        en[i] = en[i] - 32;
}
{code}

i.e. it (crudely) converts the service name to UPPER case.

The event is then created from the transformed name.


As far as I can tell, the event is created in the following method:

prunsrv.c:void WINAPI serviceMain(DWORD argc, LPTSTR *argv)

This generates the same basic event name, but then processes it as follows:

{code}
for (i = 7; i < lstrlenW(en); i++) {
    en[i] = towlower(en[i]);
}
{code}

i.e. it converts the service name (and "SIGNAL" suffix) part of the event name to lower case.

This could explain why the event is not found.

Not sure why the service name case needs to be changed at all; perhaps the conversion could be dropped in both cases?

Or if the case does need to be changed, the same transformation should be used in both cases.
Also, the transformation should probably only be applied to the service name (and not the "SIGNAL" suffix).

                
> [procrun] Thread Dump command fails with "Unable to open the Event Mutex"
> -------------------------------------------------------------------------
>
>                 Key: DAEMON-252
>                 URL: https://issues.apache.org/jira/browse/DAEMON-252
>             Project: Commons Daemon
>          Issue Type: Bug
>          Components: Procrun
>    Affects Versions: 1.0.10
>         Environment: Windows 7 SP1, Windows XP SP3
>            Reporter: Konstantin Kolinko
>            Priority: Minor
>
> The issue was reported on users<at>tomcat.a.o. I've confirmed that it is reproducible.
> The thread:
> http://tomcat.markmail.org/thread/r74penaeymdmeeic
> http://marc.info/?t=133839294900003&r=1&w=2
> To reproduce:
> 1. Install Tomcat 7.0.27. It contains Commons Daemon procrun 1.0.10.0.
> I tested with 32-bit versions on Windows 7 and Windows XP.
> 2. Start the service and service monitor application. The latter has to be run as administrator under Windows 7.
> 3. Right-click tray icon and select "Thread Dump" from popup menu.
> 4. A message box appears:
> ---------------------------
> Application System Error
> ---------------------------
> Не удается найти указанный файл.
> Unable to open the Event Mutex
> ---------------------------
> ОК   
> ---------------------------
> The first line of the message comes from OS and means "The system can not find the file specified."
> Enabling debug logging does not provide any additional information. The issue is reproducible under Windows XP, so UAC is not involved.
> According to the original reporter a workaround is use the "jstack" utility that comes with JDK. Other recipes can be found in [Tomcat FAQ|http://wiki.apache.org/tomcat/HowTo#How_do_I_obtain_a_thread_dump_of_my_running_webapp_.3F]

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira