Common problem EP4 Client when loading Fonts with 'Load_t' function (HEAP Chunks)

05/09/2021 13:43 andrea-titan95#1
Hello to everybody.
I'm using different version of code (March and June for now) and I noticed that everytime there is a Heap memory problem reading chunks (correct me if i'm wrong).

What's going on? I'll try to explain:

1)Nkps starts
2) Call engine and initialize fonts with SE_LoadDefaultFonts()
3) Here its opened Fonts/Standard.fnt
4) Using CFontData::Read_t we read the file decrypting the header
5) In every version crashes inFile->PeekID_t()==CChunkID("FTTF")
6) This function call Read_t( &cidToReturn.cid_ID[0], CID_LENGTH); where actually &cidToReturn.cid_ID[0] is ' ' (32 Ascii)
7) Read_t is an inline function of stream.h header. Setting in Engine projects (C/C++ -> Optimization -> Disabling Inline function expansion) I can debug the function but I can't resolve.
8) In Read_t inline functions the instruction that crashes is:
memcpy( (char *)pvBuffer, strm_pubCurrentPos, slSize);
where strm_pubCurrentPos is every time this :
strm_pubCurrentPos = 0x06400000 <Error reading characters of string.>


Disabling 'break when this exception is thrown' will cause problem.
Using vs try/except does not make sense .
enable Yes with SEH Exceptions (/EHa) to catch this exception does not solve the problem too.

To summarize, how do you turn around to this problem?
The real problem is in World Editor, infact i can't skip this exception.

[Only registered and activated users can see links. Click Here To Register...]

Any advice?

Thanks in advance.
05/09/2021 23:02 Lee Ki-Hwan#2
Did you modified anything in the code?

These errors usually occur because of poor memory mangement, something has not be cleared correctly or something like this..
05/10/2021 09:22 andrea-titan95#3
Quote:
Originally Posted by Lee Ki-Hwan View Post
Did you modified anything in the code?

These errors usually occur because of poor memory mangement, something has not be cleared correctly or something like this..
Thanks for your answer.
This is the same thing that I think (infact last chaos engine has a memory tracker management).
Btw I did not touch the stream/serial classes, Infact I started with original last chaos released code.

Wich code are you using?
Is your Standard.font first line like this?
FONN DFNM Fonts\Standard.tex"
05/10/2021 13:21 Lee Ki-Hwan#4
I don't think it has something to do with that Stream classes.

As I already mentioned I ran in this kind of problem only, when I had poor memory management, if you have made any changes revert them and try it out again, it doesn't matter if the changes are not related to the stream/font classes.
05/10/2021 13:52 andrea-titan95#5
Quote:
Originally Posted by Lee Ki-Hwan View Post
I don't think it has something to do with that Stream classes.

As I already mentioned I ran in this kind of problem only, when I had poor memory management, if you have made any changes revert them and try it out again, it doesn't matter if the changes are not related to the stream/font classes.
With 'poor memory management' what do you mean? Or wich part of Engine?
Engine/Base ?

I did not change any in particoular, is this what scare me :(

Could you share your preprocessor directive for Engine Project if I've set something wrong?
05/10/2021 14:55 Veni/Marius#6
Well did it even work at one point in the first place?
05/10/2021 15:01 Lee Ki-Hwan#7
Quote:
Originally Posted by andrea-titan95 View Post
With 'poor memory management' what do you mean? Or wich part of Engine?
Engine/Base ?

I did not change any in particoular, is this what scare me :(

Could you share your preprocessor directive for Engine Project if I've set something wrong?
Im using the 2009/2010 Code, so my settings won't be useful for you.

You need to start over, do a reset.

Extract clean files, compile everything again and check if the error still occurs, also try a different client.
05/10/2021 22:16 andrea-titan95#8
Quote:
Originally Posted by Veni/Marius View Post
Well did it even work at one point in the first place?
No. This happen also with clean source.

Quote:
Originally Posted by Lee Ki-Hwan View Post
Im using the 2009/2010 Code, so my settings won't be useful for you.

You need to start over, do a reset.

Extract clean files, compile everything again and check if the error still occurs, also try a different client.
I'm using clean files.
At this point could be boost lib wrong version or a windows 10 memory allocation problem?

For 'different client' what do you mean?
The problem that I get is on loading fonts/standard.fnt so I should try another font... (correct me if I'm wrong)
Maybe you mean a ps.dat shell variable setting?

This is a output log in debug:

First-chance exception at 0x574fcac4 (msvcr100d.dll) in Nksp.exe: 0xC0000005: Access violation reading location 0x07490000.
HEAP[Nksp.exe]: Invalid address specified to RtlValidateHeap( 02550000, 006C8B88 )
Windows has triggered a breakpoint in Nksp.exe.

This may be due to a corruption of the heap, which indicates a bug in Nksp.exe or any of the DLLs it has loaded.
05/11/2021 14:34 Lee Ki-Hwan#9
Quote:
Originally Posted by andrea-titan95 View Post
No. This happen also with clean source.



I'm using clean files.
At this point could be boost lib wrong version or a windows 10 memory allocation problem?

For 'different client' what do you mean?
The problem that I get is on loading fonts/standard.fnt so I should try another font... (correct me if I'm wrong)
Maybe you mean a ps.dat shell variable setting?

This is a output log in debug:

First-chance exception at 0x574fcac4 (msvcr100d.dll) in Nksp.exe: 0xC0000005: Access violation reading location 0x07490000.
HEAP[Nksp.exe]: Invalid address specified to RtlValidateHeap( 02550000, 006C8B88 )
Windows has triggered a breakpoint in Nksp.exe.

This may be due to a corruption of the heap, which indicates a bug in Nksp.exe or any of the DLLs it has loaded.
The client is missing some files.

Try to use a different client, not just the bin folder.
05/11/2021 15:12 Desarija#10
Did you compile for usa? (try USALIVE)
05/12/2021 22:36 andrea-titan95#11
Quote:
Originally Posted by Desarija View Post
Did you compile for usa? (try USALIVE)
I'm building with my own property that was a copy of Usalive, this is my preprocessor directives:

G_USA;
_CLIENT_;
_USE_32BIT_TIME_T;
WIN32;
_WINDOWS;
_USRDLL;
ENGINE_EXPORTS;
NDEBUG;

Debuggable assembly, with no optimization.

To summarize: in Release mode this error is skipped (in Build_2010 Solution), or also in Debug Mode if I skip the exception with visual studio or pressing F5.
but in SkaEditor Project this crashes the program (also in release mode).
05/24/2021 23:32 andrea-titan95#12
Quote:
Originally Posted by Lee Ki-Hwan View Post
Im using the 2009/2010 Code, so my settings won't be useful for you.

You need to start over, do a reset.

Extract clean files, compile everything again and check if the error still occurs, also try a different client.
I started iover with clean file.
I think that something is missing or corrupted purposely in june release.
05/25/2021 15:12 Lee Ki-Hwan#13
Quote:
Originally Posted by andrea-titan95 View Post
I started iover with clean file.
I think that something is missing or corrupted purposely in june release.
Take the June release from Reza, its an almost one click compile setup with a working client, i tried it out and it works, takes like 30 minuts till you can login.
03/31/2022 15:07 Benjamin Arnold#14
I had trouble loading fonts, too. But I was able to solve them by using [Only registered and activated users can see links. Click Here To Register...]and applying different font options. I am happy with the result.
04/06/2022 11:08 universal-lc#15
Quote:
Originally Posted by Lee Ki-Hwan View Post
Take the June release from Reza, its an almost one click compile setup with a working client, i tried it out and it works, takes like 30 minuts till you can login.
Not worth ... i spent more than 1 year on that source in order to fix all the little jokes left by reza and random bugs.

Those source are only worth if you are setting up it for a little private project or for develop system to sell