• 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: EXC_BAD_ACCESS when running from different drive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EXC_BAD_ACCESS when running from different drive


  • Subject: Re: EXC_BAD_ACCESS when running from different drive
  • From: Marshall Clow <email@hidden>
  • Date: Wed, 28 Sep 2005 10:23:30 -0700

At 10:05 AM -0700 9/28/05, Stefan Werner wrote:
Hi,

a closer look reveals that apparently, when run from the root drive, my program's resources (read from a .rsrc file inside the MachO app bundle) are in a read-only memory area (at least, any attempt to write over loaded resources fails) where they're writable when my program is being launched from a non-boot drive.

Is this expected behavior? Are resources supposed to be in read-only memory and my program is misbehaving?

Yes, this is expected (by some) behavior.

Resource files that are opened readonly for you (like ones in your bundle) are mapped into your address space (read only), rather than being read into memory. This means that you can't go poking into the resources, (like PowerPlant did with it's font handling). It also means that any alignment guarantees that you might expect are null and void (things like handles being aligned on 16 byte boundaries - handy for Altivec, say).

If the file can't be mapped into your address space, then the resource file is opened "normally", and resources are read into memory as you request them.
--
-- Marshall


Marshall Clow     Idio Software   <mailto:email@hidden>

It is by caffeine alone I set my mind in motion.
It is by the beans of Java that thoughts acquire speed,
the hands acquire shaking, the shaking becomes a warning.
It is by caffeine alone I set my mind in motion.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: EXC_BAD_ACCESS when running from different drive
      • From: Chris Espinosa <email@hidden>
References: 
 >EXC_BAD_ACCESS when running from different drive (From: Stefan Werner <email@hidden>)
 >Re: EXC_BAD_ACCESS when running from different drive (From: Daniel Hazelbaker <email@hidden>)
 >Re: EXC_BAD_ACCESS when running from different drive (From: Stefan Werner <email@hidden>)

  • Prev by Date: Re: viewing globals?
  • Next by Date: Xcode 2.1 FRAMEWORK_SEARCH_PATHS?
  • Previous by thread: Re: EXC_BAD_ACCESS when running from different drive
  • Next by thread: Re: EXC_BAD_ACCESS when running from different drive
  • Index(es):
    • Date
    • Thread