• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: getcontext() -> Bus error?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getcontext() -> Bus error?


  • Subject: Re: getcontext() -> Bus error?
  • From: Anton Rang <email@hidden>
  • Date: Thu, 31 Jan 2008 21:42:30 -0600


On Jan 31, 2008, at 6:52 PM, Edd Dawson wrote:
int main(void)
{
ucontext_t ctx;
getcontext(&ctx);
return 0;
}
edd:guff developer$ gcc getcontext.c -o getcontext -W -Wall -ansi - pedantic
edd:guff developer$ ./getcontext
Bus error
edd:guff developer$


Why the bus error? What am I doing wrong?

While I don't understand why you're getting a bus error (haven't looked at the library source), the problem appears to go away if you declare ctx as a global instead of on the stack. Perhaps getcontext() just won't let you save context onto the stack....


Anton

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: getcontext() -> Bus error?
      • From: Kevin Van Vechten <email@hidden>
    • Re: getcontext() -> Bus error?
      • From: Steve Checkoway <email@hidden>
References: 
 >getcontext() -> Bus error? (From: Edd Dawson <email@hidden>)

  • Prev by Date: getcontext() -> Bus error?
  • Next by Date: Re: getcontext() -> Bus error?
  • Previous by thread: getcontext() -> Bus error?
  • Next by thread: Re: getcontext() -> Bus error?
  • Index(es):
    • Date
    • Thread