dkprojektai 1 Posted September 3, 2019 Hello, I made some software in which on thread exception program exits(terminates) without any notice. What I do.. Make thread... FThread := TWorkerThread.Create(true); FThread.FreeOnTerminate := true; FThread.Start; After, I work with dll in it... try Try raise Exception.Create('Test Exception'); ----<<<< if here, no problem candidates:= Processor_analyze(proc,p,3*W, W, H,StrToInt(max_height)); ----<<<< call from dll raise Exception.Create('Test Exception'); ----<<<< if here, no problem except // end; raise Exception.Create('Test Exception'); ----<<<< if here - program terminates except // end; Can somebody help to solve? What to check? where to dig? Thanks. I have Delphi 10.2 Share this post Link to post
dkprojektai 1 Posted September 4, 2019 try Try ----<<< deleted candidates:= Processor_analyze(proc,p,3*W, W, H,StrToInt(max_height)); ----<<<< call from dll except ----<<< deleted // end; ----<<< deleted raise Exception.Create('Test Exception'); ----<<<< if here - program terminates except // end; Miracle - I commented try except block and it start working like usual :)))) Maybe any comments? Share this post Link to post
Remy Lebeau 1394 Posted September 4, 2019 (edited) Random crashes like this usually tend to imply that there is possible memory corruption at play. What does Processor_analyze() actually do internally (if you have its source code), and are you sure you have declared it correctly (if importing it from a DLL)? Edited September 4, 2019 by Remy Lebeau Share this post Link to post
Daniel 417 Posted September 4, 2019 I have just adjusted the title of this topic. Just „very strange issue“ could also apply to nearly everything. 😉 1 Share this post Link to post
aehimself 396 Posted September 29, 2019 On 9/4/2019 at 10:53 PM, Remy Lebeau said: Random crashes like this usually tend to imply that there is possible memory corruption at play. What does Processor_analyze() actually do internally (if you have its source code), and are you sure you have declared it correctly (if importing it from a DLL)? This. I remember having a similar issue a couple of years ago calling .DLL exported functions when I switched from D7 to D10.2. The issue was memory allocation for a string (* SizeOf(Char) was not included) which lead to a nice and beautiful memory corruption. The application always crashed several functions later so it was a pain in the butt to find it. Anyways, memory corruption would indeed be my guess in this case, too. Share this post Link to post