You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2011/11/16 03:20:33 UTC

DO NOT REPLY [Bug 52191] New: SHM file name for ISAPI Redirector is not unique when multiple ISAPI Redirectors on Website

https://issues.apache.org/bugzilla/show_bug.cgi?id=52191

             Bug #: 52191
           Summary: SHM file name for ISAPI Redirector is not unique when
                    multiple ISAPI Redirectors on Website
           Product: Tomcat Connectors
           Version: 1.2.32
          Platform: PC
        OS/Version: Windows Server 2003
            Status: NEW
          Severity: normal
          Priority: P2
         Component: isapi
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: timw@apache.org
    Classification: Unclassified


The ISAPI Redirector creates a shared memory file unique to the server instance
(a combination of server name, service instance id and application pool id)
that it uses to share information between the redirector DLL instances in each
process making up the server.

When multiple ISAPI Redirectors are installed on a single website, this name is
no longer unique for a logical ISAPI Redirector configuration, and corruption
(or at least incorrect use due to size miscalculations) of the shared memory
results.

The shared memory file name needs to have an additional component added to
refine this scope further. Options are:
1. use the extension_uri configuration option - this should be distinct (and
consistent?) for a logical configuration
2. provide a new configuration option to specify a unique filename component

#1 is the preferred option (as it doesn't involve the user discovering this
issue and finding out how to fix it).

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 52191] SHM file name for ISAPI Redirector is not unique when multiple ISAPI Redirectors on Website

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52191

--- Comment #3 from Tim Whittington <ti...@apache.org> 2011-11-17 23:56:32 UTC ---
> Also could you explain the purpose of having multiple ISAPI redirectors's
installed.

Déjà vu:) From 2005:
https://issues.apache.org/bugzilla/show_bug.cgi?id=35298#c2
I've had second thoughts about that approach since then - maybe in 1.3 we can
look at modularising the configuration ala Apache conf.d directories rather
than adding multiple instances, but it's a long standing feature now...

> We use so many static variables since design presumes we are loaded once per
process

IIS seems to cope fine with loading multiple instances of the same redirector
DLL into the same process. This can be seen if you configure multiple copies
(separate files on disk) of the ISAPI Redirector DLL as ISAPI Filters on a
site, and then inspect inetinfo.exe with something like the Sysinternals
Process Explorer (DLL view).
You can also see it in the debug logs, where the values of the TOMCAT* headers
are uniqued with the DLL handle (in DllMain).

I think the extension URI is the way to go on this one at the moment - within a
site, it will uniquely identify the ISAPI Redirector configuration, and we
already have enough uniqueness in the filename to cover the server/site/app
pool combination.


> I added shmemName now has APP_POOL_ID which should allow more unique name.
Yeah, I noticed that.

OT: I'm not sure whether that adds any uniqueness - in my (Windows 2003/IIS 6)
server, you can only assign a Web Site to an Application Pool (not individual
filters etc.), so the application pool name doesn't seem to add anything to the
site/instance ID? i.e. since a filter is defined on the web site, and a web
site can only be in one application pool, then the site/instance ID uniquely
identifies the process that filter can live in?
I haven't been brave enough to see what happens if the site application pool is
not the same as the extension virtual directory application pool in worker
process isolation mode. I expect it will get confused.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 52191] SHM file name for ISAPI Redirector is not unique when multiple ISAPI Redirectors on Website

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52191

--- Comment #1 from Tim Whittington <ti...@apache.org> 2011-11-16 21:11:54 UTC ---
Created attachment 27960
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=27960
Make shm filename unique based on extension_uri

Attached a patch for option 1, using the extension_uri to unique the filename.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 52191] SHM file name for ISAPI Redirector is not unique when multiple ISAPI Redirectors on Website

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52191

--- Comment #2 from Mladen Turk <mt...@apache.org> 2011-11-17 07:34:49 UTC ---
Have you checked the latest trunk.
I added shmemName now has APP_POOL_ID which should allow more unique name.

Also could you explain the purpose of having multiple ISAPI redirectors's
installed. I mean you can't do that for any of the integral IIS
extensions/filters (or you can do that for FastCGI for example?)

I tend to actually make a logic that would explicitly detect and forbid such
cases instead allowing them. Redirector should be loaded once per IIS instance.
We use so many static variables since design presumes we are loaded once per
process.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 52191] SHM file name for ISAPI Redirector is not unique when multiple ISAPI Redirectors on Website

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52191

Mladen Turk <mt...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #4 from Mladen Turk <mt...@apache.org> 2011-11-18 06:41:57 UTC ---
OK. Committed the patch with minor change.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org