Planet PDF Forum Archive

Planet PDF ForumWowsers! This is page is old, head to the LIVE Planet PDF Forum. It features more than 10 conferences, covering everything from beginner to in-depth developer and pre-press discussions. If you wish to continue... one & two archive covers 1999-2011 (160,000 pages).

New Forum | Previous | Next | (P-PDF) Developers

Topic: FYI: FdfTk.dll has a bug -- Any revisions planned?
Conf: (P-PDF) Developers, Msg: 87206
From: gmanship
Date: 5/7/2003 02:14 PM

The bug in this dll was found with IISState (see below). Are there any revisions planned?

Reply from microsoft.public.inetserver.iis:

Basically what has happened is c:\winnt\webforms\FdfTk.dll has 'leaked' a
critical section. This means that any ASP page that ultimately calls into
it will hang until the hosting process (DLLHost) is restarted (see below for
the explanation).

Since this was created with the 'new and improved' IISState, I am going to
be pointing out a few of the changes as we go through the analysis.

When I debug problems like this, I like to start from the bottom and work my
way up. You can start from the top, but this works for me. The first
thread that I encountered that was 'interesting' was (read threads from the
bottom to the top):

Thread ID: 24
System Thread ID: d48 <--This thread's ID
Kernel Time: 0:0:18.93
User Time: 0:1:22.171 <--Used 1min 22.171 sec of CPU time (new format)
Thread Status: Thread is in a WAIT state.
Other information: Thread is waiting for a lock to be released. Looking for
lock owner. <--See below for lock info (new)
Owning thread System ID: 7c4 <--Owner of the lock (new)
Thread Type: ASP

# ChildEBP RetAddr
00 021aeaac 77f85c55 ntdll!NtWaitForSingleObject+0xb <--Wait INFINITE for
the lock to release
01 021aeb20 77f85bd1 ntdll!RtlpWaitForCriticalSection+0x9e
02 021aeb28 04e35014 ntdll!RtlEnterCriticalSection+0x46 <--Attempt to get a
lock that is controlled by FdfAcX.dll
03 021aefa8 10001858 FdfTk!FDFOpen+0x164 <--Suspect dll (proof comes later)
04 021af0e0 779d7b9d FdfAcX!DllUnregisterServer+0x7b8
05 021af10c 77a22c42 OLEAUT32!DispCallFunc+0x15d
06 021af19c 1000510c OLEAUT32!CTypeInfo2::Invoke+0x244
07 021af1cc 10001326 FdfAcX!DllUnregisterServer+0x406c
08 021af1f8 6b614279 FdfAcX!DllUnregisterServer+0x286 <--FDF COM object
called from page
09 021af274 6b61866f vbscript!DllCanUnloadNow+0x8e24 <--ASP page running
0a 021af954 00000000 vbscript!DllCanUnloadNow+0xd21a

So, we have an ASP page that has called into FdfAcX.dll which in turn called
into FdfTk.dll. FdfTK.dll has code in it that locks a particular section.
This lock is owned by thread 7c4. Next step is to locate the owner.

The owner is:

Thread ID: 22
System Thread ID: 7c4 <--System thread ID from above
Kernel Time: 0:0:16.515
User Time: 0:1:46.375
Thread Status: Thread is in a WAIT state.
Thread Type: Idle ASP thread <--IDLE ASP thread. Uh oh. Where did the
FdfTk.dll go? See below.
# ChildEBP RetAddr
00 0212fe28 77ea9d00 ntdll!NtWaitForMultipleObjects+0xb
01 0212fe78 77e1e97b KERNEL32!WaitForMultipleObjectsEx+0xea
02 0212fed4 77e1e9c8 USER32!MsgWaitForMultipleObjectsEx+0x153
03 0212fef0 787c1e23 USER32!MsgWaitForMultipleObjects+0x1d
04 0212ff1c 787c1219 COMSVCS!STAThread::WaitForWork+0x65
05 0212ffb4 77e8b2d8 COMSVCS!STAThread::STAThreadWorker+0x4d1
06 0212ffec 00000000 KERNEL32!BaseThreadStart+0x52

This ASP thread has completed work and is now just sitting waiting for work
to do. It does not think that it owns a lock and certainly is not about to
release one. So, the Critical Section (lock) has been leaked. What we
should have seen is FdfTk.dll on this thread doing work, but since it is
gone, the lock has been leaked.

How does a lock get leaked?

A very common way is:

void Foo()
EnterCriticalSection(&cs); //Go into the lock.

LeaveCriticalSection(&cs); //Release the lock
return Error; //BUG if an exception occurs in the the
LeaveCriticalSection is never called and the lock is leaked.
return ok;

Other common ways are variations on this theme where the
LeaveCriticalSection is not called b/c if() logic precludes calling it, etc.

The long and short is that the dll has a bug and you will need to ping the
dev or vendor to get a fix. If we had the symbols for the dll we could tell
where the lock is called in the dll and possibly speed the fix along.


PS> For more info on EnterCriticalSection/LeaveCriticalSection see MSDN.

Original Message:

> Hello,
> My web page seems to hang when fdf data is submitted via a pdf form
> Any direction would be appreciated. Attached is the log. Thanks in
> advance.
> Greg

PDF In-Depth Free Product Trials Ubiquitous PDF

Debenu Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link...

Download free demo

Debenu PDF Tools Pro

It's simple to use and will let you preview and edit PDF files, it's a Windows application that makes...

Download free demo

Five visions of a PDF Day

In the world of PDFs or as we like to say Planet (of) PDF, a year isn't a real PDF year without an intense few days of industry knowledge sharing.

May 15, 2018
Platinum Sponsor

Search Planet PDF
more searching options...
Planet PDF Newsletter
Most Popular Articles
Featured Product

Debenu PDF Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link control. Take Acrobat to the next level.


Adding a PDF Stamp Comment

OK, so you want to stamp your document. Maybe you need to give reviewers some advice about the document's status or sensitivity. This tip from author Ted Padova demonstrates how to add stamps with the Stamp Tool along with related comments.