* Problem with makecontext()
@ 1999-03-26 5:00 jtensin
1999-03-29 5:00 ` Jeff Denham
0 siblings, 1 reply; 4+ messages in thread
From: jtensin @ 1999-03-26 5:00 UTC (permalink / raw)
Greetings, all.
I have trouble calling makecontext() using Alpha/OSF1. For example,
the following "minimum" code just gives me a core dump on Alpha while
runs fine on Sparc/SunOs. Could someone help me out here? Many thanks
in advance.
-Jeff
/* cc min.c */
#include <stdlib.h>
#include <ucontext.h>
void *
do_nothing (void *arg)
{
return NULL;
}
int
main ()
{
ucontext_t *t;
if ( !(t=(ucontext_t *)malloc(sizeof(ucontext_t))) ) {
printf("error: malloc failed!\n");
return -1;
}
if ( getcontext(t) != 0 ) {
printf("error: getcontext failed!\n");
return -1;
}
makecontext(t, (void (*)())do_nothing, 2, 1);
return 1;
}
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: Problem with makecontext()
1999-03-26 5:00 Problem with makecontext() jtensin
@ 1999-03-29 5:00 ` Jeff Denham
1999-03-29 5:00 ` jtensin
0 siblings, 1 reply; 4+ messages in thread
From: Jeff Denham @ 1999-03-29 5:00 UTC (permalink / raw)
jtensin@my-dejanews.com wrote:
> Greetings, all.
>
> I have trouble calling makecontext() using Alpha/OSF1. For example,
> the following "minimum" code just gives me a core dump on Alpha while
> runs fine on Sparc/SunOs. Could someone help me out here? Many thanks
> in advance.
>
> -Jeff
>
> /* cc min.c */
> #include <stdlib.h>
> #include <ucontext.h>
>
> void *
> do_nothing (void *arg)
> {
> return NULL;
> }
>
> int
> main ()
> {
> ucontext_t *t;
>
> if ( !(t=(ucontext_t *)malloc(sizeof(ucontext_t))) ) {
> printf("error: malloc failed!\n");
> return -1;
> }
>
> if ( getcontext(t) != 0 ) {
> printf("error: getcontext failed!\n");
> return -1;
> }
> makecontext(t, (void (*)())do_nothing, 2, 1);
> return 1;
>
> }
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
What version of the OS? IIRC, I put a number of fixes for makecontext()/
swapcontext() into V4.0D. I don't know if they were ever turned
into patches for earlier releases. If you're running V4.0D, then I
can't help you, because I no longer have access to a DU system :^)
-- Jeff
__________________________________________________
Jeff Denham (jdenham@brighttiger.com)
Bright Tiger Technologies: Resource-management software
for building and managing fast, reliable web sites
See us at http://www.brighttiger.com
125 Nagog Park
Acton, MA 01720
Phone: (978) 263-5455 x177
Fax: (978) 263-5547
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: Problem with makecontext()
1999-03-29 5:00 ` Jeff Denham
@ 1999-03-29 5:00 ` jtensin
1999-03-29 5:00 ` Jeff Denham
0 siblings, 1 reply; 4+ messages in thread
From: jtensin @ 1999-03-29 5:00 UTC (permalink / raw)
In article <36FFBD1A.ACFFD222@brighttiger.com>,
Jeff Denham <jdenham@brighttiger.com> wrote:
>
> What version of the OS? IIRC, I put a number of fixes for makecontext()/
> swapcontext() into V4.0D. I don't know if they were ever turned
> into patches for earlier releases. If you're running V4.0D, then I
> can't help you, because I no longer have access to a DU system :^)
>
> -- Jeff
> __________________________________________________
> Jeff Denham (jdenham@brighttiger.com)
Sorry, it is V4.0.
Where can I find patches for makecontext() et al, if I may ask. Or
upgrading to V4.0D is a better idea?
Were there known problems with V4.0's makecontext()? Could
you please update me on it? Thanks.
-Jeff
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Problem with makecontext()
1999-03-29 5:00 ` jtensin
@ 1999-03-29 5:00 ` Jeff Denham
0 siblings, 0 replies; 4+ messages in thread
From: Jeff Denham @ 1999-03-29 5:00 UTC (permalink / raw)
jtensin@my-dejanews.com wrote:
> In article <36FFBD1A.ACFFD222@brighttiger.com>,
> Jeff Denham <jdenham@brighttiger.com> wrote:
> >
> > What version of the OS? IIRC, I put a number of fixes for makecontext()/
> > swapcontext() into V4.0D. I don't know if they were ever turned
> > into patches for earlier releases. If you're running V4.0D, then I
> > can't help you, because I no longer have access to a DU system :^)
> >
> > -- Jeff
> > __________________________________________________
> > Jeff Denham (jdenham@brighttiger.com)
>
> Sorry, it is V4.0.
>
> Where can I find patches for makecontext() et al, if I may ask. Or
> upgrading to V4.0D is a better idea?
I don't know whether the fixes were brought back to the V4.0
patch stream. Maybe somebody else can bring you up to
speed on finding current patch info over the web. I've been
away to long to remember.
If you choose to upgrade -- no a bad idea in this case -- you
should upgrade to V4.0E. This is the latest release and
incorporates many V4.0D fixes. No doubt there is already
an E patch kit out there as well.
>
> Were there known problems with V4.0's makecontext()? Could
> you please update me on it? Thanks.
The implementations of that SystemV *context stuff in V4.0
was frankly good enough to pass the UNIX 95 conformance
tests. Only when I got time to do some real-life work
with the routines did I discover their shortcomings.
The worst problem I recall was in the area of stack
management, but the whole thing got a pretty thorough
rework for 4.0D....
Sorry I can't help you with more details -- can't get to that old
source code any more :^(
-- Jeff
__________________________________________________
Jeff Denham (jdenham@brighttiger.com)
Bright Tiger Technologies: Resource-management software
for building and managing fast, reliable web sites
See us at http://www.brighttiger.com
125 Nagog Park
Acton, MA 01720
Phone: (978) 263-5455 x177
Fax: (978) 263-5547
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~1999-03-29 5:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-03-26 5:00 Problem with makecontext() jtensin
1999-03-29 5:00 ` Jeff Denham
1999-03-29 5:00 ` jtensin
1999-03-29 5:00 ` Jeff Denham
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox