I'm new to Linux so I don't really know what I'm doing, but....
I've taken a program that I wrote for windows and trying to make it work in linux. The problem I've run into is that in some threads, I get "Invalid Memory access" and array out of bounds crashes in places that just can't be. For instance on a line of code that checks a global integer as true of false or on a array that the index is well within bounds. The threads work fine in windows, so I have no clue.
And I'm using the latest PB with the c++ back end.
Any thoughts are appreciated
Russ
raspberry pi threading problem
Re: raspberry pi threading problem
Code?RSrole wrote: Tue Mar 19, 2024 10:05 pm I'm new to Linux so I don't really know what I'm doing, but....
I've taken a program that I wrote for windows and trying to make it work in linux. The problem I've run into is that in some threads, I get "Invalid Memory access" and array out of bounds crashes in places that just can't be. For instance on a line of code that checks a global integer as true of false or on a array that the index is well within bounds. The threads work fine in windows, so I have no clue.
And I'm using the latest PB with the c++ back end.
Any thoughts are appreciated
Russ
There are differences between Windows and Linux. For example, gadget commands can't be used in Threads.
Do you compile 32 bit or 64 bit?
If you compile a 64 bit program you should check, if you use at some point a long (.l) instead of a integer (.i) where it should be an integer.
When a program crashes at a position where it shouldn't, it is a sign for memory heap corruption.
You overwrite somewhere a memory buffer and at some location is affected by that.
But without code, it is just guessing.
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 more ― Typeface - Sprite-based font include/module
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Re: raspberry pi threading problem
try using the purifier. it will identify any out of bounds writes, and make sure you only use postevent to interact with gui from threads.
Re: raspberry pi threading problem
You guys nailed it. Thanks for the tips!


