ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  ChartDirector - Sporadic IIS 7.5 issues
Posted by Trish on Feb-02-2012 04:41
I recently upgraded from IIS 6 to IIS 7.5.  I am able to run the chart director most of the time without an issue.  However, the ChartDirector sporadically throws the following errors:

COMException: Error converting object pointer to type class Layer *
COMException: Error converting object pointer to type class Axis *

Usually, the issue fixes itself.  However, I have had the issue last for several minutes.  Do you have any ideas why it would work and then start generating the errors above and then start working again.

Thanks for any help!
trish

  Re: ChartDirector - Sporadic IIS 7.5 issues
Posted by Peter Kwan on Feb-03-2012 01:21
Hi Trish,

The "Error converting object pointer to type class Layer *" error means that the ChartDirector believes the code is calling a method of the "Layer" object, but object reference provided is not that of a "Layer" object or its subclass.

I am not sure why the errors sporadically happen and then fixes itself. Are you using a 64-bit Windows server? In a 64-bit server, the OS would create the chart objects out of process (that is, in a separate process space), and may reuse the objects. I suspect the problem may be related to this reuse of objects.

Normally, each time the ASP code creates an object (using CreateObject), a new object is created. When the object is no longer referenced, it will be deleted. If the OS decides not to actually delete the object but to reuse it, but the object for some reasons is corrupted, the error would occur. But the OS may reuse the object only for a limited time, then it would create a brand new object. So the error disappears after some time.

Anyway, may be you can try the following update "chartdir50.dll" to see if there is any improvement:

http://www.advsofteng.com/cd_win32_503p4.zip

Recently, we have discovered that "in theory", some of our code related to converting objects from the script interface can potentially corrupt the conversion table. It is "in theory" because we can never actually produce the problem. But in any case, we have rewritten the code to avoid the uncertainty, and this is the attached updated "chartdir50.dll".

Regards
Peter Kwan

  Re: ChartDirector - Sporadic IIS 7.5 issues
Posted by Trish on Feb-03-2012 13:17
Thanks so much.  Yes, we are using this on a 64 bit machine.  I will install the new dll.  Thanks so much for your speedy response.

trish

  Re: ChartDirector - Sporadic IIS 7.5 issues
Posted by Trish on Feb-07-2012 23:14
Unfortunately, upgrading to the later version of the chart director did not solve the problem.  This time the error was:  "Error converting object pointer to type class Axis *"

The issue gets fixed if I recycle the IIS 7.5 Application Pools.  I ran for two days with no issues, then yesterday I received repeated errors until the Application Pool was recycled.  Do you have any other ideas?

Thanks!
trish

  Re: ChartDirector - Sporadic IIS 7.5 issues
Posted by Peter Kwan on Feb-08-2012 04:44
Hi Trish,

The object pointer is stored in a property "ptr" of every ChartDirector object. To diagnose the problem, getting its value would be useful. Normally, we would suggest people to include it in the chart title, so we can see it. But in your case, the code dies before it can create any output. So I think the best way is to store the result in a file.

You mentioned that once the problem occurs, it occurs until the Application Pool resets. If the error once occurs, occurs to all scripts, then you may create a simple test script and run it when the error occurs. The test script can be based on the "Simple Bar Chart" sample code:

<%@ language="vbscript" %>
<%
Set cd = CreateObject("ChartDirector.API")

data = Array(85, 156, 179.5, 211, 123)
labels = Array("Mon", "Tue", "Wed", "Thu", "Fri")

Set c = cd.XYChart(250, 250)
Call c.setPlotArea(30, 20, 200, 200)
Call c.addBarLayer(data)

Set a = c.xAxis()

Set filesys = CreateObject("Scripting.FileSystemObject")
Set filetxt = filesys.OpenTextFile("c:\\somefile.txt", 8, True)
filetxt.WriteLine("[" & a.ptr & "]")
filetxt.Close

Call a.setLabels(labels)

Response.ContentType = "image/png"
Response.BinaryWrite c.makeChart2(cd.PNG)
Response.End
%>

If the error "Error converting object pointer to type class Axis *" does occur on the above script, it should occur on the line "Call a.setLabels(labels)". Right before the line, I use the FileSystemObject to save the object pointer "ptr" to a text file "c:\\somefile.txt". Please replace the directory to the directory of your choice, and make sure the IIS can write to that directory (using the special account the represents the "anonymous user"). You can try the above script a few times for testing. If it runs normally, you should see some lines in "c:\\somefile.txt" showing some values like "[$$pointer$$class Axis *@236f73c]". I suspect the error is because the value is corrupted for some reasons, and no longer looks like a "class Axis *" pointer, so ChartDirector returns the error. Seeing how it is corrupted may give us a cue on the possible cause of the problem.

So far, I have not seen your charting code. Is it possible to inform me of the charting part of the code to me? You may email me at pkwan@advsofteng.net

Regards
Peter Kwan

  Re: ChartDirector - Sporadic IIS 7.5 issues
Posted by Trish on Feb-09-2012 09:07
Okay, the issue occurred again this evening.  The contents of the file are below.  The chart displayed successfully for every pointer reference that started with @3.  We received an error for all the attempts when the pointer reference started with @93ff0.  Again, the issue was fixed by recycling the Application Pool.

[$$pointer$$class Axis *@35e9c5f0]
[$$pointer$$class Axis *@93ff0c18]
[$$pointer$$class Axis *@93ff0060]
[$$pointer$$class Axis *@93ff0c18]
[$$pointer$$class Axis *@93ff0060]
[$$pointer$$class Axis *@93ff0c18]
[$$pointer$$class Axis *@93ff0c18]
[$$pointer$$class Axis *@93ff0060]
[$$pointer$$class Axis *@31171668]
[$$pointer$$class Axis *@31171290]
[$$pointer$$class Axis *@31176420]

  Re: ChartDirector - Sporadic IIS 7.5 issues
Posted by Peter Kwan on Feb-10-2012 02:05
Hi Trish,

Thanks a lot for the information. They are very useful to us. It narrows down to where we search for the issue significantly.

We are suspecting the issue may be related to using 32-bit component on a 64-bit machine, and the 32-bit component is loaded above the 2G virtual address space (above x80000000).

For 32-bit Windows, normally, the "virtual address space" for a user program should not 2G. (On 32-bit Windows, the virtual address space 0 - 2G is for user programs, and 2G - 4G is for the OS). So it is uncommon to find user code using addresses higher than 0x7fffffff. We would expect if a 32-bit component is used on 64-bit Windows, the 32-bit component should be loaded below the 2G virtual address space, but it appears not to be the case in your servers. We have done some testing ourselves, but we are unable to force Windows to load our component above the 2G limit, so we are unable to reproduce the issue.

ChartDirector code should be able to handle much larger range of addresses (that's why we can have 64-bit edition of ChartDirector). We are suspecting may be our old 32-bit compilation tool chain generates code that may not work above 2G space. We have just recompiled the ChartDirector DLL "chartdir50.dll" using a much more recent compliation tool chain that we usually use to compile 64-bit code. If our suspicion is correct, the new version should solve the problem. The new version is at:

http://www.advsofteng.com/cd_win32_503p6.zip

Please kindly let me know if this can address the issue.

Regards
Peter Kwan

  Re: ChartDirector - Sporadic IIS 7.5 issues
Posted by Trish on Feb-10-2012 04:06
Thanks so much.  I'll give it a try.  I really appreciate your responsiveness.  You have been extremely helpful.

Trish

  Re: ChartDirector - Sporadic IIS 7.5 issues
Posted by Trish on Feb-11-2012 04:20
Okay, I get an error now when I try to use the new DLL.  Do I need to update any of the other DLLs I registered for ChartDirector.

I have the following files on the server:

aspapi.dll
chardir50.dll
comchartdir.dll

I get the following error:

System.Runtime.InteropServices.COMException (0x800AEA5F): Unknown runtime error

Thanks for your help!

trish

  Re: ChartDirector - Sporadic IIS 7.5 issues
Posted by Peter Kwan on Feb-14-2012 01:01
Hi Trish,

I am not sure if you need to "unblock" any downloaded DLL. (In my case, it works even without unblocking.) You may right click on the "chartdir50.dll", select Properties, and it should include an "Unblock" button because ther DLL is downloaded from the Internet. Please check that the file size is 2359296 bytes. Please press the "Unblock" button and then press OK.

Also, you may want to revert back to the earlier "chartdir50.dll" to make sure it works with that DLL, and only fails with the new "chartdir50.dll".

In my test, I do not need to re-register the DLL. To re-register the DLLs, please make sure the following 3 files are in the same directory as the 3 DLLs. (They should be in the original ChartDirector distribution in the same directory as the DLLs, typically in "c:\\Program Files (x86)\\ChartDirector\\lib".) Then click "regdll.bat". This should register the DLLs. A pop window should appear showing the ChartDirector version if it can load ChartDirector successfully.

cdinfo.hta
cdreg64.exe
regdll.bat

If the above still cannot solve the problem, the true error message usually can be find in the Windows Event Log. In "Control Panel/Administrative Tools/Event Viewer", please choose "Application Logs/Application". You may see some log from the "VBRuntime", and there should be a line providing a little bit more details. Sometimes, there may be an event from "Complus" that may include further information.

Please kindly let me know of the results.

Regards
Peter Kwan

  Re: ChartDirector - Sporadic IIS 7.5 issues
Posted by Trish on Feb-14-2012 01:12
Just to be clear, I originally had ChartDirector30.dll registered.  When you gave me ChartDirector50.dll, I unregistered the ChartDirector30.dll and registered the ChartDirector50.dll.


When I received this latest version, I deleted the ChartDirector30.dll to be absolutely certain the application would be using the correct one.

Can you confirm that the ChartDirector30.dll can be replaced with the ChartDirector50.dll?

Thanks!
trish

  Re: ChartDirector - Sporadic IIS 7.5 issues
Posted by Peter Kwan on Feb-14-2012 01:36
Hi Trish,

I see the issue now.

ChartDirector Ver 3.0 comes with "chartdir30.dll". ChartDirector Ver 5.0 comes with "chartdir50.dll". They cannot be inter-changed.

In my earlier message (the one on Feb 02, 2012), I also mentioned about an existing update that includes an updated "chartdir50.dll". If you are using ChartDirector Ver 3.0, it should not be possible to use "chartdir50.dll" at all. You mentioned your server still works after the update but the update does not solve the problem. The only possibility I can think of is that your server is still using the old "chartdir30.dll" (have you deleted the "chartdir30.dll" at the time), so the new "chartdir50.dll" was not actually being used.

ChartDirector Ver 3.0 was released in 2003. before any Intel based 64-bit Windows server exists. If it still works in your 64-bit Windows 2008, you may have set up a 32-bit application pool to allow it to run, or the entire IIS may be configured to run in 32-bit mode. In any case, ChartDirector Ver 3.0 is never tested for 64-bit servers, and it may not be able to handle addresses above 2G space. (We are not sure as it is never tested. That may also explain why we cannot actually reproduce the problem with ChartDirector Ver 5.)

ChartDirector Ver 5.0.2 is designed to work with both 32-bit and 64-bit IIS, without requiring setting up of 32-bit application pools. It will register itself for both 32-bit and 64-bit operations. Your ASP can run natively in 64-bit or 32-bit.

Because we no longer provide updates the ChartDirector Ver 3.0, I suggest you may try to upgrade to ChartDirector Ver 5.x. The upgrade procedure is to simply download and install the latest version of ChartDirector over an earlier one. However, in your case, you may need to also upgrade your license, which may cost 25% to 50% of the full price of the product (depending on how old the original ChartDirector license was - see http://www.advsofteng.com/purchase_upg.html).

The system will work normally even without upgrading the license, but the charts will include a yellow bar at the bottom that indicates they are created by the unregistered version of ChartDirector. I understand your system is a live system, and you may not want this to occur. If you have a test system as well, you may first try to make sure it works, before deciding on the upgrade.

Regards
Peter Kwan

  Re: ChartDirector - Sporadic IIS 7.5 issues
Posted by Trish on Feb-14-2012 03:05
Okay, this makes sense.  No, I didn't delete the ChartDirector30.dll the first time, just the second.   I will upgrade to CharDirector50.dll.

Hopefully, this does the trick.

Thanks!
trish