Zorba deadlock on Windows

Bug #866817 reported by Gabriel Petrovay
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
New
Medium
Matthias Brantner

Bug Description

On Windows, when I run the below query (also attached), if I try to interrupt it before it completes, the zorba process doesn't finish any more:

for $x in 1 to 1000000
return
 if ($x mod 10000 eq 0) then
   $x
 else
   ()

It could reproduce this only on Windows machines.

Adjust the zeroes if your machine is too slow or too fast.

I also attached the debugger and "Break all". As a response VS says:
"The process appears to be deadlocked (or is not running any user-mode
threads). All threads have been stopped". Then is stops here:

int result = WaitForMultipleObjects(2,cond_event, FALSE,
INFINITE);//wait any of them
in:
> zorba_simplestore.dll!zorba::Condition::wait() Line 131 + 0x12 bytes C++
       zorba_simplestore.dll!zorba::Lock::wlock() Line 189 C++
       zorba_simplestore.dll!zorba::AutoLock::AutoLock(zorba::Lock &
l={...}, zorba::Lock::Mode m=WRITE) Line 101 C++
       zorba_simplestore.dll!zorba::simplestore::SimpleStore::shutdown(bool
soft=true) Line 260 + 0x21 bytes C++
       zorba_simplestore.dll!zorba::StoreManager::shutdownStore(void *
store=0x11b66630) Line 37 C++
       zorba_simplestore.dll!zorba::ZorbaImpl::shutdownInternal(bool
soft=false) Line 106 + 0x9 bytes C++
       zorba_simplestore.dll!zorba::ZorbaImpl::~ZorbaImpl() Line 61 C++
       zorba_simplestore.dll!`zorba::Zorba::getInstance'::`2'::`dynamic
atexit destructor for 'lInstance''() + 0xd bytes C++
       zorba_simplestore.dll!_CRT_INIT(void * hDllHandle=0x0fa30000,
unsigned long dwReason=0, void * lpreserved=0x00000001) Line 415 C
       zorba_simplestore.dll!__DllMainCRTStartup(void *
hDllHandle=0x0fa30000, unsigned long dwReason=0, void *
lpreserved=0x00000001) Line 526 + 0x11 bytes C
       zorba_simplestore.dll!_DllMainCRTStartup(void *
hDllHandle=0x0fa30000, unsigned long dwReason=0, void *
lpreserved=0x00000001) Line 476 + 0x11 bytes C

Revision history for this message
Gabriel Petrovay (gabipetrovay) wrote :

The file mm.xq was added: None

Revision history for this message
Daniel Turcanu (danielturcanu) wrote :

Fixed in svn 9361.

Revision history for this message
Gabriel Petrovay (gabipetrovay) wrote :

Now when I press Ctrl-C I get:
Assertion failed: theMode == NOLOCK, file zorba\src\zorbautils\lock.cpp, line 40

This shows me that there is a problem in the code. When one presses Ctrl-C the process must terminate. If this is not possible, something must be wrong implemented in the Zorba locks.

If one makes an automatic build and send Ctrl-C to zorba, he certainly does not want an assertion failed in Debug mode.

Revision history for this message
Gabriel Petrovay (gabipetrovay) wrote :

The assertion happens here:

>msvcr100d.dll!_NMSG_WRITE(int rterrnum=10) Line 217C
 msvcr100d.dll!abort() Line 61 + 0x7 bytesC
 msvcr100d.dll!_wassert(const wchar_t * expr=0x1176a1a8, const wchar_t * filename=0x1176a130, unsigned int lineno=40) Line 153C
 zorba_simplestore.dll!zorba::Lock::~Lock() Line 40 + 0x1d bytesC++
 zorba_simplestore.dll!zorba::simplestore::SimpleStore::~SimpleStore() Line 117 + 0x12 bytesC++
 zorba_simplestore.dll!`zorba::StoreManager::getStore'::`2'::`dynamic atexit destructor for 'store''() + 0xd bytesC++
 zorba_simplestore.dll!_CRT_INIT(void * hDllHandle=0x0f910000, unsigned long dwReason=0, void * lpreserved=0x00000001) Line 415C
 zorba_simplestore.dll!__DllMainCRTStartup(void * hDllHandle=0x0f910000, unsigned long dwReason=0, void * lpreserved=0x00000001) Line 526 + 0x11 bytesC
 zorba_simplestore.dll!_DllMainCRTStartup(void * hDllHandle=0x0f910000, unsigned long dwReason=0, void * lpreserved=0x00000001) Line 476 + 0x11 bytesC
 ntdll.dll!77b5afc4()
 [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
 ntdll.dll!77b638da()
 ntdll.dll!77b5b468()

Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

As it turns out, the fix made by Daniel in rev. 9361 doesn't fully solve the problem. Also, as discussed in the telco on Dec. 1st, we decided to not catch signals in libzorba but leave it to the application to properly catch all signals.

However, since the application currently has no way to interrupt queries, we postpone the resolution of this bug.

Revision history for this message
Sorin Marian Nasoi (sorin.marian.nasoi) wrote :

Marked with Resolution = None at Dana's request.

Chris Hillery (ceejatec)
tags: removed: core-runtime
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.