Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: denham@denham.zk3.dec.com (Jeffrey M. Denham)
Subject: Re: Invalid memory address (dce / thd)
Date: 1995/04/13	[thread overview]
Message-ID: <1995Apr13.133734.17776@decvax.dec.com> (raw)
In-Reply-To: 3m0h11$mso@lyra.csx.cam.ac.uk


In article <3m0h11$mso@lyra.csx.cam.ac.uk>, thg@cam-orl.co.uk (Tim Glauert) writes:
|>
|>I'm trying to debug a pthreads program on DEC OSF1 V2.0 on an Alpha.
|>I frequently get "Exception: Invalid memory address (dce / thd)" but
|>there is no indication of which piece of code has caused this error.
|>I've succesfully caught the exception using the TRY and CATCH macros
|>but this doesn't appear to help much since I still can't find the
|>offending address!  Is there *any* way to get the pthreads package to
|>tell me which piece of code causes this invalid memory reference?
|>
|>        Tim.
|>
|>Tim Glauert, Olivetti Research Limited,     | EMAIL  TGlauert@cam-orl.co.uk
|>24a Trumpington Street, Cambridge, England. | TEL       +44 1223 343232
|>                                            | FAX       +44 1223 313542
|>

The threads library establishes signal handler for all the exception
signals, such SEGV, ILL, BUS, TRAP. This is what allows it to do try-catch,
report errors, etc.

One crude way to deal with this is to replace the thread library's handlers
with your own. If you request SA_SIGINFO in your sigaction request, you'll
get a siginfo structure reporting the fault data. This is also available
in the sigcontext structure passed to the handler. See the sigaction
man page. 

Even cruder, is to replace the library's handler's with the
default action. This will cause the dying program to dump core. You can
then examine the treads' stack and memory by debugging the core file.

A similar approach is to try running the application under debugger control.
The debugger should be notified of the fault before the library's handler
gets called. You can then so a simple stack trace to locate the problem.

-- 

-----------------------------------------------------------------------------
Jeff Denham, Unix Software Group, Digital Equipment Corporation
email: denham@zk3.dec.com, voice: (603) 881-0057



  reply	other threads:[~1995-04-13  4:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-04-06  4:00 Invalid memory address (dce / thd) Tim Glauert
1995-04-13  4:00 ` Jeffrey M. Denham [this message]
  -- strict thread matches above, loose matches on Subject: below --
1994-01-07 19:00 Mark Day
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