You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Jesse Morris (JIRA)" <ji...@apache.org> on 2009/12/10 02:32:18 UTC

[jira] Created: (DAEMON-131) Win64 build: //DS// fails to delete registry keys

Win64 build:   //DS// fails to delete registry keys
---------------------------------------------------

                 Key: DAEMON-131
                 URL: https://issues.apache.org/jira/browse/DAEMON-131
             Project: Commons Daemon
          Issue Type: Bug
         Environment: Win64; I've only seen it on AMD64, but presumably it would also happen on ia64.
            Reporter: Jesse Morris
            Priority: Minor


When creating and accessing the configuration registry keys, the tool uses CreateRegKeyEx with the KEY_WOW64_32KEY flag, telling windows "Use the 32-bit hive instead of the 64-bit one".  Maybe this was done so that 64-bit daemons could use the configuration from 32-bit ones?  

Anyway when it's time to go and delete the configuration from the registry it uses the ancient SHDeleteKey call, which tries to delete the key from the 64-bit hive, which fails, so the key is left behind.

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


[jira] Closed: (DAEMON-131) Win64 build: //DS// fails to delete registry keys

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

Mladen Turk closed DAEMON-131.
------------------------------

    Resolution: Fixed

Commited. Will be part of 2.0.6 release and next Tomcat versions

> Win64 build:   //DS// fails to delete registry keys
> ---------------------------------------------------
>
>                 Key: DAEMON-131
>                 URL: https://issues.apache.org/jira/browse/DAEMON-131
>             Project: Commons Daemon
>          Issue Type: Bug
>         Environment: Win64; I've only seen it on AMD64, but presumably it would also happen on ia64.
>            Reporter: Jesse Morris
>            Assignee: Mladen Turk
>            Priority: Minor
>         Attachments: procrun-win64-registry-cleanup.patch
>
>
> When creating and accessing the configuration registry keys, the tool uses CreateRegKeyEx with the KEY_WOW64_32KEY flag, telling windows "Use the 32-bit hive instead of the 64-bit one".  Maybe this was done so that 64-bit daemons could use the configuration from 32-bit ones?  
> Anyway when it's time to go and delete the configuration from the registry it uses the ancient SHDeleteKey call, which tries to delete the key from the 64-bit hive, which fails, so the key is left behind.

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


[jira] Commented: (DAEMON-131) Win64 build: //DS// fails to delete registry keys

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

Jesse Morris commented on DAEMON-131:
-------------------------------------

KREG_WOW6432 doesn't come from any standard header.  It's conditionally defined at the top of prunsrv.c.  The reason we need to use that flag for deletion is that KREG_WOW6432 was already specified for the creation and access of the key, presumably so that it can share settings between 32-bit and 64-bit versions of procrun.   Whether *that* makes sense to actually do is another question, which depends largely on how people are using the tool.  I don't really have any insight into that.   

If you were already seeing compilation problems on from it's macro expansion (KEY_WOW64_32KEY) then this is a fine time to fix them.  If it was compiling ok a few days ago, my patch shouldn't break it.

> Win64 build:   //DS// fails to delete registry keys
> ---------------------------------------------------
>
>                 Key: DAEMON-131
>                 URL: https://issues.apache.org/jira/browse/DAEMON-131
>             Project: Commons Daemon
>          Issue Type: Bug
>         Environment: Win64; I've only seen it on AMD64, but presumably it would also happen on ia64.
>            Reporter: Jesse Morris
>            Assignee: Mladen Turk
>            Priority: Minor
>         Attachments: procrun-win64-registry-cleanup.patch
>
>
> When creating and accessing the configuration registry keys, the tool uses CreateRegKeyEx with the KEY_WOW64_32KEY flag, telling windows "Use the 32-bit hive instead of the 64-bit one".  Maybe this was done so that 64-bit daemons could use the configuration from 32-bit ones?  
> Anyway when it's time to go and delete the configuration from the registry it uses the ancient SHDeleteKey call, which tries to delete the key from the 64-bit hive, which fails, so the key is left behind.

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


[jira] Commented: (DAEMON-131) Win64 build: //DS// fails to delete registry keys

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

Mladen Turk commented on DAEMON-131:
------------------------------------

Thanks for the patch. I'll apply it but slightly modified because KREG_WOW6432 is not present for all compilers, so additional #ifdef will be required

> Win64 build:   //DS// fails to delete registry keys
> ---------------------------------------------------
>
>                 Key: DAEMON-131
>                 URL: https://issues.apache.org/jira/browse/DAEMON-131
>             Project: Commons Daemon
>          Issue Type: Bug
>         Environment: Win64; I've only seen it on AMD64, but presumably it would also happen on ia64.
>            Reporter: Jesse Morris
>            Priority: Minor
>         Attachments: procrun-win64-registry-cleanup.patch
>
>
> When creating and accessing the configuration registry keys, the tool uses CreateRegKeyEx with the KEY_WOW64_32KEY flag, telling windows "Use the 32-bit hive instead of the 64-bit one".  Maybe this was done so that 64-bit daemons could use the configuration from 32-bit ones?  
> Anyway when it's time to go and delete the configuration from the registry it uses the ancient SHDeleteKey call, which tries to delete the key from the 64-bit hive, which fails, so the key is left behind.

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


[jira] Updated: (DAEMON-131) Win64 build: //DS// fails to delete registry keys

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

Jesse Morris updated DAEMON-131:
--------------------------------

    Attachment: procrun-win64-registry-cleanup.patch

The registry deletion was being done by SHDeleteKey which doesn't take the flags that let you specifically choose between the 64-bit hive or the 32-bit one.   This patch switches it over to use RegDeleteKey, which just takes whatever key you opened with RegOpenKeyEx.

Tested on a couple versions of windows.  

> Win64 build:   //DS// fails to delete registry keys
> ---------------------------------------------------
>
>                 Key: DAEMON-131
>                 URL: https://issues.apache.org/jira/browse/DAEMON-131
>             Project: Commons Daemon
>          Issue Type: Bug
>         Environment: Win64; I've only seen it on AMD64, but presumably it would also happen on ia64.
>            Reporter: Jesse Morris
>            Priority: Minor
>         Attachments: procrun-win64-registry-cleanup.patch
>
>
> When creating and accessing the configuration registry keys, the tool uses CreateRegKeyEx with the KEY_WOW64_32KEY flag, telling windows "Use the 32-bit hive instead of the 64-bit one".  Maybe this was done so that 64-bit daemons could use the configuration from 32-bit ones?  
> Anyway when it's time to go and delete the configuration from the registry it uses the ancient SHDeleteKey call, which tries to delete the key from the 64-bit hive, which fails, so the key is left behind.

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