• 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: catching EXC_BAD_ACCESS?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: catching EXC_BAD_ACCESS?


  • Subject: Re: catching EXC_BAD_ACCESS?
  • From: Jonas Maebe <email@hidden>
  • Date: Mon, 21 Nov 2005 15:59:16 +0100


On 21 nov 2005, at 15:43, Jonas Maebe wrote:

I've now tried a 64bit version and sure enough, that one always crashes with a SIGBUS when returning from the signal handler, even if the handler doesn't do anything. Warrants a radar, I'd say. I've put the adjusted 64bit version of the test program below (which, as I said, crashes even if you remove all code from "signal_handler"):

Found the solution! Change

sa.sa_flags = SA_SIGINFO;

into

sa.sa_flags = SA_SIGINFO|SA_64REGSET;

Now the program I posted works fine when compiled for 64bit.

The comments in /usr/include/sys/signal.h say SA_64REGSET is only necessary to get access to the 64bit registers when you're in 32bit mode, but apparently it's also required for 64bit mode (or do you have to use another option besides -m64 to get a "proper" 64bit program?)


Jonas

PS: is it expected that "otool -L" fails on 64 bit programs? I get

$ file sig4
sig4: Mach-O 64-bit executable ppc64
$ otool -L sig4
sig4: is not an object file
_______________________________________________
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: catching EXC_BAD_ACCESS?
      • From: Brad Parker <email@hidden>
    • Re: catching EXC_BAD_ACCESS?
      • From: "Peter O'Gorman" <email@hidden>
References: 
 >Re: catching EXC_BAD_ACCESS? (From: Brad Parker <email@hidden>)
 >Re: catching EXC_BAD_ACCESS? (From: Jonas Maebe <email@hidden>)

  • Prev by Date: Re: catching EXC_BAD_ACCESS?
  • Next by Date: Re: catching EXC_BAD_ACCESS?
  • Previous by thread: Re: catching EXC_BAD_ACCESS?
  • Next by thread: Re: catching EXC_BAD_ACCESS?
  • Index(es):
    • Date
    • Thread