deadlock

Delphi: Debug critical section hang by reporting call stack of running threads on lock "failure"

I'm looking for a way to debug a rare Delphi 7 critical section (TCriticalSection) hang/deadlock. In this case, if a thread is waiting on a critical section for more than say 10 seconds, I'd like to produce a report with the stack trace of both the thread currently locking the critical section and also the thread that failed to be able ...

Deadlock issue in SQL Server 2008 R2 (.Net 2.0 Application)

The Sql Server 2008 R2 instance in question is a heavy load OLTP production server. The deadlock issue came up a few days back and is still unresolved. We received the Xml deadlock report that listed the stored procedures involved in the deadlock and some other details. I'll try to list down the facts from this xml first: Two stored pro...

Strange thread dump on deadlock

We've been experiencing a strange deadlock during the startup of our java application. When I run jstack on the application to investigate, I see that the AWT-EventQueue is in Object.wait(), but the thread is still marked as RUNNABLE. I've included the relevent parts of the thread dump, and I'm hoping that someone can shed some light o...

What is meant by ClientOption1 and ClientOption2 in 1222 deadlock graph?

I came across the following in an MSDN Article: clientoption1 and clientoption2. Set options on this client connection. This is a bitmask that includes information about options usually controlled by SET statements such as SET NOCOUNT and SET XACTABORT. Where can I find more information on them? For e.g. in my deadlock ...

How to get stack trace of a thread

I have a multithreaded application. Several messages are coming to the application and are processed in separated threads. For this I am using classes ThreadPoolExecutor and FutureTask from package java.util.concurrent. Occasionally I have some deadlocks in the application. When a deadlock occurs I want to interrupt the blocking thread ...

WCF exception received on closing connection with callbacks in use

Hey there all, I am using a netNamedPipeBinding to perform inter-process WCF communication from a windows app to a windows service. Now my app is running well in all other accounts (after fighting off my fair share of WCF exceptions as anybody who has worked with WCF would know..) but this error is one that is proving to be quite resil...

When is innodb_lock_wait_timeout ignored ?

Related to my other questions, I'm having a weird case of the classic deadlock exception: Caused by: java.sql.BatchUpdateException: Deadlock found when trying to get lock; try restarting transaction. blablalbla... The code is identified and indeed, it's possible to get a deadlock. The thing is that I'm getting the exception immediatly. ...

Java process.getInputStream() has nothing to read, deadlocks child

I am having an issue with some process wrapping, and it's only occurring in Windows XP. This code works perfectly in Windows 7. I'm really stumped as to why the streams are empty in XP. I've also tried using the String[] version of Process.Exec() and it made no difference. I am using the following class to read from the process' STDO...

C#: deadlock when invoking the UI thread from a worker thread

Hi all, I have a deadlock when I invoke the UI thread from a worker thread. Indeed, the worker thread is blocked on the invoke line: return (ucAvancementTrtFamille)mInterfaceTraitement.Invoke(d, new object[] { psFamille }); The weird thing is that the UI Thread (which, correct me if I'm wrong, is the main thread) is idle. Is there a...

WCF App recieving multiple requests per second causing other asp.net apps to stop responding and deadlock

We have a WCF Service using a wsHttpBinding. When it recieves many requests in a short period of time (25 per second for a few minutes) it stops working and our other asp.net applications and pages to stop responding as well. Some of them timeout and eventually we see the following in the event viewer: ISAPI 'c:\windows\microsoft.net\...

When the UI thread is sleeping, can invoke methods from background threads block indefinitely?

When I call Thread.Sleep on the UI thread, does all invoke methods from background thread automatically get queued up in the message pump of the UI thread and processed when it eventually wakes up? I'm having problems with a winform app that uses a lot of threadpool threads and sometimes the app hangs after locking/unlocking Windows. On...

Thread deadlock in J2EE application

I am a newbie to J2EE. I wonder if there are some common deadlock cases in J2EE application layer, resulting from using Java synchronization primitive - synchronized keyword. If yes, could help give an example? Thanks a lot! ...

When does InnoDB time out instead of reporting deadlock?

I have a "Lock wait timeout exceeded" error from MySQL that I can't reproduce or diagnose. I'm sure it's deadlock (as opposed to a transaction grabbing a lock then twiddling its thumbs), because my logs show that another process started at the same time, also hung, then continued when the first timed out. But normally, InnoDB detects d...

callback in wcf window service

I've created a test winform application with a test button which access a wcf window service. i want to callback to client at certain condition from window service. I've configure my window service as you depicted in your example but even then when i debug the code it doesn't step in to call back funcyion and application went to dealoc...

Why is this a deadlock (MySQL using InnoDB)

SHOW INNODB ENGINE STATUS shows me this and calls it deadlock: LATEST DETECTED DEADLOCK 100923 22:29:21 * (1) TRANSACTION: TRANSACTION 0 5335752, ACTIVE 0 sec, OS thread id 7992 inserting mysql tables in use 1, locked 1 LOCK WAIT 5 lock struct(s), heap size 1024, 4 row lock(s), undo log entries 3 MySQL thread id 26, query id 14422 lo...

How to retry a transaction that has failed because of a deadlock?

I use linq-sql and this is what I need. Sub Commit() Try StepStart: Transaction Scope Serialized Begin Transaction Check BusinessRule1 Check BusinesRule2 if BusinessRulesFailed { Transaction.Rollback } else { Query = db.out db.SubmitChanges() Transaction.Commit() } Catch DeadLockException Goto StepStart End Try End Sub Is it ok ...

Dead lock is happening same data base record updating in multiple connection sessions concurrently

We have implemented client server socket based application to process multiple shopping cart requests. Daily we receive thousands of shopping cart requests. For this we implemented multi threaded architecture to process requests concurrently. We are using Oracle Connection Pool for data base operations and we set optimal value for conn...

Is Deadlock recovery possible in MultiThread programming ?

Process has some 10 threads and all 10 threads entered DEADLOCK state( assume all are waiting for Mutex variable ). How can you free process(threads) from DEADLOCK state ? . Is there any way to kill lower priority thread ?( in Multi process case we can kill lower priority process when all processes in deadlock state). Can we attach th...

Code with a potential deadlock

// down = acquire the resource // up = release the resource typedef int semaphore; semaphore resource_1; semaphore resource_2; void process_A(void) { down(&resource_1); down(&resource_2); use_both_resources(); up(&resource_2); up(&resource_1); } void process_B(void) { down(&resource_2); down(&resour...

'deadlock detected' error in rails

Hi, I have deadlock detected error in my code and don't understand why. Could someone please tell me what am I doing wrong? #!/usr/bin/ruby ENV['RAILS_ENV'] = ARGV.first || ENV['RAILS_ENV'] || 'development' require File.expand_path(File.dirname(__FILE__) + "/config/environment") mutex = Mutex.new threads = [] 1.upto(10) do |i| t...