Thread View: mod.computers.pyramid
1 messages
1 total messages
Started by andrew
Mon, 02 Feb 1987 04:33
Submission for mod-computers-pyramid
Author: andrew
Date: Mon, 02 Feb 1987 04:33
Date: Mon, 02 Feb 1987 04:33
53 lines
2264 bytes
2264 bytes
Path: vuwcomp!andrew
From: andrew@vuwcomp.UUCP (Andrew Vignaux)
Newsgroups: mod.computers.pyramid
Subject: Problems with chgstack()
Keywords: chgstack
Message-ID: <12615@vuwcomp.UUCP>
Date: 2 Feb 87 04:33:58 GMT
Organization: Comp Sci, Victoria Univ., Wellington, New Zealand
Lines: 43
I am having problems getting chgstack() to work. I can set up a
context but when I try returning to a previous context I get a Bus
error. This seems to be because chgstack() is placing a strange value
in the "codeaddr" field of the context and the system call has nowhere
to go when it returns.
Example:
struct context *to_context, *from_context;
extern int my_routine ();
. . .
malloc space etc.
. . .
to_context -> codeaddr = my_routine;
. . .
ret = chgstack (to_context, from_context);
. . . (much later in my_routine())
ret = chgstack (from_context, to_context);
Bus error!
"my_routine" gets called but the "from_context->codeaddr" is set
to a value inside the stack "range" and nowhere near my program. We
are running OSx 3.1.
The manual entry does not give an example so I am probably passing
something wrong. I am also confused about the pointers "stktop",
"stkcfp" and "stkbottom" and what I should initialise them to when I
make a new context.
Could someone either:
(a) tell me (e-mail) what I am doing wrong,
(b) send me an example program,
(c) tell me to give up and get back to my masters (:-)
Thanks,
Andrew
-------------------------------------------------------------
Rule Six: The winning team shall be the first team that wins.
UUCP: ...!{alberta,ubc-vision}!calgary!vuwcomp!andrew
ACSnet: andrew@vuwcomp.nz
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads