Out of Stack Space

This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-Tools SDK of Library DLL functions(only) - Please use the PDF-XChange Drivers API SDK Forum for assistance with all PDF Print Driver related topics.

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Chris - Tracker Supp, Tracker Supp-Stefan, Ivan - Tracker Software, Andrew - Tracker Support, Tracker - Clarion Support, John - Tracker Supp, Support Staff, moderators

Post Reply
dblwizard
User
Posts: 43
Joined: Fri May 20, 2005 5:39 pm
Location: Conifer, CO USA

Out of Stack Space

Post by dblwizard » Tue May 31, 2005 1:04 am

Hello,

I have written a COM DLL in VB6 that wraps your PXC functions with a GetPDF() filename. This project works fine on my development box, Win2003 Server, but when I put it up on my production server I am getting an "Out of stack space" error.

The only message that was applicable on this forum was one where the developer adjusted his Stack space in the project. I don't have that option in VB6.

I am attempting to process the same Tiff file to PDF on the production server that I am doing on the development server so memory footprint should be the same.

I originally thought this was something to do with the way the files were installed on the production server but I have installed the SDK on the server and am still having the same problem.

Thanks

dbl

dblwizard
User
Posts: 43
Joined: Fri May 20, 2005 5:39 pm
Location: Conifer, CO USA

Post by dblwizard » Tue May 31, 2005 1:48 am

I should have metioned in the previous post that the problem occurs on the PXC_PlaceImage. Here is the code for you to see. The error occurs on Line 90.

On Error GoTo errHandler

Const appMethodName = "GetPDF"

Dim abtBuffer() As Byte

Dim lDPIX As Long
Dim lDPIY As Long
Dim lpImage As Long
Dim lpPage As Long
Dim lpPDF As Long
Dim lRC As Long
Dim lStreamLength As Long

Dim dImageWidth As Double
Dim dImageHeight As Double
Dim dPageWidth As Double
Dim dPageHeight As Double
Dim dPositionX As Double
Dim dPositionY As Double

Dim objStream As olelib.IStream
Dim objStreamStat As olelib.STATSTG

10 lRC = PXC_NewDocument(lpPDF, "My Key", "My Key")

If (IS_DS_FAILED(lRC)) Then
Set GetPDF = Nothing
Exit Function
End If

20 Call PXC_EnableLinkAnalyzer(lpPDF, True)
30 Call PXC_SetCompression(lpPDF, False, False, ComprType_C_Auto, 75, _
ComprType_I_Auto, ComprType_M_Auto)


40 lRC = PXC_AddImageExA(lpPDF, sFileNameA, 0, 0)

If (IS_DS_FAILED(lRC)) Then
Set GetPDF = Nothing
Exit Function
End If

If (lRC <> 0) Then
50 lRC = PXC_AddImageA(lpPDF, sFileNameA, lpImage)

If (IS_DS_FAILED(lRC)) Then
Set GetPDF = Nothing
Exit Function
End If

60 lRC = PXC_GetImageDimension(lpPDF, lpImage, dImageWidth, dImageHeight)
UpdateLog appModuleName & ":" & appMethodName & " Logging - lpPDF=" & lpPDF & "* lpImage=" & lpImage & "* dImageWidth=" & dImageWidth & "* dImageHeight=" & dImageHeight, Logging

If (IS_DS_FAILED(lRC)) Then
Set GetPDF = Nothing
Exit Function
End If


70 lRC = PXC_GetImageDPI(lpPDF, lpImage, lDPIX, lDPIY)
UpdateLog appModuleName & ":" & appMethodName & " Logging - lpPDF=" & lpPDF & "* lpImage=" & lpImage & "* lDPIX= " & lDPIX & "* lDPIY=" & lDPIY, Logging


dPositionX = I2L(0)
dPositionY = I2L(dImageHeight / lDPIY)
dPageWidth = I2L(dImageWidth / lDPIX)
dPageHeight = I2L(dImageHeight / lDPIY)

80 Call MakeProportionalSize(dPageWidth, dPageHeight, dImageWidth, dImageHeight)
85 lRC = PXC_AddPage(lpPDF, dPageWidth, dPageHeight, lpPage)

If (IS_DS_FAILED(lRC)) Then
Set GetPDF = Nothing
Exit Function
End If

UpdateLog appModuleName & ":" & appMethodName & " Logging - lpPage=" & lpPage & "* lpImage=" & lpImage & "* dPositionX=" & dPositionX & "* dPositionY=" & dPositionY & "* dPageWidth=" & dPageWidth & "* dPageHeight=" & dPageHeight, Logging
90 lRC = PXC_PlaceImage(lpPage, lpImage, dPositionX, dPositionY, dPageWidth, dPageHeight)

If (IS_DS_FAILED(lRC)) Then
Set GetPDF = Nothing
Exit Function
End If

100 lRC = PXC_CloseImage(lpPDF, lpImage)

101 Set objStream = CreateStreamOnHGlobal(0, 0)
102 lRC = PXC_WriteDocumentToIStream(lpPDF, objStream)
103 PXC_ReleaseDocument (lpPDF)

104 Debug.Print "stream opened"
105 Call objStream.Stat(objStreamStat)
106 lStreamLength = CLng(objStreamStat.cbSize * 10000)
107 ReDim abtBuffer(lStreamLength + 2)
108 objStream.Seek 0, STREAM_SEEK_SET
109 lRC = objStream.Read(abtBuffer(0), lStreamLength)
110 Set objStream = Nothing

GetPDF = abtBuffer
End If

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Tue May 31, 2005 12:20 pm

Hi,

can you please test with another compression type ( line 30 of your code) and advise if there are issues with all compression types or just some.

thanks
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

dblwizard
User
Posts: 43
Joined: Fri May 20, 2005 5:39 pm
Location: Conifer, CO USA

Post by dblwizard » Tue May 31, 2005 2:46 pm

I changed the Compression line to look like this:

Call PXC_SetCompression(lPDF, False, False, ComprType_C_NoCompress, 100, _
ComprType_I_NoCompress, ComprType_M_NoCompress)

And I still get the error. Also I copied your VBExamp.exe over along with all the dll's from the bin directory and it seems to work fine. Not sure what that tells ya but thought I would let you know.

Don't know if it will help or not but in the Event Log the following error is logged:

Faulting application dllhost.exe, version 5.2.3790.0, faulting module pxclib30.dll, version 3.4.0.80, fault address 0x0004c405.


Thanks

dbl
Last edited by dblwizard on Tue May 31, 2005 3:08 pm, edited 1 time in total.

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Tue May 31, 2005 3:08 pm

Hi,

seems VB is not setting sufficient Stack space - can you please try and increase this.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

dblwizard
User
Posts: 43
Joined: Fri May 20, 2005 5:39 pm
Location: Conifer, CO USA

Post by dblwizard » Tue May 31, 2005 4:20 pm

To my knowledge there is no way to adjust the stack size in VB. But again this doesn't explain why it works fine on one machine and then not on another. Remeber this is processesing the same Tif file into a PDF.

Any ideas on how to accomplish this?

Thanks

dbl

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Tue May 31, 2005 4:43 pm

Then there has to be something different about the set up of the server - or possibly your VB DLL's on the Server with the issue.

Can you confrim that these are the same (release) as those on your development machine with which you compiled your app?

Are our DLL's all with your app in the same folder and your VB DLL's ?

Also any differences in the server configuration/resources etc ?
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

dblwizard
User
Posts: 43
Joined: Fri May 20, 2005 5:39 pm
Location: Conifer, CO USA

Post by dblwizard » Tue May 31, 2005 5:24 pm

I have gone to windowsupdate and updated both servers to the most recent.

I only have one DLL and it is in the same directory as all your dlls.

I have even moved the Dims of the Byte array and the Stream object to the module level becuase as I understand it VB has 20K stack size. But that didn't help either.

My Dev OS is 2003 Enterprises Edition the Production OS is 2003 Web Edition.

Using Depends.exe I have checked all the Early binding dependencies and can not find anything that is way off. I did find ComCtl32.dll that was a little version different but the it was only an hour or so diff in date and the product version was the right one but file version was actually one newer.

Im at a loss. Do you have any kind of logging that might help us track down where the problem is?

Also one other thing. I get a COM Surrogate Error with pxclib30.dll when the server is restarted now. Rember I have installed the SDK on this machine. Here is the signature:

szAppName : dllhost.exe szAppVer : 5.2.3790.0 szModName : pxclib30.dll
szModVer : 3.4.0.80 offset : 0004c405

Thanks

dbl

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Wed Jun 01, 2005 7:37 am

Hi,

My point about checking DLL's was in relation to your VB Run time DLL's- can you confrim these are identical on both machines.

With regards this :

"Also one other thing. I get a COM Surrogate Error with pxclib30.dll when the server is restarted now. Rember I have installed the SDK on this machine. Here is the signature: "

Pxclib30 does not use 'COM' - but I note you have written a 'COM' wrapper for the functions of pxclib30 - this would seem to suggest that the problem traces back to this - though it is hard as you will appreciate to work blindly like this.

Perhaps it would be an idea if your 'zipped' up your exe and all required dll's and let us take a look and run here - see if we can replicate.

Please send some 'idiot' proof instructions giving a step by step guide to install and use - with any required additional files we may need to actually use and run.

thanks.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

dblwizard
User
Posts: 43
Joined: Fri May 20, 2005 5:39 pm
Location: Conifer, CO USA

Post by dblwizard » Wed Jun 01, 2005 1:26 pm

I am setting up a barebones 2003 Standard Edition Website to see if I can make a simple example that replicates the problem. I will let you know as soon as I get that done.

Thanks

dbl

dblwizard
User
Posts: 43
Joined: Fri May 20, 2005 5:39 pm
Location: Conifer, CO USA

Post by dblwizard » Wed Jun 01, 2005 2:42 pm

Ok,

I set up a 2003 Standard Edition server and installed the PDFLibTest component into a plane COM+ package. This just allows for easier configuing of security permissions.

I then used the test.asp page to attempt to display 22820001.tif. When you try to display test.asp in a browser it will be blank and there will be an error in the application event log.

To be able to compile the project you will need to regtlib the oletlib.tlb to be able to compile the project. This is the typelib that gets me access to the IStream object.

Let me know if there is anything else I can do.

Thanks

dbl
Attachments
PDFLibTest.zip
(1.34 MiB) Downloaded 115 times

dblwizard
User
Posts: 43
Joined: Fri May 20, 2005 5:39 pm
Location: Conifer, CO USA

Post by dblwizard » Fri Jun 03, 2005 1:07 pm

Have you had any success with replicating the problem? Is there anything that I didn't provide in the sample program?

Thanks

dbl

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Tue Jun 07, 2005 7:36 am

Please download Build 3.4082 - some changes have been made which may help in this matter.

If the issue still exists - I think we are going to need you to upload your app as an exe to your server so we can attempt to debug - this issue appears to be only present when run as ASP/ASP.Net
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

dblwizard
User
Posts: 43
Joined: Fri May 20, 2005 5:39 pm
Location: Conifer, CO USA

Post by dblwizard » Tue Jun 07, 2005 3:13 pm

Downloaded the more recent version and still get the same basic result. Here is the Event Log Entries info after running a page.

Faulting application dllhost.exe, version 5.2.3790.0, faulting module pxclib30.dll, version 3.4.0.80, fault address 0x0004c405.


The serious nature of this error has caused the process to terminate.
Exception: C0000005
Address: 0x021CC405
Call Stack:
pxclib30!PXC_Add3DAnnotationA + 0x5e05

Its a little different than the previous error but the result is the same.

Let me know what you need.

Thanks

dbl

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Wed Jun 08, 2005 6:57 am

Hi,

Is there any way we can get full read/write access to this server to allow us to get to the bottom of this and test/debug - as you know if we install locally the issue is not apparent and we really would like to get this resolved as I am sure you would.

If so - please send the required info to userfiles@tracker-software.com

Many thanks
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

dblwizard
User
Posts: 43
Joined: Fri May 20, 2005 5:39 pm
Location: Conifer, CO USA

Post by dblwizard » Fri Jun 10, 2005 5:10 am

John,

I am not sure what kind of access you are wanting. I can have complete access to the server but I can't give "you" access.

Also I replicated this with a simple 2003 Server installation and putting a page in the rooot of the default website and then creating a COM + application to register the DLL. The production server is located in the Eastern Time zone so I will be glad to work with you directly if you will give me a heads up so I can be prepared.

Thanks

dbl

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Mon Jun 13, 2005 8:25 am

Hi,

Please contact us direct and lets try and arrange a live conversation - I should also let you know that over the weekend we set up a server using VM Ware here and still could not reproduce this.

Please email usrfiles@tracker-software.com to further this.

thanks
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Mon Jun 20, 2005 6:33 am

Problem solved,

DLL's located in both local exe and \system32 folder - but only one set updated - so old dll's being used.

A good reason not to use \system32 folder - we reccomend all users use the folder only where their application exe is located to place our DLL's.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

Post Reply