[Openmcl-devel] Getting a stuck process' stack trace

Gary Byers gb at clozure.com
Wed May 19 10:44:57 UTC 2004



On Wed, 19 May 2004, Sven Van Caekenberghe wrote:

> On 19 May 2004, at 10:58, Gary Byers wrote:
>
> > (CCL:PRINT-CALL-HISTORY :STACK-GROUP *sg*
> >                           :START-FRAME (CCL::%GET-FRAME-PTR *SG*))
>
> That works for me, but how do I get to see the actual error/condition ?

PRINT-CALL-HISTORY shows the raw contents of stack frames.  The condition
object seems to have been in a non-volatile register (whose symbolic
name is SAVE3); that register was saved in the 5th cell of frame 1.

The address of that frame is #x41B49CB0, which happens to be a bignum.
There are low-level stack accessors that take a frame address as an
argument, but they happen to want to want that argument to be in the
form of a fixnum.  A fixnum is a signed 30-bit integer shifted left
two bits (the low 2 bits are 0); it happens to be the case, then,
that you can represent any word-aligned address (whose low 2 bits
are clear) as an "equivalent" fixnum.

Word aligned addresses >= #x80000000 would be negative fixnums, but
in this case we can just shift the address #x41B49CB0 right two bits.
The saved register with the SOCKET-ERROR in it is the 5th value in
the stack frame whose address is #x41B49CB0 in the stack group *SG*;
the incantation to get that value would be:

? (ccl::nth-value-in-frame (ash #x41B49CB0 -2) 5 *sg*)

That should return a SOCKET-ERROR; it -might- have some an error
code or other information in it.

>
> ? ha::bar
> #<PROCESS execute-mailing(33) [terminal-input wait] #x5669ABE>
> ? (process-stack-group ha::bar)
> #<STACK-GROUP "execute-mailing" #x5669A56>
> ? (setf *sg* *)
> #<STACK-GROUP "execute-mailing" #x5669A56>
> ? (CCL:PRINT-CALL-HISTORY :STACK-GROUP *sg*
>                            :START-FRAME (CCL::%GET-FRAME-PTR *SG*))
> (41B49C90) : 0 "STACK-GROUP-RESUME" 316
>    0 CCL::ARG: NIL ("required")
>    1 : #<PROCESS aserve-accept-15(29) [input-wait] #x560BEBE> ("saved
> SAVE0")
>    2 : (0 . 252428) ("saved SAVE1")
>    3 : #<PROCESS execute-mailing(33) [Arrested] #x5669ABE> ("saved
> SAVE2")
>    4 : 224732693 ("saved SAVE3")
>    5 : *CURRENT-PROCESS* ("saved SAVE4")
>    6 CCL::YIELDTOTHREAD: 277506
>    7 CCL::*INTERRUPT-LEVEL*: 0 (:SAVED-SPECIAL)
>    8 : NET.ASERVE::*DEBUG-CURRENT*
>    9 : #<STACK-GROUP "aserve-accept-15" #x560BE56>
>    10 : CCL::*SCHEDULER-VALUE*
>    11 : NIL
>    12 : CCL::*RESUME-STACK-GROUP-ARG*
>    13 : CCL::*CURRENT-STACK-GROUP*
>    14 : CCL::*NEXT-STACK-GROUP*
>    15 : #<STACK-GROUP "aserve-accept-15" #x560BE56>
>
> (41B49CB0) : 1 "CCL::%ACTIVATE-PROCESS" 620
>    0 CCL::DONT-SET-IN-SCHEDULER: NIL ("required")
>    1 CCL::FUNCALL-STACK-GROUP: NIL ("optional")
>    2 : (#<PROCESS execute-mailing(33) [Arrested] #x5669ABE>) ("saved
> SAVE0")
>    3 : #<PROCESS aserve-accept-15(29) [input-wait] #x560BEBE> ("saved
> SAVE1")
>    4 : (#<PROCESS remote-repl-server(9) [input-wait] #x54801B6>
> #<PROCESS aserve-accept-15(29) [input-wait] #x560BEBE> #<PROCESS
> remote-repl(151) [Suspended] #x58D4816> #<PROCESS
> auto-flush-log-stream(8) [Sleeping] #x548006E> #<PROCESS
> session-reaper(10) [Sleeping] #x5485FA6>) ("saved SAVE2")
>    5 : #<SOCKET-ERROR #x587FB2E> ("saved SAVE3")
>    6 : #<URI
> http://www.handelsbeurs.be:2001/ha-dynsite/webaction?action=show-mail
> -1&definition-id=4942&subscriber-id=1682> ("saved SAVE4")
>    7 : 1463 ("saved SAVE5")
>    8 : NIL ("saved SAVE6")
>    9 CCL::NEXTTICK: 224732699
>    10 : (CCL::*SCHEDULER-VALUE*)
>
> (41B49CC0) : 2 NIL NIL
>
> (41B49CD0) : 3 "CCL::SCHEDULER" 312
>    0 : #<PROCESS execute-mailing(33) [Arrested] #x5669ABE> ("saved
> SAVE0")
>    1 : #<COMPILED-LEXICAL-CLOSURE #x587FB56> ("saved SAVE1")
>    2 : NIL ("saved SAVE2")
>    3 #:G17039: NIL
>
> (41B49CF0) : 4 "PROCESS-WAIT" 388
>    0 CCL::WHOSTATE: "terminal-input wait" ("required")
>    1 : #<COMPILED-LEXICAL-CLOSURE #x587FB56> ("required")
>    2 : NIL ("rest")
>    3 : #<PROCESS execute-mailing(33) [Arrested] #x5669ABE> ("saved
> SAVE0")
>    4 : CCL::*TERMINAL-INPUT-REQUESTS* ("saved SAVE1")
>    5 : FORMAT ("saved SAVE2")
>    6 CCL::OLD-WHOSTATE: "Suspended"
>
> (41B49D10) : 5 "CCL::%NOTE-TERMINAL-INPUT-REQUEST" 292
>    0 CCL::OWNER: #<PROCESS Initial(0) [Sleeping] #x50C87FE> ("required")
>    1 : #<PROCESS Initial(0) [Sleeping] #x50C87FE> ("saved SAVE0")
>    2 : #<PROCESS execute-mailing(33) [Arrested] #x5669ABE> ("saved
> SAVE1")
>    3 CCL::LOCK: #<LOCK #<PROCESS Initial(0) [Sleeping] #x50C87FE>
> #x5296F06>
>
> (41B49D20) : 6 "CCL::%REQUEST-TERMINAL-INPUT" 384
>    0 : NIL ("saved SAVE0")
>    1 : NIL ("saved SAVE1")
>    2 CCL::LOCK: #<LOCK #<PROCESS Initial(0) [Sleeping] #x50C87FE>
> #x5296F06>
>    3 CCL::INITIAL: #<PROCESS Initial(0) [Sleeping] #x50C87FE>
>
> (41B49D30) : 7 "CCL::BREAK-LOOP-HANDLE-ERROR" 300
>    0 CCL::ERROR-POINTER: 275588948 ("required")
>    1 : #<SOCKET-ERROR #x587FB2E> ("saved SAVE0")
>    2 : (:REMOTE-HOST "www.handelsbeurs.be" :REMOTE-PORT 2001 :FORMAT
> :BIVALENT :TYPE :STREAM :NODELAY T) ("saved SAVE1")
>    3 : 37 ("saved SAVE2")
>    4 : NIL ("saved SAVE3")
>    5 : #<URI
> http://www.handelsbeurs.be:2001/ha-dynsite/webaction?action=show-mail
> -1&definition-id=4942&subscriber-id=1682> ("saved SAVE4")
>    6 : 1463 ("saved SAVE5")
>    7 CCL::BOGUS-GLOBALS: NIL
>    8 CCL::NEWVALS: NIL
>    9 CCL::OLDVALS: NIL
>
> (41B49D40) : 8 "CCL::%ERROR" 112
>    0 CCL::ARGS: NIL ("required")
>    1 CCL::ERROR-POINTER: 275588948 ("required")
>    2 : 54 ("saved SAVE0")
>
> (41B49D50) : 9 "SOCKET-ERROR" 280
>    0 CCL::WHERE: "connect" ("required")
>    1 CCL::NAMESERVER-P: NIL ("required")
>    2 : #<A Mac Pointer #x41A48D60> ("saved SAVE0")
>
> (41B49D60) : 10 NIL NIL
>
> (41B49D70) : 11 "CCL::INET-CONNECT" 216
>    0 CCL::FD: 37 ("required")
>    1 CCL::HOST-N: 3557031083 ("required")
>    2 CCL::PORT-N: 2001 ("required")
>    3 : NIL ("saved SAVE0")
>
> (41B49D80) : 12 "CCL::MAKE-TCP-STREAM-SOCKET" 120
>    0 CCL::FD: 37 ("required")
>    1 REMOTE-HOST: "www.handelsbeurs.be" ("keyword")
>    2 : T ("key-supplied-p")
>    3 REMOTE-PORT: 2001 ("keyword")
>    4 : T ("key-supplied-p")
>    5 CCL::EOL: NIL ("keyword")
>    6 : NIL ("key-supplied-p")
>    7 FORMAT: :BIVALENT ("keyword")
>    8 : T ("key-supplied-p")
>    9 CLASS: CCL::TCP-STREAM ("keyword")
>    10 : NIL ("key-supplied-p")
>
> (41B49D90) : 13 "CCL::MAKE-TCP-SOCKET" 308
>    0 : NIL ("rest")
>    1 : NIL ("keyword")
>    2 : (:REMOTE-HOST "www.handelsbeurs.be" :REMOTE-PORT 2001 :FORMAT
> :BIVALENT :TYPE :STREAM :NODELAY T) ("key-supplied-p")
>    3 : :STREAM ("saved SAVE0")
>    4 : (:REMOTE-HOST "www.handelsbeurs.be" :REMOTE-PORT 2001 :FORMAT
> :BIVALENT :TYPE :STREAM :NODELAY T) ("saved SAVE1")
>    5 : NIL ("saved SAVE2")
>    6 CCL::FD: 37
>    7 CCL::SOCKET: NIL
>
> (41B49DB0) : 14 NIL NIL
>
> (41B49DC0) : 15 "MAKE-SOCKET" 320
>    0 : NIL ("rest")
>    1 : NIL ("keyword")
>    2 TYPE: :STREAM ("key-supplied-p")
>    3 : T ("keyword")
>    4 CCL::CONNECT: NIL ("key-supplied-p")
>    5 : NIL ("keyword")
>    6 REMOTE-HOST: "www.handelsbeurs.be" ("key-supplied-p")
>    7 : T ("keyword")
>    8 REMOTE-PORT: 2001 ("key-supplied-p")
>    9 : T ("keyword")
>    10 CCL::EOL: NIL ("key-supplied-p")
>    11 : NIL ("keyword")
>    12 FORMAT: :BIVALENT ("key-supplied-p")
>    13 : T ("keyword")
>    14 CCL::KEEPALIVE: NIL ("key-supplied-p")
>    15 : NIL ("keyword")
>    16 CCL::REUSE-ADDRESS: NIL ("key-supplied-p")
>    17 : NIL ("keyword")
>    18 CCL::NODELAY: T ("key-supplied-p")
>    19 : T ("keyword")
>    20 CCL::BROADCAST: NIL ("key-supplied-p")
>    21 : NIL ("keyword")
>    22 CCL::LINGER: NIL ("key-supplied-p")
>    23 : NIL ("keyword")
>    24 LOCAL-PORT: NIL ("key-supplied-p")
>    25 : NIL ("keyword")
>    26 LOCAL-HOST: NIL ("key-supplied-p")
>    27 : NIL ("keyword")
>    28 CCL::BACKLOG: NIL ("key-supplied-p")
>    29 : NIL ("keyword")
>    30 CLASS: NIL ("key-supplied-p")
>    31 : NIL ("keyword")
>    32 CCL::OUT-OF-BAND-INLINE: NIL ("key-supplied-p")
>    33 : NIL ("keyword")
>    34 LOCAL-FILENAME: NIL ("key-supplied-p")
>    35 : NIL ("keyword")
>    36 REMOTE-FILENAME: NIL ("key-supplied-p")
>    37 : NIL ("keyword")
>    38 CCL::KEYS: (:REMOTE-HOST "www.handelsbeurs.be" :REMOTE-PORT 2001
> :FORMAT :BIVALENT :TYPE :STREAM :NODELAY T) ("key-supplied-p")
>    39 : FORMAT ("saved SAVE0")
>    40 : :HTTP ("saved SAVE1")
>    41 : NET.ASERVE.CLIENT::CRLF ("saved SAVE2")
>    42 : (:REMOTE-HOST "www.handelsbeurs.be" :REMOTE-PORT 2001 :FORMAT
> :BIVALENT :TYPE :STREAM :NODELAY T)
>    43 : :STREAM
>    44 : T
>
> (41B49DD0) : 16 "ACL-COMPAT.SOCKET:MAKE-SOCKET" 76
>    0 ACL-COMPAT.SOCKET::CONNECT: :ACTIVE ("rest")
>    1 : NIL ("keyword")
>    2 ACL-COMPAT.SOCKET::PORT: NIL ("key-supplied-p")
>    3 : NIL ("keyword")
>    4 ACL-COMPAT.SOCKET::ARGS: (:REMOTE-HOST "www.handelsbeurs.be"
> :REMOTE-PORT 2001 :FORMAT :BIVALENT :TYPE :STREAM :NODELAY T)
> ("key-supplied-p")
>
> (41B49DE0) : 17 "NET.ASERVE.CLIENT:MAKE-HTTP-CLIENT-REQUEST" 912
>    0 : #<URI
> http://www.handelsbeurs.be:2001/ha-dynsite/webaction?action=show-mail
> -1&definition-id=4942&subscriber-id=1682> ("required")
>    1 METHOD: :GET ("keyword")
>    2 : T ("key-supplied-p")
>    3 NET.ASERVE.CLIENT::PROTOCOL: :HTTP/1.1 ("keyword")
>    4 : T ("key-supplied-p")
>    5 NET.ASERVE.CLIENT::KEEP-ALIVE: NIL ("keyword")
>    6 : T ("key-supplied-p")
>    7 NET.ASERVE.CLIENT::ACCEPT: "*/*" ("keyword")
>    8 : T ("key-supplied-p")
>    9 NET.ASERVE.CLIENT::COOKIES: #<NET.ASERVE.CLIENT:COOKIE-JAR
> #x5669B4E> ("keyword")
>    10 : T ("key-supplied-p")
>    11 NET.ASERVE.CLIENT::BASIC-AUTHORIZATION: NIL ("keyword")
>    12 : T ("key-supplied-p")
>    13 : NIL ("keyword")
>    14 : T ("key-supplied-p")
>    15 NET.ASERVE.CLIENT::CONTENT-LENGTH: NIL ("keyword")
>    16 : NIL ("key-supplied-p")
>    17 NET.ASERVE.CLIENT::CONTENT-TYPE: NIL ("keyword")
>    18 : T ("key-supplied-p")
>    19 NET.ASERVE.CLIENT::QUERY: NIL ("keyword")
>    20 : T ("key-supplied-p")
>    21 NET.ASERVE.CLIENT::HEADERS: NIL ("keyword")
>    22 : T ("key-supplied-p")
>    23 NET.ASERVE.CLIENT::PROXY: NIL ("keyword")
>    24 : T ("key-supplied-p")
>    25 NET.ASERVE.CLIENT::USER-AGENT: NIL ("keyword")
>    26 : T ("key-supplied-p")
>    27 NET.ASERVE.CLIENT::EXTERNAL-FORMAT: :LATIN1-BASE ("keyword")
>    28 : T ("key-supplied-p")
>    29 NET.ASERVE.CLIENT::SSL: NIL ("keyword")
>    30 : T ("key-supplied-p")
>    31 : #<TCP-STREAM (SOCKET/36) #x586B346> ("saved SAVE0")
>
> Obviously something went wrong opening a socket, probably a timeout,
> but I would want to know for sure...
>
> Thanks for the quick response...
>
> Sven
>
>



More information about the Openmcl-devel mailing list