Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
* SEGFAULT on Tru64
@ 2000-09-08  8:51 Wai-Sun Chia
  2000-09-08 10:58 ` Dave Butenhof
  0 siblings, 1 reply; 2+ messages in thread
From: Wai-Sun Chia @ 2000-09-08  8:51 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 216 bytes --]

Hello,
Here's a dbx/ladebug trace on my multithreaded server which always
segfaults within 10 minutes of run:




This is on a Tru64 4.0f system.

-- 
Wai-Sun "squidster" Chia
Web/Unix Developer
Professional Services

[-- Attachment #2: cd --]
[-- Type: text/plain, Size: 846 bytes --]

[cmd]$ dbx cmd core
dbx version 3.11.10
Type 'help' for help.
Core file created by program "cmd"

thread 0x13 signal Segmentation fault at 
warning: PC value 0xa805c0f90 not valid, trying RA

warning: RA value 0xa805c0f90 not valid, trying text start

warning: text start 0x120000000 not valid, trying data start

warning: Using data start as a text address -- traceback will not work
> [., 0x140000000] 	call_pal	cflush
(dbx) where
   0 (noname)() [0x11ffffffc]
(dbx) 
   where
      0 (noname)() [0x11ffffffc]
(dbx) q


[cmd]$ ladebug cmd core
Welcome to the Ladebug Debugger Version 4.0-62 (built Jun  2 2000)
------------------ 
object file name: cmd 
core file name: core
Reading symbolic information ...done
Core file produced from executable 'cmd'
Thread 0x3eb2 terminated at PC 0xa805c0f90 by signal SEGV
(ladebug) where
>0  0xa805c0f90


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: SEGFAULT on Tru64
  2000-09-08  8:51 SEGFAULT on Tru64 Wai-Sun Chia
@ 2000-09-08 10:58 ` Dave Butenhof
  0 siblings, 0 replies; 2+ messages in thread
From: Dave Butenhof @ 2000-09-08 10:58 UTC (permalink / raw)


Wai-Sun Chia wrote:

> Here's a dbx/ladebug trace on my multithreaded server which always
> segfaults within 10 minutes of run:
>
> This is on a Tru64 4.0f system.
>
> [cmd]$ ladebug cmd core
> Welcome to the Ladebug Debugger Version 4.0-62 (built Jun  2 2000)
> ------------------
> object file name: cmd
> core file name: core
> Reading symbolic information ...done
> Core file produced from executable 'cmd'
> Thread 0x3eb2 terminated at PC 0xa805c0f90 by signal SEGV
> (ladebug) where
> >0  0xa805c0f90

You've almost certainly corrupted your stack. With so little information, I
can only do so much random guessing about how you might have done it, but
I can offer a few tips. The places to start looking are writing through an
uninitialized pointer, using out of scope shared data, (especially when one
thread tries to share data on another thread's stack), or a misunderstanding
of some API. The possibilities, unfortunately, are almost endless.

Specifically, (though this may not help you much), you've very likely
overwritten the saved RA (r26) of a stack frame, sending the thread into
"hyperspace" when that frame tries to return. A great way to do this is to
write (or cause an API to write) into a short data type via a pointer that
was cast as if it pointed to a larger type. I used to see this a lot by
people who tried to return the "void*" value of a pthread_join into an "int
value", for example, carefully casting "&value" (pointer to a 32-bit value)
to "(void**)&value" (pointer to a 64-bit value) to keep the compiler from
complaining. This can easily happen a lot in code that was originally written
using some of the bad assumptions people learn on 32-bit systems, but is less
likely from people with some awareness of 64-bit programming. (Which is
probably why I haven't seen this one for a long time.)

/------------------[ David.Butenhof@compaq.com ]------------------\
| Compaq Computer Corporation   http://members.aol.com/drbutenhof |
| 110 Spit Brook Rd ZKO2-3/Q18, Nashua NH 03062-2698              |
\--------[ http://www.awl.com/cseng/titles/0-201-63392-2/ ]-------/



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-09-08 10:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-09-08  8:51 SEGFAULT on Tru64 Wai-Sun Chia
2000-09-08 10:58 ` Dave Butenhof

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox