Permission Denied Running DebugServer

Hi,
When I try and debug something I get this in the the logs

2014-04-25 8:16:36.927 PM Fire[1964]: xbuild /Users/JohnMoshakis/Documents/develop/Nougat/BindToIntegerCocoaApplication/BindToIntegerCocoaApplication.sln /nologo /target:Build /verbosity:normal /property:Configuration=Debug /toolsversion:4.0
2014-04-25 8:16:56.933 PM Fire[1964]: xbuild /Users/JohnMoshakis/Documents/develop/Nougat/BindToIntegerCocoaApplication/BindToIntegerCocoaApplication.sln /nologo /target:Build /verbosity:normal /property:Configuration=Debug /toolsversion:4.0
2014-04-25 8:16:58.043 PM com.apple.debugserver-310.2[2340]: debugserver-310.2 for x86_64.
2014-04-25 8:16:58.044 PM com.apple.debugserver-310.2[2340]: 1 +0.000000 sec [0924/0303]: error: ::posix_spawnp ( pid => 2341, path = ‘/Users/JohnMoshakis/Documents/develop/Nougat/BindToIntegerCocoaApplication/bin/Debug/OS X/BindToIntegerCocoaApplication.app/Contents/MacOS/BindToIntegerCocoaApplication’, file_actions = 0x7fff57e82328, attr = 0x7fff57e82348, argv = 0x7f957a700f50, envp = 0x7f957a700f60 ) err = Permission denied (0x0000000d)
2014-04-25 8:16:58.044 PM com.apple.debugserver-310.2[2340]: 2 +0.000253 sec [0924/0303]: RNBRunLoopLaunchInferior DNBProcessLaunch() returned error: 'Permission denied’
2014-04-25 8:16:58.045 PM com.apple.debugserver-310.2[2340]: error: failed to launch process /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/Resources/debugserver: Permission denied
2014-04-25 8:16:58.045 PM com.apple.debugserver-310.2[2340]: Exiting.

Cheers,
John

Curious.

is “/Users/JohnMoshakis/Documents/develop/Nougat/BindToIntegerCocoaApplication/bin/Debug/OS X/BindToIntegerCocoaApplication.app/Contents/MacOS/BindToIntegerCocoaApplication” a valid and full path to your executable? does it have +x set?

Also, it looks like you trimmed the log — can you post the full thing?

did you trim that log file before you posted it? can you post the full thing? (i don’t need the build, but everything after it starting with the launch of crossboxhelper…

I dont seem to be able to reproduce this now. The application still isnt running under the debugger.

I get this in the logs

2014-04-27 12:27:38.990 PM Fire[4993]: xbuild /Users/JohnMoshakis/Documents/develop/Nougat/DebugMeConsoleApplication/DebugMeConsoleApplication.sln /nologo /target:Build /verbosity:normal /property:Configuration=Debug /toolsversion:4.0
2014-04-27 12:27:40.001 PM com.apple.debugserver-310.2[5230]: debugserver-310.2 for x86_64.
2014-04-27 12:27:40.020 PM com.apple.debugserver-310.2[5230]: Listening to port 10692 for a connection from 0.0.0.0…

Which is strange because i’m using a solution with 2 projects

DebugMeCocoaApplication and DebugMeConsoleApplication.

The application wont run in the debugger and its running the wrong one because I have the cocoa app selected in fire.

2014-04-27 12:32:21.648 PM Fire[5293]: xbuild /Users/JohnMoshakis/Documents/DebugMeCocoaApplication/DebugMeCocoaApplication.sln /nologo /target:Build /verbosity:normal /property:Configuration=Debug /toolsversion:4.0
2014-04-27 12:32:25.039 PM Fire[5293]: xbuild /Users/JohnMoshakis/Documents/DebugMeCocoaApplication/DebugMeCocoaApplication.sln /nologo /target:Build /verbosity:normal /property:Configuration=Debug /toolsversion:4.0
2014-04-27 12:32:30.316 PM ibtoold[5324]: CGSConnectionByID: 0 is not a valid connection ID.
2014-04-27 12:32:31.310 PM com.apple.debugserver-310.2[5332]: debugserver-310.2 for x86_64.
2014-04-27 12:32:31.330 PM com.apple.debugserver-310.2[5332]: Listening to port 24516 for a connection from 0.0.0.0…

This is me sitting in fire, trying to debug

those again arent full logs, are they?

you shouodl see something like

Time Elapsed 00:00:01.4937920   // this is the last line from the *build*

/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/Resources/debugserver 0.0.0.0:9975 "/Users/mh/Code/git/Oxygene/Source/Fire/FireApp/bin/Debug/OS X/Fire.app/Contents/MacOS/Fire"

debugserver-310.2 for x86_64.
Listening to port 9975 for a connection from 0.0.0.0...
Got a connection, launched process /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/Resources/debugserver.
Process started
Exited
Process terminated with code 0
debugserver finished with exit code 0
Exiting.

im confused. if its not launching the app, how can it be launching the wrong one?

They are the full logs. Sorry I mean attempting the launch the wrong one.

how can you tell? i see nothing in the log you posted that mentions EITHER app. all i see is the xbuild command (with the solution name, not a project name, followed by two debugerver response lines that don’t mention a project name either.

the command line for launching debugserver (which would have the project/exe name is not in the log snippet you pasted.

what am i missing here?

Sorry I was looking at the build log and thinking the last thing it built was what it was running.

I see this is the bottom of the build log

/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/Resources/debugserver 0.0.0.0:8132 “/Users/JohnMoshakis/Documents/develop/Nougat/BindToIntegerCocoaApplication/bin/Debug/OS X/BindToIntegerCocoaApplication.app/Contents/MacOS/BindToIntegerCocoaApplication”

I dont see that in the console

I’m not sure if it helps but if I run that from terminal I get

Listening to port 8132 for a connection from 0.0.0.0
Failed to get connection from a remote gdb process
Exiting…

Also I can debug inside xcode

Yeah, i’ve found out what’s going on.

debugserver works ONLY when called with a TTY stdin handle. This happens to be the case when i run Fire from Xcode, but not if its run standalone (which it seems i never once did, while testing debugging). This is fixed for the next release — for now, i guess debugging for both Sm and Mac will be broken.

This cost me half a day finding out, because i found this not working when running the Fire-built version of Fire (that’s right, as of yesterday, Fire is fully ported to Elements), and i thought it was something wrong with my port (which made no sense, since the relevant portions of this code have been C# for ages). Turns out debugserver does some nasty trickery checking the type of handle it has for input, and behaves differently accordingly.

Anyways, found, fixed. learned something new about UNIX file handles in the process :wink:

—marc

1 Like

That’s great. Do we have to wait until Friday for the next build ? I was really looking forward to being able to debug

No, i might be able to squeeze a new build out tomorrow.

Thanks. Its working in the new build.

1 Like