Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i#1979 Mac64: small app support on Mojave #3833

Merged
merged 1 commit into from
Sep 16, 2019
Merged

Conversation

derekbruening
Copy link
Contributor

Fixes several issues to get small 64-bit apps to run on Mojave:

  • Fixes library discovery problems with the dyld shared cache.
    On Mojave, SYS_shared_region_check_np returns the whole lib region,
    while the existing code assumed its return value was the shared
    __LINKEDIT segment.

  • Demotes a DOCHECK at level 1 in check_thread_vm_area to 3 for
    Mac64 as it shows up as a large performance hit apparently due
    to slow memory queries.

  • Segment fixes: fixes two issues hit due to DR and lib segments being
    equal: a bb building assert for -no_mangle_app_seg and a
    dr_insert_get_seg_base() assert.

  • Attempts to reduce overhead in memquery_from_os() where it needs extra
    iterations to find the surrounding bounds of a free area, by walking
    backward instead of starting from 0.

  • Uses SYS_stat64 and SYS_fstat64 for stat syscalls.

  • Basic signal support:

    • dynamorio_sigreturn() syscall number.
    • master_signal_handler() setup to invoke sigreturn with the proper arguments.
    • Accessing the frame within master_signal_handler_C().
    • No support yet for AVX512 but put some pieces in place and comments for
      future work.
    • fixup_rtframe_pointers() and copy_frame_to_stack().
    • execute_handler_from_dispatch(): set up arguments for app handler,
      including the style.
    • handle_sigreturn(): obtain signal number from siginfo.

Issue: #1979

Fixes several issues to get small 64-bit apps to run on Mojave:

+ Fixes library discovery problems with the dyld shared cache.
  On Mojave, SYS_shared_region_check_np returns the whole lib region,
  while the existing code assumed its return value was the shared
  __LINKEDIT segment.

+ Demotes a DOCHECK at level 1 in check_thread_vm_area to 3 for
  Mac64 as it shows up as a large performance hit apparently due
  to slow memory queries.

+ Segment fixes: fixes two issues hit due to DR and lib segments being
  equal: a bb building assert for -no_mangle_app_seg and a
  dr_insert_get_seg_base() assert.

+ Attempts to reduce overhead in memquery_from_os() where it needs extra
  iterations to find the surrounding bounds of a free area, by walking
  backward instead of starting from 0.

+ Uses SYS_stat64 and SYS_fstat64 for stat syscalls.

+ Basic signal support:
  + dynamorio_sigreturn() syscall number.
  + master_signal_handler() setup to invoke sigreturn with the proper arguments.
  + Accessing the frame within master_signal_handler_C().
  + No support yet for AVX512 but put some pieces in place and comments for
    future work.
  + fixup_rtframe_pointers() and copy_frame_to_stack().
  + execute_handler_from_dispatch(): set up arguments for app handler,
    including the style.
  + handle_sigreturn(): obtain signal number from siginfo.

Issue: #1979
@derekbruening
Copy link
Contributor Author

Appveyor failure is client.thread last_lock assert: #3560.

@derekbruening derekbruening merged commit 030ed9b into master Sep 16, 2019
@derekbruening derekbruening deleted the i1979-mac64-mojave branch September 16, 2019 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant