activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Albert Strasheim (JIRA)" <>
Subject [jira] Commented: (AMQCPP-128) Transacted session crashes or loses messages
Date Thu, 05 Jul 2007 14:46:33 GMT


Albert Strasheim commented on AMQCPP-128:

I took a look at the state of the mutexes after a crash again, and what I saw seems to confirm
my previous observation.

Prior to most of the crashes, there are two threads synchronizing on the same object, mostly
a mutex. However, somehow, both threads end up inside the synchronized block at the same time.
This causes a crash when both threads notifyAll on the mutex, since the event queue gets mangled.
Sometimes the isLockOwner() check catches this situation, but sometimes not. Sometimes, even
when both threads are inside synchronized blocks at the same time, the mutex doesn't even
have a lock owner set.

Random thought: could a wait followed by a notifyAll in the same synchronized block be causing
problems? It looks like this scenario can happen in ActiveMQSessionExecutor::run, which is
a frequent location of crashes.

> Transacted session crashes or loses messages
> --------------------------------------------
>                 Key: AMQCPP-128
>                 URL:
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Albert Strasheim
>            Assignee: Timothy Bish
>             Fix For: 2.1
>         Attachments: main.cpp
> Attached is some code that does a few things with transacted sessions, in a loop. This
sometimes reproduces the crash I mentioned in one of my latest comments in AMQCPP-122.
> I'm testing on Windows XP SP2 with Visual Studio 8 on Core 2 Duo machine.
> I've also seen all of the following happen in subsequent runs of the code:
> - Where I expect to receive a message, nothing turns up (even with a long timeout period).
Cleanup goes fine.
> - Where I expect to receive a message, nothing turns up. Cleanup hangs.
> - Sometimes it prints:
> Mutex::unlock - Failed, not Lock Owner!
>         FILE: ..\src\main\activemq\concurrent\Mutex.cpp, LINE: 83
>         FILE: activemq-cpp\src\main\activemq/concurrent/Lock.h, LINE: 110
>         FILE: ..\src\main\activemq\core\ActiveMQConsumer.cpp, LINE: 443
>         FILE: ..\src\main\activemq\core\ActiveMQSessionExecutor.cpp, LINE: 192
> and keeps on going
> - Sometimes it crashes with the following when running a Debug build on Windows:
> ---------------------------
> Microsoft Visual C++ Debug Library
> ---------------------------
> Debug Assertion Failed!
> Program: ...
> File: C:\Program Files\Microsoft Visual Studio 8\VC\include\list
> Line: 776
> Expression: list erase iterator outside range
> For information on how your program can cause an assertion
> failure, see the Visual C++ documentation on asserts.
> (Press Retry to debug the application)
> ---------------------------
> Abort   Retry   Ignore   
> ---------------------------
> - Sometimes it crashes with something along these lines:
> ---------------------------
> vs2005-activemq-example.exe - Application Error
> ---------------------------
> The instruction at "0x0053dd80" referenced memory at "0xdddddddd". The memory could not
be "read".
> Click on OK to terminate the program
> Click on CANCEL to debug the program
> ---------------------------
> OK   Cancel   
> ---------------------------
> The relevant thread's stack trace looks like this:
> >	vs2005-activemq-example.exe!activemq::core::ActiveMQSession::close()  Line 110 +
0x8 bytes	C++
>  	vs2005-activemq-example.exe!activemq::core::ActiveMQSession::~ActiveMQSession()  Line
74 + 0x8 bytes	C++
>  	vs2005-activemq-example.exe!activemq::core::ActiveMQSession::`scalar deleting destructor'()
 + 0xf bytes	C++
>  	vs2005-activemq-example.exe!test_transaction(const std::basic_string<char,std::char_traits<char>,std::allocator<char>
> & url="tcp://localhost:61613?wireFormat=stomp")  Line 78 + 0x37 bytes	C++
>  	vs2005-activemq-example.exe!main(int argc=1, char * * argv=0x003558c8)  Line 85 + 0x30
bytes	C++
>  	vs2005-activemq-example.exe!__tmainCRTStartup()  Line 597 + 0x19 bytes	C
>  	vs2005-activemq-example.exe!mainCRTStartup()  Line 414	C
> It crashes where it's doing resource->close() because resource points to garbage.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message