• 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: is mach_vm_region confused or am I?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: is mach_vm_region confused or am I?


  • Subject: Re: is mach_vm_region confused or am I?
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Sat, 14 Apr 2012 11:31:15 +0700

On 14 Apr 2012, at 09:55, comex wrote:

> On Fri, Apr 13, 2012 at 9:47 PM, Gerriet M. Denkmann
> <email@hidden> wrote:
>> Doing:
>> pid_t pid = ... (of any 64-Bit process)
>> vm_map_t target_task = task_for_pid( pid ...)
>> mach_vm_address_t address = ...
>> mach_vm_size_t size
>> mach_vm_region( target_task, &address, &size, VM_REGION_TOP_INFO ...)
>>
>> I get:
>> size = 0x1000 (i.e. one page)
>> top.shared_pages_resident = 2
>>
>> When I do proc_regionfilename( pid, address, ... ) I get: "/usr/lib/dyld".
>>
>> Is mach_vm_region not to be trusted? Am I misunderstanding something?
>
> What address are you using?

I am using mach_vm_region() to iterate through all memory regions.
The address in question varies of course, but is not far below SHARED_REGION_BASE_X86_64.

> What does vmmap say about that address?

vmmap does NOT show top.shared_pages_resident. It just shows extended.pages_resident.
For Xcode I get:

vmmap -interleaved -resident <pid of Xcode>:
[...]
__DATA                 00007fff68ef6000-00007fff68ef7000 [    4K     4K] rw-/rwx SM=ZER  /usr/lib/dyld
__DATA                 00007fff68ef7000-00007fff68ef8000 [    4K     4K] rw-/rwx SM=COW  /usr/lib/dyld
[...]

But mach_vm_region( VM_REGION_TOP_INFO) has:
top.shared_pages_resident = 2 for both these regions.


Kind regards,

Gerriet.


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

This email sent to email@hidden

References: 
 >is mach_vm_region confused or am I? (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: is mach_vm_region confused or am I? (From: comex <email@hidden>)

  • Prev by Date: Re: is mach_vm_region confused or am I?
  • Next by Date: Info about memory objects
  • Previous by thread: Re: is mach_vm_region confused or am I?
  • Next by thread: Info about memory objects
  • Index(es):
    • Date
    • Thread