System.AccessViolationException then try open the fbx model
#1
I received a the next exception and a programm did crash when try to open attached model.

I tried this with 8.3.6989 and 8.2.6863 versions using different methods.
I can send a project to your email.


Code:
System.AccessViolationException
 HResult=0x80004003
 Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
 Source=AssimpNet
 StackTrace:
  at Assimp.MemoryHelper.Read[T](IntPtr pSrc, T[] data, Int32 startIndexInArray, Int32 count)
  at Assimp.MemoryHelper.FromNativeArray[T](IntPtr nativeArray, Int32 length)
  at Assimp.EmbeddedTexture.Assimp.IMarshalable<Assimp.EmbeddedTexture,Assimp.Unmanaged.AiTexture>.FromNative(AiTexture& nativeValue)
  at Assimp.MemoryHelper.FromNativeArray[Managed,Native](IntPtr nativeArray, Int32 length, Boolean arrayOfPointers)
  at Assimp.Scene.Assimp.IMarshalable<Assimp.Scene,Assimp.Unmanaged.AiScene>.FromNative(AiScene& nativeValue)
  at Assimp.MemoryHelper.FromNativePointer[Managed,Native](IntPtr ptr)
  at Assimp.Scene.FromUnmanagedScene(IntPtr scenePtr)
  at Assimp.AssimpContext.ImportFile(String file, PostProcessSteps postProcessFlags)
  at Ab3d.Assimp.AssimpWpfImporter.ReadFileToAssimpScene(String fileName)
#2
There is no attachment with the post.

Anyway, from the exception message I would say that the embedded texture was not correctly read by the assimp importer. I cannot do much there.

If possible, try to save your model without embedding the textures.
Andrej Benedik
#3
(03-20-2019, 02:08 PM)abenedik Wrote: There is no attachment with the post....

You can download model by next link
https://my.pcloud.com/publink/show?code=...DUc8bXMJlk
#4
I have tried your model and found out that the exception happens only in x64 mode. If you build the application with x86 mode, then the file is read without problems.


I will check if it is possible to update the managed AssimpNet wrapper to prevent that problem.
Andrej Benedik
#5
(03-20-2019, 03:18 PM)abenedik Wrote: I have tried your model and found out that the exception happens only in x64 mode. If you build the application with x86 mode, then the file is read without problems.


I will check if it is possible to update the managed AssimpNet wrapper to prevent that problem.

Unfortunately I can use only  in x64 mode.

Quote: will check if it is possible to update the managed AssimpNet wrapper to prevent that problem.

This will be great.


Thanks!
#6
I have tried to use a newer version of assimp importer (compiled from source from 2019-02-19) and with this version your file was imported without problem in x86 and x64 mode.

You can get a newer assimp version from:
https://www.ab4d.com/GetFile.ashx?fileNa...-02-19.zip



Note that with this version I had some problems with importing some files that worked with a previous version. Therefore I did not include this version into the official Ab3d.PowerToys distribution.

Unfortunately, the development of assimp library does not have any recent and official version - the latest official release version is from July 2017. After that there were many improvements in the library but it is hard to get the source at the correct date when everything would work.
Andrej Benedik
#7
Thanks but this didn't help.
Same bugs.
I found one solution what help to prevent program from crashing -
the attribute [HandleProcessCorruptedStateExceptions]
https://stackoverflow.com/a/6158298/2237301

If you need you can download more models what causes a crash by next link
https://my.pcloud.com/publink/show?code=...hgB8pgtP9k
  


Forum Jump:


Users browsing this thread:
1 Guest(s)