Strange access violations

Forum related to version 6.1.5 of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
matsgefvert
Junior Boarder
Junior Boarder
Posts: 38
Joined: 22.11.2005, 09:11
Location: Skövde, Sweden
Contact:

Strange access violations

Post by matsgefvert »

We're having problems with some of our software, which has been going on for a long time and quite frankly we're at our wits end here. :book:

Sometimes, very infrequently, something goes boom! And it always has to do with threaded applications. The programs work fine for hours, days... and then, suddenly, out of the blue, it crashes with access violations.

As far as we can see, we've made our programs as thread-safe as can reasonably be done. And while we're not looking specifically to blame the database components, we do rely heavily on them (Zeos 6.1.5, or 5.1) and it naturally arises as a cause of suspicion.

Has anyone else had problems with either libmysql40.dll or ZeosDBO in conjuction with threaded applications?

/ Mats
Coffee clarifies the mind, improves morale, lifts the spirit and motivates and inspires to focused, productive work.
zippo
Silver Boarder
Silver Boarder
Posts: 322
Joined: 12.10.2005, 18:01
Location: Slovenia

Post by zippo »

Sorry, never did threading with DB..
matsgefvert
Junior Boarder
Junior Boarder
Posts: 38
Joined: 22.11.2005, 09:11
Location: Skövde, Sweden
Contact:

Post by matsgefvert »

Okay,

Just for all you guys who've been sitting on the edge of your seats now, biting your fingernails and desperately wondering if ZeosLib is stable enough for multithreaded development, the jury is in and has reached the following verdict:

ZeosLib is stable. :wohow:

Phew.

We finally located the problem and it turned out that there was one little icky component buried deep within the bowels of our system, that referenced a ZConnection object in a different thread. Which is really, really prohibited, although I'm not sure anyone ever told us that; I think we mostly figured that out as we went along. And, of course, it worked as long as two queries weren't using the same connection at the same time, which happened about once every hour or something.

So, as a general precaution, we've now applied a patch to ZConnection and ZAbstractROQuery, so that whenever a ZConnection is referenced from a thread that's different from the one that created it, it violently throws exceptions all around and displays big bad MessageBoxes with trace information. So if there's any more in there, we'll find them.

That's all. :bash:
Coffee clarifies the mind, improves morale, lifts the spirit and motivates and inspires to focused, productive work.
Post Reply