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

Makes anything that uses open on Mac OS X not work properly. #11

Closed
ghost opened this issue Dec 17, 2011 · 18 comments
Closed

Makes anything that uses open on Mac OS X not work properly. #11

ghost opened this issue Dec 17, 2011 · 18 comments

Comments

@ghost
Copy link

ghost commented Dec 17, 2011

I installed stderred on Mac OS X (10.6.8) and whenever the open command line utility is called, it will fail to run. The application that is opened will hang unless it is already open.

@ku1ik
Copy link
Owner

ku1ik commented Dec 17, 2011

@solnic, @psionides, @kitschpatrol and @jcoveney, can you confirm that guys?

@kitschpatrol
Copy link

Yes I've noticed that on my end.

On Dec 17, 2011, at 6:48 PM, Marcin Kulikreply@reply.github.com wrote:

@solnic, @psionides, @kitschpatrol and @jcoveney, can you confirm that guys?


Reply to this email directly or view it on GitHub:
#11 (comment)

@ku1ik
Copy link
Owner

ku1ik commented Dec 18, 2011

That's bad. Unfortunately I don't have any Mac at hand to debug this.

@ku1ik
Copy link
Owner

ku1ik commented Dec 19, 2011

@mr-szymanski, @kitschpatrol,

can you guys run:

strace open somecommand

and paste the output? Sth weird is happening there.

@ghost
Copy link
Author

ghost commented Dec 19, 2011

@sickill There is no strace command on Mac OS X.

@ku1ik
Copy link
Owner

ku1ik commented Dec 19, 2011

Oh, you're right. But there is ktrace, I don't know if the usage is similar though.

@ghost
Copy link
Author

ghost commented Dec 19, 2011

@sickill ktrace doesn't exist, either.

@jcoveney
Copy link

Can someone post an example of a command that is dying? Because I haven't run into any errors, and open still works. I'm on 10.6 though, maybe on 10.7 it breaks.

As far as a strace replacement, does this work?
http://stackoverflow.com/questions/1925978/equivalent-of-strace-feopen-command-on-mac-os-x

@ghost
Copy link
Author

ghost commented Dec 21, 2011

@jcoveney: Example:

touch test.txt
open test.txt # Make sure TextEdit is *not* already open, that's when the open command fails, otherwise it works

TextEdit will show in the dock but will hang and not open the file.

Also, that did not work.

@jcoveney
Copy link

Ok, thanks. I was able to get the error.

This looks to be how to get dtruss to work:

sudo dtruss -f su -l jcoveney cd /Users/jcoveney && open test.txt

something interesting to note: sudo open test.txt does work without issue, whereas a normal open.txt hangs on opening (which is why above you need to make sure to run the open as yourself).

Here is the result:
http://pastebin.com/GnmBiU6j

Let me know if anything else would be useful.

@ku1ik
Copy link
Owner

ku1ik commented Dec 21, 2011

@jcoveney thx for dtruss dump. I don't see stderred.dylib/so anywhere in there. Also there are no plain write() calls, there are some write_nocancel() ones but with stdout file descriptor.

@ku1ik
Copy link
Owner

ku1ik commented Dec 23, 2011

I just found out that DYLD_FORCE_FLAT_NAMESPACE=1 (not stderred.dylib) breaks Cocoa apps.
DYLD_FORCE_FLAT_NAMESPACE is required for DYLD_INSERT_LIBRARIES to work.

Temporary solution for you would be to create alias like this:

alias open='unset DYLD_FORCE_FLAT_NAMESPACE; /usr/bin/open'

@ku1ik
Copy link
Owner

ku1ik commented Dec 23, 2011

Alternative to DYLD_INSERT_LIBRARIES: http://www.mikeash.com/pyblog/friday-qa-2009-01-30-code-injection.html#comment-3fb6e4b8cf65ec984e7836e2b86a2875

Needs more investigation though.

@cehoffman
Copy link
Collaborator

I'm on 10.7.3 and haven't had any issues with the DYLD_FORCE_FLAT_NAMESPACE being set when launching apps from the command line. However, just to be safe I went ahead and took the piece referenced above and implemented it for stderred` with great success. You can see what I did at cehoffman@f94a9fd0dc9fd583261b77f4cb53d569394b2913.

@ku1ik
Copy link
Owner

ku1ik commented Apr 29, 2012

@cehoffman awesome! Please let me know when you'll be confident about this code and I'll be happy to merge it.

@ku1ik
Copy link
Owner

ku1ik commented May 8, 2012

I have just merged pull request by @cehoffman that hopefully solves this issue once for all. Whoever is still observing this thread, can you please check latest version from master and let me know how it works for you?

@kitschpatrol
Copy link

It's working fine for me! 10.7.3.

@ku1ik
Copy link
Owner

ku1ik commented Jan 10, 2013

It seems it's no longer an issue, closin.

@ku1ik ku1ik closed this as completed Jan 10, 2013
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

4 participants