Ok, I'll keep hunting.
Yes, the app is compiled with these:
Code: Select all
; =================================================
; COMPILER OPTIONS:
; [ ] Use Compiler: PureBasic 5.61 (x64)
; [x] Use Icon: C:\myapp\my_16x16.ico
; [ ] Enable inline ASM support
; [x] Create threadsafe executable
; [x] Enable OnError lines support
; [x] Enable XP skin support
; [ ] Request Administrator mode for Windows Vista
; [ ] Request User mode for Windows Vista (no virtualization)
; Library Subsystem:
; Executable Format: Windows ;|Console|Shared DLL
; CPU: All ;|Dynamic|w/MMX|w/3DNOW|w/SSE|w/SSE2
; File Format: UTF-8
nco2k wrote:>> Well, the ide debugger is stopping at WaitWindowEvent(10)?
it doesnt matter where it stopped. purebasic cant really precisely tell you where the overflow happened, when you are using threads. so dont rely on that line.
Surely some variable or start/end size is known so I could limit my search? I mean, when I look at my variable list, I see nothing wrong?
nco2k wrote:>> I can't really step through the code since the worker function is in another thread.
of course you can.
Like I said, this is a random error. Once I step forward, I am in the main loop, all is good. I have to put a breakpoint in the worker thread since it is cranking along.
nco2k wrote:>> I did not get this error when running that worker without threads?
then you know where to look.
True, I did add a shared structured array for the thread and main loop to process once it receives a postevent().
Code: Select all
Structure myData_INFO
nthPt.l
nthPtgui.l
Array dat$(10000) ; Pre-fill or ReDim later based on specific data
EndStructure
Global myD.myData_INFO
Although, my worker thread will never come close to 10,000 operations? I'll check this element with next random error.
nco2k wrote:>> So, my question is, what triggered the debugger to stop?
an overflow in a dynamically allocated memory block.
haha
nco2k wrote:>> And if I resume and no errors, then what is the real problem?
something you do in your thread. could be many things. could be something you do with strings or even your gui. hard to guess without knowing the worker thread. are you using threadsafe? are you using mutexes to synchronise access to shared objects between the worker thread and main thread? how are you letting your main thread know that the worker thread finished? are you using KillThread()?
The worker thread postevent()'s to the main loop and then immediately pausethread()'s. The main loop acts on the postevent to update a status line and then issues signalsemaphore() and resumethread(). KillThread()'s are only on exit.
I modeled the app after the code in this post using mk-soft's code.
I'm still in development, so I cannot go fully compiled, but I'm hoping this is not a false error induced by the IDE debugger? Already running the app for 4 hours without the error?
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum