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

Yosemite compatibility? #13

Closed
ni4 opened this issue Sep 2, 2014 · 9 comments
Closed

Yosemite compatibility? #13

ni4 opened this issue Sep 2, 2014 · 9 comments

Comments

@ni4
Copy link

ni4 commented Sep 2, 2014

Hi. I tried mach_inject + some Finder integration code on Mac OS X 10.10 Yosemite (Beta6) - and it fails in injected thread, on the first fopen/freopen/fwrite function call.
Everything works fine on Mavericks.

Anyone more experienced tried to run mach_inject on Yosemite? Or, somebody can recommend a way to debug this issue?
Thanks, all input is appreciated.

@abestam
Copy link

abestam commented Sep 3, 2014

Hello,

I have the same issue, do you have the following error??

com.apple.xpc.launchd1: Endpoint has been activated through legacy launch(3) APIs. Please switch to XPC or bootstrap_check_in(): com.apple.ReportCrash
Sep 3 17:03:33 iMac-de-admin com.apple.xpc.launchd1: Service exited due to signal: Segmentation fault: 11

Applications which use this, like dropbox is not working.

do you find a way to fix or debut that ??

Thanks,

@ni4
Copy link
Author

ni4 commented Sep 9, 2014

I have just a segmentation fault in inject code, but most likely it's the same problem as yours.
Unfortunately, do not have a way to fix it at the moment - focused on other tasks.

@iccir
Copy link

iccir commented Sep 16, 2014

Try removing the fprintf debugging code from INJECT_ENTRY in mach_inject_bundle_stub.c. It's ultimately trying to take out a pthread lock, but it's not safe to do so until we are inside pthread_entry

@abestam
Copy link

abestam commented Sep 17, 2014

It's working back to normal !!!!

Thanks

@ni4
Copy link
Author

ni4 commented Sep 19, 2014

Thank you very much, it worked.
And it seems that without this modifications it was failing sometimes on 10.9, or am I wrong with this?
And, btw, why it worked on 10.9 and stopped to work at 10.10, any ideas?

@kunalparmar
Copy link

Removing fprintf from INJECT_ENTRY fixed the problem for me as well. I'm not sure I understand what pthread lock it was trying to take out? Can you explain? Thanks @iccir

@iccir
Copy link

iccir commented Oct 4, 2014

Effectively, when we are in INJECT_ENTRY, we are in a very hostile environment and limited in what we can call. We have no idea what the state of the rest of the app is, and are limited to calling async-safe APIs.

See Landon Fuller's excellent article for more information about this: http://landonf.bikemonkey.org/code/objc/Reliable_Crash_Reporting.20110912.html

I can't remember the exact backtrace in the crash log, but fprintf() was calling into other functions which eventually tried to take out a lock, and hit an assertion in the pthread code.

Rainburst added a commit to hexrain/mach_inject that referenced this issue Oct 14, 2014
@hexrain
Copy link

hexrain commented Oct 15, 2014

It was fixed(hopefully) in #14
Should we close this issue?

@ni4
Copy link
Author

ni4 commented Oct 17, 2014

Yes, I think it can be closed now.

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

No branches or pull requests

6 participants