Bug 58813 - Incoming requests hang after a website using the ISAPI connector is restarted
Summary: Incoming requests hang after a website using the ISAPI connector is restarted
Alias: None
Product: Tomcat Connectors
Classification: Unclassified
Component: isapi (show other bugs)
Version: 1.2.33
Hardware: PC All
: P2 regression with 20 votes (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
: 59092 59334 (view as bug list)
Depends on:
Reported: 2016-01-06 21:25 UTC by Matthew Reiter
Modified: 2016-09-13 08:15 UTC (History)
2 users (show)


Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Reiter 2016-01-06 21:25:34 UTC
OS: Windows Server 2012 R2 Standard

If isapi_redirect.dll is configured at the website level (rather than globally), when the website is restarted using IIS Manager, the ISAPI redirector is restarted, too. At this point any further HTTP requests will hang until IIS is restarted.

I've traced the problem back to this commit:
commit 2f209a0d25e379b7cb29a9aad74dd71a95471ae5
Author: Mladen Turk <mturk@apache.org>
Date:   Tue Mar 6 12:21:02 2012 +0000

    Use global mutex instead critical section so that multiple instance don't in
it at once in case IIS starts multiple processes

    git-svn-id: https://svn.apache.org/repos/asf/tomcat/jk/trunk@1297439 13f7953

:040000 040000 ac36df68c573630431521b9d616e18234029109c 040c8ea72fdcaedbe0b058c0
596a2448a505d768 M      native

In TerminateFilter (in jk_isapi_plugin.c), ReleaseMutex is being called with the address of the init_cs variable rather than its value, causing init_cs to never be released. As a result, when GetExtensionVersion is subsequently called, it is unable to acquire init_cs and so the plugin never finishes initializing. I was able to confirm that removing the extra "&" fixes the problem.
Comment 1 Matthew Reiter 2016-01-13 23:26:30 UTC
This bug applies to all versions from 1.2.33 to the latest in trunk (1.2.42).
Comment 2 Christian Swoboda 2016-09-09 09:18:42 UTC

I added your patch description to the following silimar bug:

It seems to be the same bug.

Here (again) the details of what should be done:

TerminateFilter (in jk_isapi_plugin.c) 

version 1.2.41 
Line 2424:    ReleaseMutex(&init_cs);

should be:    ReleaseMutex(init_cs);

That's the patch you have tested successfully, right?

kind regards
Comment 3 Matthew Reiter 2016-09-10 00:27:15 UTC
Yes, it is.
Comment 4 Christian Swoboda 2016-09-10 08:46:30 UTC
Thanks a lot for the quick conformation!

I meanwhile found my old Visual C++ 6.0 CD and will build a "custom" version as well, because I can't put the official version into production with this bug!

@Source owner of jk_isapi_plugin.c:
Please, please, please fix this "typo" in the next official version!
Pretty please, with sugar on top?!
Comment 5 Mark Thomas 2016-09-12 19:07:09 UTC
Fixed in trunk for 1.2.42 onwards
Comment 6 Mark Thomas 2016-09-12 19:07:17 UTC
*** Bug 59334 has been marked as a duplicate of this bug. ***
Comment 7 Mark Thomas 2016-09-12 19:07:28 UTC
*** Bug 59092 has been marked as a duplicate of this bug. ***
Comment 8 Christian Swoboda 2016-09-13 08:05:57 UTC

Will there be an official release of 1.2.42 soon?

Thanks a lot
Comment 9 Mark Thomas 2016-09-13 08:15:28 UTC
Good question. It has been over a year since the last release. I'll start a discussion on the dev list.