commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <>
Subject [jira] [Commented] (DAEMON-252) [procrun] Thread Dump command fails with "Unable to open the Event Mutex"
Date Fri, 15 Jun 2012 14:00:51 GMT


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

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

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:

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

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:
>             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:
> To reproduce:
> 1. Install Tomcat 7.0.27. It contains Commons Daemon procrun
> 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
> 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|]

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message