ThinkGeo.com    |     Documentation    |     Premium Support

V10 - MrSidRasterLayer & Jpeg2000RasterLayer - Exceptions

MapSuite Team,

I am in the process of upgrading my applications from V9 to V10. I am encountering exceptions when attempting to render MrSid & JPeg2000 rasters. This appears to be a similar issue encountered when I upgraded from V8 to V9. At that time you found and corrected MapSuite. In my application the render of TIFF Rasters does indeed work.

To check my code I took the V10 sample for MrSid to see if it worked, but it does not as it gets the same error – https://github.com/ThinkGeo/HowDoISample-ForWpf/blob/master/HowDoI/Satellite%20Image/LoadAMrSidImage.xaml.cs

The full application has been uploaded to the OriStarMapping download area on your server. It can be found as a zip file at \Applications\OriStarRasterWithNuGet20171014.zip.

I added a line of code to invoke GetBoundingBox to determine CurrentExtent and this is one of the exceptions. This results in an exception of Value cannot be null. Parameter name: ptr.

If instead of invoking GetBoundingBox and set the CurrentExtent with discrete values an exception occurs sometime after the wpfMap1.Refresh() is invoked. I believe this exception is the same as encountered from GetBoundingBox. The following is what appears at the exception – System.ArgumentNullException was unhandled
Message: An unhandled exception of type ‘System.ArgumentNullException’ occurred in ThinkGeo.MapSuite.Wpf.dll
Additional information: Value cannot be null.

If I understand V10 correctly there is no need to move anything to either system32 or SysWOW64 directories, correct?

Your assistance appreciated.

Regards,
Dennis

Hi Dennis,

Our developer hadn’t reproduced your exception.

We download your sample, it looks your bounding box is decimal degree but your map unit is set meter, we modified it but this the only place we changed. Then we render our test data correct, please try our sample in your machine: OriStarRasterWithNuGet20171016.zip (110.0 KB), and let us know whether that works for you.

For V10 you don’t need to copy any dll, when you install our package, the dlls will be copied to their correct path.

Regards,

Ethan

Ethan,

I downloaded the project of mine that you modified. When I attempted to go into debug mode it wanted to invoke “MapSuite Unmanaged Dependency Updater”. I did not permit it to do this as I do not know what it was going to modify on my machine.

I also noticed that it updated the packages.config to use various beta versions for V11.0.0 such as:

<package id="ThinkGeo.MapSuite" version="11.0.0-beta041" targetFramework="net462" />

What is Version 11 all about? I’m on V10.

By the way. Having the GeographyUnit set to Meter was a typo on my part when I created the application from my production application. I changed it to DecimalDegree and I still get the exception, which is shown below…

Did you run the application I sent without applying any updates to the packages.config?

I have to tell you that every time I have upgraded to the latest MapSuite I have encountered issues with Rasters. This goes all the way back to V7, and each time it was something inside MapSuite that was the issue.

Your thoughts/suggestions?

Thanks,
Dennis

Hi Dennis,

  1. Please allow the “MapSuite Unmanaged Dependency Updater” copy necessary dlls to system folder. It works just like our SetupUnmanagedDependencies in V9.

  2. 11.xx is the development version of V10, it contains the latest version with fixed bug, you can find more detail description about the version name here: http://wiki.thinkgeo.com/wiki/map_suite_via_nuget#production_builds_stable_through_nuget

  3. We tested your application without apply any update, then we upgrade all packages and test again, both the tests works well without exception. Why we upgrade all code to the latest is wish you can test whether the latest version still have the exception, because if we found it’s a bug we will fix that based the latest code.

  4. We guess your exception is because you hadn’t allow the unmanaged dlls copied to target folder, but we cannot confirm that because both the projects work well in our side. Please have a try again, and let us know whether it still have the exception after copy the dlls and upgrade to the latest version.

Regards,

Ethan

Ethan,

I had thought that one of the benefits of V10 is that the /Windows/system32 and /Windows/sysWOW64 directories did not have to be modified. Is this not the case?

What exactly will the Dependency Updater be updating? I’d rather do this manually so I know exactly what is going on and so that I have this information when the application is deployed.

I am upgrading to V10 for a production environment, not a development environment. When will the fix that was made be available in a production build?

What are all the dll’s that are required for this fix?

I’m encountering this exception for both MrSid and JPeg2000 rasters. Does the fix also apply to JPeg2000 rasters?

Thanks,
Dennis

Hi Dennis,

A. We moved most of our dlls from system folder to bin folder exception two important packages.
https://www.nuget.org/packages/MapSuiteDependency-MicrosoftSqlServerTypes/
and
https://www.nuget.org/packages/MapSuiteDependency-MicrosoftVisualCRunTime100/

If you want to manual copy them, please download and unzip the two packages, you can found the folder named “MoveToWindowsDirectory”, copy the dlls under “System32” and “SysWOW64” folder to the same name system folder.

B. It looks we don’t have any fix in this topic, could you please let me know what’s the fix point to?

C. The Jpeg2000 is also supported, I build a new sample, which can show the two types. And I changed the version of mainly packages to our latest release version, it’s not the beta version, please view the project for detail: OriStarRasterWithNuGet.zip (920.9 KB)

Regards,

Ethan

Hi Ethan,

I installed the MicrosoftVisualCRunTIme100 dll’s and now the MrSid’s render. Thank you very much!

However, I did encounter an exception that caused the heap to become corrupted – ***Unhandled exception at 0x77799ABA (ntdll.dll) in OriStarVision.exe: 0xC0000374: A heap has been corrupted (parameters: 0x777D58E8)***.

My application is very large having roughly 90 layers that are a combination of MrSid’s, Feature Layers, and SQLite Layers. I corrected this by adding the following to my application Post-Build:

call "$(DevEnvDir)..\..\vc\vcvarsall.bat" x86

“$(DevEnvDir)…\vc\bin\EditBin.exe” “$(TargetPath)” /LARGEADDRESSAWARE

This allocates more memory to the application at run-time. Once I added this no more heap corruption. It’s interesting though that with V9 I did not need this statement.

I do recall past upgrades to V8 & V9 where the MrSid was also causing a corruption of memory, which was fixed in those versions. You may want to check to ensure those fixes made it to V10.

Also download the application for display of JPeg2000 rasters and it does work once I updated the application with your new packages.

Thanks again for you help with this.

Dennis

Hi Ethan,

I’ve discovered an issue with JPeg2000’s.

I updated my application to match the one you sent and I can display the World.jp2 raster. However, when I attempt to display one of my rasters the following exception is encountered:

***An unhandled exception of type 'System.AccessViolationException' occurred in ThinkGeo.MapSuite.Layers.Jpeg2000.dll***
***Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt***.

The World.jp2 file is very small, whereas my jp2 files are very large.

All of my JPeg2000 rasters are on my client site at OriStarMapping -->home/Chicago_Data/MapRasters2014.

My JPeg2000’s work under MapSuite V9.

My JPeg2000’s are multi-band. ThinkGeo made an enhancement for multi-band JPeg2000’s in V9. Was that enhancement brought forward to V10?

Thanks,
Dennis

Hi Dennis,

I think all the changes in V9 had been brought to V10, but I will double check that with the developer.

Thanks for upload your data, our developer will test that and see what’s the problem.

Any update I will let you know.

Regards,

Ethan

Hi Dennis,

Thanks for your data, our developer had reproduced that, we will look into it.

Any update I will let you know.

Regards,

Ethan

hi Ethan,

I’ve noticed that when running the application in Visual Studio debugger that sometimes the MrSid’s are causing the application to crash. Below is the popup window that appears. When running outside the debugger this does not appear to happen, at least not yet.

If I set the Rasters to Invisible the application runs fine in the debugger.

I believe that this was an issue in prior MapSuite versions as it does not occur in V9. This may be memory related.

A change I made with the transition to V10 was to open each raster file (about 16 total) and leave them open for the life of the application. Prior to this the raster would be opened/closed during the DrawCore method. What overhead is there leaving 16 raster files open? Could this be causing this crash that I described here?

The application does make use of auto-tile caching. I think I’m seeing that this crash occurs the first time that it has to create a tile cache for the extent. The tile might actually get created because when the application is restarted and I go back to that location it always renders properly.

I’ll wait until you provide the other fixes from the other problems and I’ll test with new DLL’s.

Dennis

This is from the Windows Event Log.

Faulting application name: OriStarVision.vshost.exe, version: 14.0.23107.0, time stamp: 0x559b788a
Faulting module name: ntdll.dll, version: 10.0.15063.608, time stamp: 0x802f667e
Exception code: 0xc0000374
Fault offset: 0x000d9aba
Faulting process id: 0x4484
Faulting application start time: 0x01d34b667fa74f2e
Faulting application path: C:\OriStarMappingIncMapSuiteV10\OriStarVision\bin\DebugNet4.6.2\OriStarVision.vshost.exe
Faulting module path: C:\WINDOWS\SYSTEM32\ntdll.dll
Report Id: 1a1ecebe-6ed2-4aa8-bb44-8ab61a3f4201
Faulting package full name:
Faulting package-relative application ID:

Hi Dennis,

We have recreated this issue with you test data.
Our developer is looking into this issue, we will update the status here.

Thanks
Mark

Mark,

Do you have any update on these issues?

Thanks,
Dennis

Hi Dennis,

Our developer had fixed that, please get our latest package 11.0.0-beta007 for ThinkGeo.MapSuite.Layers.Jpeg2000.

Any question please let us know.

Regards,

Ethan

hi Ethan,

Can you give me an idea when this fix will be available in a production build?

Thanks,
Dennis

Hi Dennis,

We can move that to a production build after you make sure all bug had been fixed for your scenario.

So can you make sure all the bugs for this package had been found in your currently scenario?

Regards,

Ethan

Ethan,

I installed beta007 in my application and receive the below compile error: After installing ThinkGeo.MapSuite.Layers.Jpeg2000 still has a date of 10/30/2017.

I then installed beta047 and the application compiles but I get the below exception inside of MapSuite:

What’s the trick to installing a beta version?

Thanks,
Dennis

Hi Dennis,

I hadn’t reproduced that, please try the sample and let me know whether I missed anything.

8696.zip (919.7 KB)

Regards,

Ethan

hi Ethan,

I downloaded the sample application and did a restore on the NuGet packages. However, the application does not work. When attempting to load either MrSid or JPeg2000 the following popup appears:

There is clearly an issue here and appears to be getting worse because now it will no longer even load MrSid, when that did work in the past.

Am I not getting all the DLL’s that are required? The JPeg2000 DLL at least now has a date from 11/8/2017.

Do I need to install any of the dependencies in the System32 or SysWOW directories?

Also, a more comprehensive test would be performed with large MrSid and JPeg2000 files, not these little ones as they hardly offer a robust testing condition.

Dennis

Hi Dennis,

It looks this issue is an environment issue.

Because we cannot help you solve that without reproduce it, please tell us your detail environment information, so we can build a machine with the same setting to reproduce it. It include the OS version, .net framework version, VS version, user security in machine etc. Any you think maybe helpful please let us know.

And you don’t need to copy any dll for Version 10, because when you install the packages it will automatic copy necessary ones. I think if with the same project you get exception but we won’t, that’s not related with the test data size.

Regards,

Ethan