Gildor's Forums

Author Topic: Crash on export of a specific file  (Read 2238 times)
Chaoss
Newbie
*
Posts: 4


View Profile
Crash on export of a specific file
« on: August 06, 2017, 21:03 »

Trying to export Battlegrounds' map (Link to the file: https://ufile.io/wst7r )
When trying to export the model viewer crashes with the following error:
Code:
Loading package: /TslGame/Content/UI/HUD/Erangel_Minimap.uasset Ver: 508/0 Engine: 0 [Unversioned] Names: 15 Exports: 1 Imports: 3 Game: 10000E0
Memory: allocated 754084 bytes in 5165 blocks
Loading Texture2D Erangel_Minimap from package /TslGame/Content/UI/HUD/Erangel_Minimap.uasset
Loading data for format PF_DXT1 ...
Loaded in 0.22 sec, 1035 allocs, 15.39 MBytes serialized in 511 calls.
Exporting objects ...
Exporting Texture2D Erangel_Minimap to C:/Users/Chaos/Desktop/UE4/UmodelExport/UI/HUD
******** /TslGame/Content/UI/HUD/Erangel_Minimap.uasset ********
*** ERROR: Memory: bad allocation size 268435456 bytes
appMalloc:size=268435456 (total=32 Mbytes) <- CTextureData::Decompress:fmt=PF_DXT1(5) <- ExportTexture <- ExportObject:Texture2D'Erangel_Minimap' <- ExportObjects <- CUmodelApp::ShowPackageUI <- Main:umodel_version=612
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7928



View Profile WWW
Re: Crash on export of a specific file
« Reply #1 on: August 07, 2017, 00:30 »

UModel's code not allowing to allocate memory blocks larger or equal of 256Mb. This is USUALLY just not a good allocation. For your case, it allocates exactly 256Mb memory block. I've made some calculations, and it seems there's a texture 16384x16384. This texture size might be unsupported by rendering hardware, so it is also bad.

If UModel will try to save such texture in uncompressed (tga) format, it will allocate 1Gb of memory for DXT decompression (16k x 16k x 4 bytes per pixel), so allocation will fail again. Even more - UModel is 32-bit application, and any 32-bit applications usually fails to allocate memory blocks which are 1Gb of size - probably because of memory fragmentation, I don't know.

Possible solution for you.
1. download UModel's source code.
2. disable check for "bad memory block size".
3. compile it by yourself for 64-bit platform.

Or - just ignore this texture.
Logged
Chaoss
Newbie
*
Posts: 4


View Profile
Re: Crash on export of a specific file
« Reply #2 on: August 07, 2017, 07:44 »

Well, I need this specific texture, so I can't ignore it Smiley
I will try your solution later today and will post again! Thanks
Logged
Chaoss
Newbie
*
Posts: 4


View Profile
Re: Crash on export of a specific file
« Reply #3 on: August 07, 2017, 15:31 »

I disabled the upper limit, but can't compile
Code:
void *appMalloc(int size, int alignment)
{
guard(appMalloc);
if (size < 0/* || size >= (256<<20)*/) // upper limit for single allocation is 256Mb
appError("Memory: bad allocation size %d bytes", size);

Code:
./../Libs/msvcrt/startup/crtexe2.obj : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'

EDIT:
I tried compiling as x86 and it was able to export my texture  Grin Grin Grin Grin
« Last Edit: August 07, 2017, 17:15 by Chaoss » Logged
Chaoss
Newbie
*
Posts: 4


View Profile
Re: Crash on export of a specific file
« Reply #4 on: August 07, 2017, 17:22 »

New question tho, if the texture is 16384 why does it export a 8192 tga?
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7928



View Profile WWW
Re: Crash on export of a specific file
« Reply #5 on: August 07, 2017, 22:48 »

I don't know if texture should be 16k - it was just my assumption.
Logged
Jump to:  

Powered by SMF | SMF © 2006-2009, Simple Machines LLC
Leviathan design by Bloc | XHTML | CSS