What does "Overflow in a string memory block" mean?

Just starting out? Need help? Post your questions and find answers here.
User avatar
jacdelad
Addict
Addict
Posts: 2090
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

What does "Overflow in a string memory block" mean?

Post by jacdelad »

Hi,

in a bigger project I suddenly get "Overflow in a string memory block" errors. These errors occur on different places which worked before and look a bit random. The project uses threads, threadsafe is enabled. Can someone explain this further and maybe offer a solution?
Windows 11 x64, PB 6.30 x64 (the errors occur for both, C-Backend and ASM Backend)
Good morning, that's a nice tnetennba!

PureBasic 6.30/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/2*DX517, 164TB+82TB+28TB+2TB SSD
Raspi 400/500
User avatar
STARGÅTE
Addict
Addict
Posts: 2305
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: What does "Overflow in a string memory block" mean?

Post by STARGÅTE »

If the purifier is activated, all strings have a memory pattern before and after the string.
If you then write something behind the string, this error occurs.

Code: Select all

Define String.s = "Hello World!"

PokeS(@String+20, "Overflow")
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
BarryG
Addict
Addict
Posts: 4333
Joined: Thu Apr 18, 2019 8:17 am

Re: What does "Overflow in a string memory block" mean?

Post by BarryG »

Is the Purifier active in a compiled exe, or only during runtime from the IDE?
User avatar
jacdelad
Addict
Addict
Posts: 2090
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: What does "Overflow in a string memory block" mean?

Post by jacdelad »

@STARGATE: That makes sense, but it spits out lines like

Code: Select all

Error$=ReadProgramError(prog)
to be the problem.

Anyway, I'll try without purifier. Strange that it worked until yesterday.
Good morning, that's a nice tnetennba!

PureBasic 6.30/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/2*DX517, 164TB+82TB+28TB+2TB SSD
Raspi 400/500
User avatar
jacdelad
Addict
Addict
Posts: 2090
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: What does "Overflow in a string memory block" mean?

Post by jacdelad »

Found the culprit: In a thread a PokeS with a long string was done on a too small dimensioned string. It's a bit confusing that a totally different line was spat out as the errorneous one. Anyway, I can fix it now.

Thanks for your assistance!
Good morning, that's a nice tnetennba!

PureBasic 6.30/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/2*DX517, 164TB+82TB+28TB+2TB SSD
Raspi 400/500
User avatar
spikey
Addict
Addict
Posts: 809
Joined: Wed Sep 22, 2010 1:17 pm
Location: United Kingdom

Re: What does "Overflow in a string memory block" mean?

Post by spikey »

jacdelad wrote: Mon Feb 23, 2026 8:35 am It's a bit confusing that a totally different line was spat out as the errorneous one.
The purifier does sample testing periodically rather than all the time. It's error messages aren't definite like a compiler or debugger error is, this is done for performance reasons. The error is reported at the line the problem was identified. This isn't necessarily the line which caused the problem (as you've discovered).

If you encounter a specific problem that proves difficult to trace you can adjust the frequency of checks with the PurifierGranularity instruction, or via the dialog.

Lower values (above 0) will yield better accuracy at a cost of worse performance.
User avatar
jacdelad
Addict
Addict
Posts: 2090
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: What does "Overflow in a string memory block" mean?

Post by jacdelad »

Thanks spikey. I have not encountered such a case before, that's why I was a bit confused.
Now, I'm prepared for future problems.
Good morning, that's a nice tnetennba!

PureBasic 6.30/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/2*DX517, 164TB+82TB+28TB+2TB SSD
Raspi 400/500
Post Reply