From: David Butenhof <David.Butenhof@compaq.com>
Subject: Re: Mutex corruption when using DECthreads
Date: Thu, 25 Oct 2001 09:04:57 -0400 [thread overview]
Message-ID: <X6UB7.948$RL6.10301@news.cpqcorp.net> (raw)
In-Reply-To: 3BD76D47.4235EF92@ot.com.au
Raj Calisa wrote:
> Hi all,
>
> We are using the following:
>
> Tru64 Unix 4.0F (patch kit 5), Compaq C++ 6.2-T009.
>
> We are currently faced with a wierd pthread_mutex_lock() failure
> in our application. Unfortunately, we do not know the
> return code. We only know that it is not "0". This is because
> the actual mutex lies hidden under two sets of C++ wrappers and
> the error code is neither propogated nor logged anywhere.
>
> We are almost convinced that this could be due to memory corruption
> and we are trying to use a tool called "Third degree" to find out
> if there is really any corruption. We are running the instrumented
> executable under ladebug and put a watch on the mutex in question. In the
> course of execution we get the following error:
>
> %DECthreads bugcheck (version V3.16-023), terminating execution.
> % Reason: selected a non-ready thread 28 (0x140dab880) state sorting
> % Running on OSF1 V4.0 on AlphaServer 1000A 5/500, 512Mb; 1 CPUs
What happens when you run the instrumented program WITHOUT the debugger?
The bugcheck you show is very likely the result of memory corruption,
though it's also possible that you've provoked some weird process state by
combining the instrumented binary with debugger watchpointing.
It's likely that your instrumentation and watchpointing has moved the
memory corruption, into a place with a slightly more dramatic failure mode.
> If we do not put a watch on the mutex, it fails on the mutex_lock call.
What do you mean, "it fails"? What fails? How? Do you mean you get the
failure you were looking for originally? Or some other failure...?
> Occasionally, we have seen another message as given below when we
> run the instrumented program on another machine:
>
> %DECthreads bugcheck (version V3.16-023), terminating execution.
> % Reason: schPriority: unrecognized class 0
> % Running on OSF1 V4.0 on AlphaServer 1200 5/533 4MB, 1024Mb; 1 CPUs
Again, this is likely a symptom of memory corruption.
> I wanted to know what the above errors mean and could they be related
> to the mutex corruption that we see.
>
> The mutex that we are using is a "normal" mutex not a errorcheck or
> recursive one. Is there a way of determining if the mutex is still
> valid by looking at the "lock" field?
You can guess, but you can't be entirely sure. For one thing, there's more
to "the mutex" than just the pthread_mutex_t. If you examine your
pthread_mutex_t, check first the valid and block fields. "valid" should be
0x05bcafe1L; block should be a valid address in the range returned by
malloc().
/------------------[ David.Butenhof@compaq.com ]------------------\
| Compaq Computer Corporation POSIX Thread Architect |
| My book: http://www.awl.com/cseng/titles/0-201-63392-2/ |
\-----[ http://home.earthlink.net/~anneart/family/dave.html ]-----/
prev parent reply other threads:[~2001-10-25 13:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-10-25 1:39 Mutex corruption when using DECthreads Raj Calisa
2001-10-25 13:04 ` David Butenhof [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox