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 2010/03/24 13:06:27 UTC

[jira] Created: (DAEMON-156) Prunsrv crashes with access violation when stopping service

Prunsrv crashes with access violation when stopping service
-----------------------------------------------------------

                 Key: DAEMON-156
                 URL: https://issues.apache.org/jira/browse/DAEMON-156
             Project: Commons Daemon
          Issue Type: Bug
          Components: Procrun
    Affects Versions: 1.0.2
            Reporter: Sebb


The prunsrv.exe application crashes with an access violation during the final stages of jvm-mode service shutdown, after the service class stop method has been invoked.

To reproduce, use the ProcrunService example, installed using ProcrunServiceInstall; start and then stop the service.
There should be an entry in the Dr Watson directory, and an Application Failed dialogue box will appear.

I don't know yet if the problem also occurs with Java or Exe mode shutdown.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DAEMON-156) Prunsrv crashes with access violation when stopping service

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DAEMON-156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12855734#action_12855734 ] 

Sebb commented on DAEMON-156:
-----------------------------

Further checking shows that prunsrv also misbehaves with Java 1.4.2 and 1.5.

However in these cases, prunsrv does not crash - it does not exit at all.

This can be seen by using prunsrv //TS//service interactively.

When using prunmgr this problem is not seen, I assume because service shutdown forcibly terminates prunsrv if it does not exit.

I think the problem is in javajni.c: __apxJvmDetach but I have not been able to determine why that is failing during shutdown.

> Prunsrv crashes with access violation when stopping service
> -----------------------------------------------------------
>
>                 Key: DAEMON-156
>                 URL: https://issues.apache.org/jira/browse/DAEMON-156
>             Project: Commons Daemon
>          Issue Type: Bug
>          Components: Procrun
>    Affects Versions: 1.0.2
>            Reporter: Sebb
>
> The prunsrv.exe application crashes with an access violation during the final stages of jvm-mode service shutdown, after the service class stop method has been invoked.
> To reproduce, use the ProcrunService example, installed using ProcrunServiceInstall; start and then stop the service.
> There should be an entry in the Dr Watson directory, and an Application Failed dialogue box will appear.
> I don't know yet if the problem also occurs with Java or Exe mode shutdown.

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

        

[jira] Commented: (DAEMON-156) Prunsrv crashes with access violation when stopping service

Posted by "Mladen Turk (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DAEMON-156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12859863#action_12859863 ] 

Mladen Turk commented on DAEMON-156:
------------------------------------

The example application is faulty

Turn on debug logging and you will see:

[2010-04-22 18:04:58] [debug] ( prunsrv.c:1413) Commons Daemon procrun log initialized
[2010-04-22 18:04:58] [info] Commons Daemon procrun (1.0.3.0) started
[2010-04-22 18:04:58] [info] Running 'ProcrunServiceJvm' Service...
[2010-04-22 18:04:58] [debug] ( prunsrv.c:1190) Inside ServiceMain...
[2010-04-22 18:04:58] [info] Starting service...
[2010-04-22 18:04:58] [debug] ( javajni.c:456 ) Jvm Option[0] -Djava.class.path=C:\wrkplace\daemon\trunk\src\samples\ProcrunService.jar
[2010-04-22 18:04:58] [debug] ( javajni.c:665 ) Java Worker thread started ProcrunService:start
[2010-04-22 18:04:58] [debug] ( javajni.c:675 ) Java Worker thread ProcrunService:start finished
[2010-04-22 18:04:58] [debug] ( javajni.c:679 ) Java Worker thread finished ProcrunService:start
[2010-04-22 18:04:59] [debug] ( prunsrv.c:1010) Java started ProcrunService
[2010-04-22 18:04:59] [info] Service started in 1046 ms.
[2010-04-22 18:04:59] [debug] ( prunsrv.c:1297) Waiting for worker to finish...
[2010-04-22 18:04:59] [debug] ( prunsrv.c:1302) Worker finished.
[2010-04-22 18:04:59] [debug] ( prunsrv.c:1325) Waiting for all threads to exit



This means that the procrun reported services as stopped immediately after it was started.
The start() method for procrun MUST not return until stop() has been called.

I agreed that crash is nasty, and should probably be investigated further, but currently it's not a blocker

> Prunsrv crashes with access violation when stopping service
> -----------------------------------------------------------
>
>                 Key: DAEMON-156
>                 URL: https://issues.apache.org/jira/browse/DAEMON-156
>             Project: Commons Daemon
>          Issue Type: Bug
>          Components: Procrun
>    Affects Versions: 1.0.2
>            Reporter: Sebb
>
> The prunsrv.exe application crashes with an access violation during the final stages of jvm-mode service shutdown, after the service class stop method has been invoked.
> To reproduce, use the ProcrunService example, installed using ProcrunServiceInstall; start and then stop the service.
> There should be an entry in the Dr Watson directory, and an Application Failed dialogue box will appear.
> I don't know yet if the problem also occurs with Java or Exe mode shutdown.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DAEMON-156) Prunsrv crashes with access violation when stopping service

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DAEMON-156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850519#action_12850519 ] 

Sebb commented on DAEMON-156:
-----------------------------

The problem does not occur for me with mode=Java (using the newly updated sample ProcrunService class).

> Prunsrv crashes with access violation when stopping service
> -----------------------------------------------------------
>
>                 Key: DAEMON-156
>                 URL: https://issues.apache.org/jira/browse/DAEMON-156
>             Project: Commons Daemon
>          Issue Type: Bug
>          Components: Procrun
>    Affects Versions: 1.0.2
>            Reporter: Sebb
>
> The prunsrv.exe application crashes with an access violation during the final stages of jvm-mode service shutdown, after the service class stop method has been invoked.
> To reproduce, use the ProcrunService example, installed using ProcrunServiceInstall; start and then stop the service.
> There should be an entry in the Dr Watson directory, and an Application Failed dialogue box will appear.
> I don't know yet if the problem also occurs with Java or Exe mode shutdown.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DAEMON-156) Prunsrv crashes with access violation when stopping service

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DAEMON-156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12859983#action_12859983 ] 

Sebb commented on DAEMON-156:
-----------------------------

OK, I will fix the sample application.

Does the "java" mode require the start method to wait or return, or does it not matter whether it waits or not?

> Prunsrv crashes with access violation when stopping service
> -----------------------------------------------------------
>
>                 Key: DAEMON-156
>                 URL: https://issues.apache.org/jira/browse/DAEMON-156
>             Project: Commons Daemon
>          Issue Type: Bug
>          Components: Procrun
>    Affects Versions: 1.0.2
>            Reporter: Sebb
>
> The prunsrv.exe application crashes with an access violation during the final stages of jvm-mode service shutdown, after the service class stop method has been invoked.
> To reproduce, use the ProcrunService example, installed using ProcrunServiceInstall; start and then stop the service.
> There should be an entry in the Dr Watson directory, and an Application Failed dialogue box will appear.
> I don't know yet if the problem also occurs with Java or Exe mode shutdown.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DAEMON-156) Prunsrv crashes with access violation when stopping service

Posted by "Mladen Turk (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DAEMON-156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12860123#action_12860123 ] 

Mladen Turk commented on DAEMON-156:
------------------------------------

java mode uses separate java.exe process so if the process doesn't return (and AFAICT it doesn't)
it's not needed. Anyhow, for the consistency reason, it might be good to unify the stuff.
Procrun just exoect that start method won't return until the application actually terminates.


> Prunsrv crashes with access violation when stopping service
> -----------------------------------------------------------
>
>                 Key: DAEMON-156
>                 URL: https://issues.apache.org/jira/browse/DAEMON-156
>             Project: Commons Daemon
>          Issue Type: Bug
>          Components: Procrun
>    Affects Versions: 1.0.2
>            Reporter: Sebb
>
> The prunsrv.exe application crashes with an access violation during the final stages of jvm-mode service shutdown, after the service class stop method has been invoked.
> To reproduce, use the ProcrunService example, installed using ProcrunServiceInstall; start and then stop the service.
> There should be an entry in the Dr Watson directory, and an Application Failed dialogue box will appear.
> I don't know yet if the problem also occurs with Java or Exe mode shutdown.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DAEMON-156) Prunsrv crashes with access violation when stopping service

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DAEMON-156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12860253#action_12860253 ] 

Sebb commented on DAEMON-156:
-----------------------------

I think it would make more sense to change the behavior of procrun so that the start() method did not need to wait.

That is more in line with standard Java.
Also, the stop() method does not have this restriction.

The changes needed to fix the crash may well mean that the code will then work even if the start() method does return immediately.

In the meantime, as a temporary work-round, I have fixed the sample application and docs.

> Prunsrv crashes with access violation when stopping service
> -----------------------------------------------------------
>
>                 Key: DAEMON-156
>                 URL: https://issues.apache.org/jira/browse/DAEMON-156
>             Project: Commons Daemon
>          Issue Type: Bug
>          Components: Procrun
>    Affects Versions: 1.0.2
>            Reporter: Sebb
>
> The prunsrv.exe application crashes with an access violation during the final stages of jvm-mode service shutdown, after the service class stop method has been invoked.
> To reproduce, use the ProcrunService example, installed using ProcrunServiceInstall; start and then stop the service.
> There should be an entry in the Dr Watson directory, and an Application Failed dialogue box will appear.
> I don't know yet if the problem also occurs with Java or Exe mode shutdown.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (DAEMON-156) Prunsrv crashes with access violation when stopping service

Posted by "Sebb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DAEMON-156?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb resolved DAEMON-156.
-------------------------

    Resolution: Fixed

Yes, I suspect the problem has gone away. If not, I'll re-open later

> Prunsrv crashes with access violation when stopping service
> -----------------------------------------------------------
>
>                 Key: DAEMON-156
>                 URL: https://issues.apache.org/jira/browse/DAEMON-156
>             Project: Commons Daemon
>          Issue Type: Bug
>          Components: Procrun
>    Affects Versions: 1.0.2
>            Reporter: Sebb
>
> The prunsrv.exe application crashes with an access violation during the final stages of jvm-mode service shutdown, after the service class stop method has been invoked.
> To reproduce, use the ProcrunService example, installed using ProcrunServiceInstall; start and then stop the service.
> There should be an entry in the Dr Watson directory, and an Application Failed dialogue box will appear.
> I don't know yet if the problem also occurs with Java or Exe mode shutdown.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DAEMON-156) Prunsrv crashes with access violation when stopping service

Posted by "Mladen Turk (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DAEMON-156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12922983#action_12922983 ] 

Mladen Turk commented on DAEMON-156:
------------------------------------

What's the status of this issue?
I tried the ProcrunService example and it doesn't crash.
I think the original issue is fixed as well by fixing DAEMON-100


> Prunsrv crashes with access violation when stopping service
> -----------------------------------------------------------
>
>                 Key: DAEMON-156
>                 URL: https://issues.apache.org/jira/browse/DAEMON-156
>             Project: Commons Daemon
>          Issue Type: Bug
>          Components: Procrun
>    Affects Versions: 1.0.2
>            Reporter: Sebb
>
> The prunsrv.exe application crashes with an access violation during the final stages of jvm-mode service shutdown, after the service class stop method has been invoked.
> To reproduce, use the ProcrunService example, installed using ProcrunServiceInstall; start and then stop the service.
> There should be an entry in the Dr Watson directory, and an Application Failed dialogue box will appear.
> I don't know yet if the problem also occurs with Java or Exe mode shutdown.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DAEMON-156) Prunsrv crashes with access violation when stopping service

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DAEMON-156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850670#action_12850670 ] 

Sebb commented on DAEMON-156:
-----------------------------

It now appears that the problem only affects Java 1.6; Java 1.4.2 and 1.5.0 work OK for me with the 1.0.3 release candidate

> Prunsrv crashes with access violation when stopping service
> -----------------------------------------------------------
>
>                 Key: DAEMON-156
>                 URL: https://issues.apache.org/jira/browse/DAEMON-156
>             Project: Commons Daemon
>          Issue Type: Bug
>          Components: Procrun
>    Affects Versions: 1.0.2
>            Reporter: Sebb
>
> The prunsrv.exe application crashes with an access violation during the final stages of jvm-mode service shutdown, after the service class stop method has been invoked.
> To reproduce, use the ProcrunService example, installed using ProcrunServiceInstall; start and then stop the service.
> There should be an entry in the Dr Watson directory, and an Application Failed dialogue box will appear.
> I don't know yet if the problem also occurs with Java or Exe mode shutdown.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DAEMON-156) Prunsrv crashes with access violation when stopping service

Posted by "Mladen Turk (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DAEMON-156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12860258#action_12860258 ] 

Mladen Turk commented on DAEMON-156:
------------------------------------

Programs that use procrun depend on the fact that start() should not return
until it has to shutdown the JVM.
Changing that behavior would mean that existing programs wold have serious
problems on shutdown.



> Prunsrv crashes with access violation when stopping service
> -----------------------------------------------------------
>
>                 Key: DAEMON-156
>                 URL: https://issues.apache.org/jira/browse/DAEMON-156
>             Project: Commons Daemon
>          Issue Type: Bug
>          Components: Procrun
>    Affects Versions: 1.0.2
>            Reporter: Sebb
>
> The prunsrv.exe application crashes with an access violation during the final stages of jvm-mode service shutdown, after the service class stop method has been invoked.
> To reproduce, use the ProcrunService example, installed using ProcrunServiceInstall; start and then stop the service.
> There should be an entry in the Dr Watson directory, and an Application Failed dialogue box will appear.
> I don't know yet if the problem also occurs with Java or Exe mode shutdown.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.