Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

CodeBlocks revision: '13605', breaks when opening a file (LINUX)

<< < (2/3) > >>

dthu:
I have used CodeBlocks and have not encountered the error again.

Miguel Gimenez:
May be related to a mismatch between the array size in the config file and the cached value, deleting the config file synced them.

Pecan:

--- Quote from: Miguel Gimenez on January 31, 2025, 11:07:36 am ---May be related to a mismatch between the array size in the config file and the cached value, deleting the config file synced them.

--- End quote ---

For my education, what do you mean by "cached value" of the array size.
 
BrowseTracker reads the array size from the conf file at  start up and only at start up. It statically allocates the array size and does not change it.
 
If more values need to be added than the array size allows, it adds them starting at the top again (circular buffer style).

Am I missing something that could have caused the out-of-bounds error (other than a off-by one error)?

Miguel Gimenez:
I was talking about these lines in helpers.cpp, currentMaxEntries is caching the value in the configuration:

--- Code: ---if (currentMaxEntries) return currentMaxEntries;
...
currentMaxEntries = Manager::Get()->GetConfigManager("BrowseTracker")->ReadInt("JumpViewRowCount", 20);
return currentMaxEntries;

--- End code ---

This was just a long shot, because the array was being accessed out of bounds so the array size should be lesser than currentMaxEntries.

Pecan:

--- Quote from: Miguel Gimenez on January 31, 2025, 07:15:18 pm ---I was talking about these lines in helpers.cpp, currentMaxEntries is caching the value in the configuration:

--- Code: ---if (currentMaxEntries) return currentMaxEntries;
...
currentMaxEntries = Manager::Get()->GetConfigManager("BrowseTracker")->ReadInt("JumpViewRowCount", 20);
return currentMaxEntries;

--- End code ---

This was just a long shot, because the array was being accessed out of bounds so the array size should be lesser than currentMaxEntries.

--- End quote ---

Thanks, I'll have a look at ever place that's used to make sure it's always used as currentMaxEntries-1 or "For whatever<currentMaxEntries".

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version