Re: [lldb-dev] Can't debug with a -g compiled binary as a non-root user on OS X 10.11 El Capitan

2015-10-03 Thread Jason Molenda via lldb-dev
(resending my reply with a Cc to lldb-dev - System Integrity Protection in Mac 
OS X 10.11 El Capitan has impact on lldb in several important ways, I think 
others will be interested.)


Yes, System Integrity Protection in El Capitan includes the restriction that 
nothing can be modified in directories like /usr, /System, /bin, /sbin, even by 
the root user.  /usr/local is excepted from these restrictions.

SIP also restricts the debugger from being able to attach to system processes.  
e.g. trying to attach to Mail.app will fail, regardless of whether you're root 
or a regular user, official lldb or self-built/self-signed lldb.

More complete details on exactly what SIP includes:

https://developer.apple.com/library/prerelease/ios/documentation/Security/Conceptual/System_Integrity_Protection_Guide/System_Integrity_Protection_Guide.pdf


J



> On Oct 2, 2015, at 6:34 PM, Tony Perrie via lldb-dev 
>  wrote:
> 
> The lldb I'm using is from XCode 7.0.1.
> 
> I can debug my binary if I run lldb as root.
> 
> I eventually figured out my actual bug from log messages without lldb.  Turns 
> out, Mac OS X 10.11 El Capitan doesn't allow the root user to deploy binaries 
> to /usr/bin which our installer does so that our binary is in the default ssh 
> environment path.  I setup a custom ~/.ssh/environment and configured 
> PermitUserEnvironment to yes in /etc/sshd_config and that let my binary run 
> normally.
> 
> But, still, I can't seem to run lldb as a normal system user with our binary.
> 
> Tony
> 
>> On Oct 2, 2015, at 6:05 PM, Jason Molenda  wrote:
>> 
>> The fact that it doesn't work as root makes it less likely it's an unsigned 
>> debugserver / missigned debugserver issue.  You can run an unsigned / 
>> mis-signed lldb as root and it will still work on os x 10.11, as well as a 
>> signed one run by a user account.
>> 
>> Is the binary you're running under the debugger signed?  I think it needs 
>> the get-task-allow entitlement if the debugger is going to attach/run it.
>> 
>> 
>>> On Oct 2, 2015, at 5:58 PM, Todd Fiala via lldb-dev 
>>>  wrote:
>>> 
>>> Hi Tony,
>>> 
>>> This is the right list.
>>> 
>>> Are you using an LLDB that you built locally?  If so, can you move aside 
>>> the debugserver that you find somewhere under in your LLDB.framework bundle 
>>> directory, and make a symlink to the debugserver that comes out of your 
>>> /Applications/Xcode.app bundle?  Your official Xcode.app one should be in a 
>>> location like:
>>> /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/Resources/debugserver
>>> 
>>> The other thing it could be is that I think your lldb_codesign cert may 
>>> need to be recreated on a new OS.  I seem to recall the instructions there 
>>> indicate the code signing cert does not survive OS updates but I might be 
>>> mistaken.
>>> 
>>> I suspect the symlink will resolve your issue, though.  With tighter 
>>> security, it is likely that a home-built debugserver is no longer going to 
>>> work without being Apple signed.  We may need to adjust the Xcode build to 
>>> create a symlink to the official one if that's the case.
>>> 
>>> -Todd
>>> 
>>> On Fri, Oct 2, 2015 at 2:35 PM, Tony Perrie via lldb-dev 
>>>  wrote:
>>> I can only seem to debug our binary as the root user om 10.11.  I rebooted 
>>> at one point, and lldb did work briefly with a system user but then after 
>>> the machine ran for a bit, it proceeded to not work again.  Rebooted again, 
>>> and again, lldb failes with this error...
>>> 
>>> lldb /opt/aspera/bin/ascp
>>> (lldb) target create "/opt/aspera/bin/ascp"
>>> 2015-10-02 14:24:17.091 lldb[1721:12884] Metadata.framework [Error]: 
>>> couldn't get the client port
>>> Current executable set to '/opt/aspera/bin/ascp' (x86_64).
>>> (lldb) r -i ~/.ssh/id_rsa /tmp/mp_source/* localhost:/tmp/mp_dest/
>>> error: process exited with status -1 (unable to attach)
>>> 
>>> As root, I can reproduce the error:
>>> 
>>> root# lldb /opt/aspera/bin/ascp
>>> (lldb) target create "/opt/aspera/bin/ascp"
>>> 2015-10-02 14:30:40.515 lldb[1864:14630] Metadata.framework [Error]: 
>>> couldn't get the client port
>>> Current executable set to '/opt/aspera/bin/ascp' (x86_64).
>>> (lldb) r -i /var/root/.ssh/id_rsa /tmp/mp_source/* localhost:/tmp/mp_dest/
>>> Process 1866 launched: '/opt/aspera/bin/ascp' (x86_64)
>>> 
>>> Session Stop  (Error: Session initiation failed, Server process failed to 
>>> start: permissions?)
>>> Process 1866 exited with status = 1 (0x0001) 
>>> 
>>> I have another machine running OS X 10.9 and lldb where everything works 
>>> flawlessly.
>>> 
>>> The problem with out binary seems to be that OS X is prohibiting our binary 
>>> from starting another process (even as root).  Not sure if this is the 
>>> right list for that question though.  Assume it's something to do with 
>>> 10.11's security model.
>>> 
>>> 
>>> ___
>>> lldb-dev mailing list
>>> lldb-dev@lists.llvm.org
>>> http://list

[lldb-dev] [Bug 25038] New: cmake build does not add python readline stub module when building the lldb target

2015-10-03 Thread via lldb-dev
https://llvm.org/bugs/show_bug.cgi?id=25038

Bug ID: 25038
   Summary: cmake build does not add python readline stub module
when building the lldb target
   Product: lldb
   Version: unspecified
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P
 Component: All Bugs
  Assignee: lldb-dev@lists.llvm.org
  Reporter: todd.fi...@gmail.com
CC: llvm-b...@lists.llvm.org
Classification: Unclassified

When testing http://reviews.llvm.org/D13268 on Linux, I discovered we had
another broken dependency: the Linux-side python readline module does not build
when we build the lldb target.

Fix that.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


[lldb-dev] [Bug 25038] cmake build does not add python readline stub module when building the lldb target

2015-10-03 Thread via lldb-dev
https://llvm.org/bugs/show_bug.cgi?id=25038

Todd Fiala  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|lldb-dev@lists.llvm.org |todd.fi...@gmail.com

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


[lldb-dev] [Bug 24043] scripts/Python/modules/readline needs libpthread and libdl

2015-10-03 Thread via lldb-dev
https://llvm.org/bugs/show_bug.cgi?id=24043

Todd Fiala  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||todd.fi...@gmail.com
   Assignee|lldb-dev@lists.llvm.org |todd.fi...@gmail.com

--- Comment #2 from Todd Fiala  ---
I'll look at this patch as soon as the other libedit readline patch clears.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


[lldb-dev] [Bug 25039] New: TestGoroutines.TestGoASTContext.test_goroutine_plugin

2015-10-03 Thread via lldb-dev
https://llvm.org/bugs/show_bug.cgi?id=25039

Bug ID: 25039
   Summary: TestGoroutines.TestGoASTContext.test_goroutine_plugin
   Product: lldb
   Version: unspecified
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P
 Component: All Bugs
  Assignee: lldb-dev@lists.llvm.org
  Reporter: todd.fi...@gmail.com
CC: llvm-b...@lists.llvm.org
Classification: Unclassified

I'm getting the following persistent failure on an Ubuntu 14.04 x86_64 system,
building with and testing against clang-3.6-built inferiors.

Not sure why the Linux buildbots aren't seeing this.  I'm going to try building
more than 'lldb' and 'lldb-mi' targets in case this is due to other bits being
needed.

Error Message

4 not greater than 20
Stacktrace

  File "/home/tfiala/work/mirror/git/llvm/tools/lldb/test/unittest2/case.py",
line 357, in run
testMethod()
  File "/home/tfiala/work/mirror/git/llvm/tools/lldb/test/lldbtest.py", line
483, in wrapper
return func(self, *args, **kwargs)
  File "/home/tfiala/work/mirror/git/llvm/tools/lldb/test/lldbtest.py", line
836, in wrapper
func(*args, **kwargs)
  File "/home/tfiala/work/mirror/git/llvm/tools/lldb/test/lldbtest.py", line
530, in wrapper
return func(self, *args, **kwargs)
  File "/home/tfiala/work/mirror/git/llvm/tools/lldb/test/lldbtest.py", line
941, in wrapper
func(*args, **kwargs)
  File
"/home/tfiala/work/mirror/git/llvm/tools/lldb/test/lang/go/goroutines/TestGoroutines.py",
line 22, in test_goroutine_plugin
self.check_goroutines()
  File
"/home/tfiala/work/mirror/git/llvm/tools/lldb/test/lang/go/goroutines/TestGoroutines.py",
line 71, in check_goroutines
self.assertGreater(len(self.process().threads), 20)
  File "/home/tfiala/work/mirror/git/llvm/tools/lldb/test/unittest2/case.py",
line 960, in assertGreater
self.fail(self._formatMessage(msg, standardMsg))
  File "/home/tfiala/work/mirror/git/llvm/tools/lldb/test/unittest2/case.py",
line 434, in fail
raise self.failureException(msg)

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev