Issue Details (XML | Word | Printable)

Key: CORE-1240
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Alexander Peshkov
Reporter: Alexander Peshkov
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
Firebird Core

Any task, using libfbclient, hangs on exit.

Created: 03/May/07 08:03 AM   Updated: 22/Aug/16 05:52 AM
Component/s: Engine
Affects Version/s: 2.0.1
Fix Version/s: 2.1 Beta 1, 2.0.2

Environment: Darwin, PowerPC
Issue Links:

QA Status: Cannot be tested

 Description  « Hide
Bug was reported by Paul Beach to me privately.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Alexander Peshkov added a comment - 03/May/07 09:25 AM
This bug had two reasons - first (and primary) that we relied upon some order of objects' destruction, where default_stats_group was destroyed after all other objects, which used dynamic memory allocation. But nobody actually guarantees this, and on PPC bug happened. Mutex, used in AtomicCounter, was already destroyed at a moment, when it was attempted to be used in some destructor. Exception system_call_failed happened, and here we come to the second reason.

We can't (at least using this platform) throw exceptions from memory pool, when it's mutex is locked! Compiler needs some memory to create exception, it calls new for this - and in that new that same mutex is attempted to be entered once more. Deadlock and hang.

I fixed wrong destruction order making default_stats_group permanent pointer, i.e. it will never be destoryed, but will dye together with a process. Therefore I mark this particular bug as resolved, though we must decide what to do with exceptions in memory manager.