[Lldb-commits] [lldb] r374584 - [platform process list] add a flag for showing the processes of all users

Adrian Prantl via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 11 14:50:30 PDT 2019


This test fails on green dragon:

http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/2538/changes#detail0 <http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/2538/changes#detail0>
http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/2538/testReport/junit/lldb-api/functionalities_gdb_remote_client/TestPlatformClient_py/ <http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/2538/testReport/junit/lldb-api/functionalities_gdb_remote_client/TestPlatformClient_py/>

 lldb-api.functionalities/gdb_remote_client.TestPlatformClient.py (from lldb-api)

 Failing for the past 1 build (Since Failed#2538 )
 Took 0.66 sec.
 add description
 Stacktrace

 lldb version 10.0.99 (http://labmaster3.local/git/llvm-project.git <http://labmaster3.local/git/llvm-project.git> revision 1edb7e0b6f390b066f5218208a7c8ac974ee243c)
   clang revision 089a334c39d06e958607e1e8e0c9796f9387f512
   llvm revision 089a334c39d06e958607e1e8e0c9796f9387f512
 LLDB library dir: /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/bin
 LLDB import library dir: /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/bin
 libstdcxx tests will not be run because: Don't know how to build with libstdcxx on macosx
 Skipping following debug info categories: ['dwo']

 Session logs for test failures/errors/unexpected successes will go into directory '/Users/buildslave/jenkins/workspace/lldb-cmake/test/logs'
 Command invoked: /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/test/API/dotest.py --arch=x86_64 -s /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/lldb-test-traces -S nm -u CXXFLAGS -u CFLAGS --executable /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/./bin/lldb --dsymutil /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/./bin/dsymutil --filecheck /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/./bin/FileCheck -C /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/./bin/clang --codesign-identity lldb_codesign --server /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/./bin/debugserver --arch x86_64 --build-dir /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/lldb-test-build.noindex -s=/Users/buildslave/jenkins/workspace/lldb-cmake/test/logs -t --env TERM=vt100 --env LLVM_LIBS_DIR=/Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/./lib --build-dir /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/tools/lldb/lldb-test-build.noindex --lldb-module-cache-dir /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/tools/lldb/lldb-test-build.noindex/module-cache-lldb/lldb-api --clang-module-cache-dir /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/tools/lldb/lldb-test-build.noindex/module-cache-clang/lldb-api /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client -p TestPlatformClient.py
 Change dir to: /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client
 runCmd: settings set symbols.enable-external-lookup false
 output: 

 runCmd: settings set plugin.process.gdb-remote.packet-timeout 60
 output: 

 runCmd: settings set symbols.clang-modules-cache-path "/Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/tools/lldb/lldb-test-build.noindex/module-cache-lldb/lldb-api"
 output: 

 runCmd: settings set use-color false
 output: 

 runCmd: platform select remote-linux
 output:   Platform: remote-linux
  Connected: no


 runCmd: platform connect connect://localhost:52264 <connect://localhost:52264>
 output:   Platform: remote-linux
   Hostname: (null)
  Connected: yes
 WorkingDir: /


 runCmd: platform process list -x
 runCmd failed!
 error: no processes were found on the "remote-linux" platform


 FAIL: LLDB (/Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/bin/clang-10-x86_64) :: test_process_list_with_all_users (TestPlatformClient.TestPlatformClient)
 Restore dir to: /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/tools/lldb/test
 ======================================================================
 FAIL: test_process_list_with_all_users (TestPlatformClient.TestPlatformClient)
    Test connecting to a remote linux platform
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestPlatformClient.py", line 30, in test_process_list_with_all_users
     substrs=["1 matching process was found", "test_process"])
   File "/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 2309, in expect
     inHistory=inHistory)
   File "/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 2068, in runCmd
     msg if (msg) else CMD_MSG(cmd))
 AssertionError: False is not True : Command 'platform process list -x
 Error output:
 error: no processes were found on the "remote-linux" platform
 ' returns successfully
 Config=x86_64-/Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/bin/clang-10
 ----------------------------------------------------------------------
 Ran 1 test in 0.040s

 RESULT: FAILED (0 passes, 1 failures, 0 errors, 0 skipped, 0 expected failures, 0 unexpected successes)

Can you please take a look?

If you're not available I'll revert the patch later today to get the bots green again.

thanks!
adrian

> On Oct 11, 2019, at 12:41 PM, Walter Erquinigo via lldb-commits <lldb-commits at lists.llvm.org> wrote:
> 
> Author: wallace
> Date: Fri Oct 11 12:41:12 2019
> New Revision: 374584
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=374584&view=rev
> Log:
> [platform process list] add a flag for showing the processes of all users
> 
> Summary:
> For context: https://reviews.llvm.org/D68293
> 
> We need a way to show all the processes on android regardless of the user id.
> When you run `platform process list`, you only see the processes with the same user as the user that launched lldb-server. However, it's quite useful to see all the processes, though, and it will lay a foundation for full apk debugging support from lldb.
> 
> Before:
> ```
> PID    PARENT USER       TRIPLE                   NAME
> ====== ====== ========== ======================== ============================
> 3234   1                 aarch64-unknown-linux-android adbd
> 8034   3234              aarch64-unknown-linux-android sh
> 9096   3234              aarch64-unknown-linux-android sh
> 9098   9096              aarch64-unknown-linux-android lldb-server
> (lldb) ^D
> ```
> 
> Now:
> ```
> (lldb) platform process list -x
> 205 matching processes were found on "remote-android"
> PID    PARENT USER       TRIPLE                   NAME
> ====== ====== ========== ======================== ============================
> 1      0                                          init
> 524    1                                          init
> 525    1                                          init
> 531    1                                          ueventd
> 568    1                                          logd
> 569    1                 aarch64-unknown-linux-android servicemanager
> 570    1                 aarch64-unknown-linux-android hwservicemanager
> 571    1                 aarch64-unknown-linux-android vndservicemanager
> 577    1                 aarch64-unknown-linux-android qseecomd
> 580    577               aarch64-unknown-linux-android qseecomd
> ...
> 23816  979                                        com.android.providers.calendar
> 24600  979                                        com.verizon.mips.services
> 27888  979                                        com.hualai
> 28043  2378                                       com.android.chrome:sandboxed_process0
> 31449  979                                        com.att.shm
> 31779  979                                        com.samsung.android.authfw
> 31846  979                                        com.samsung.android.server.iris
> 32014  979                                        com.samsung.android.MtpApplication
> 32045  979                                        com.samsung.InputEventApp
> ```
> 
> Reviewers: labath,xiaobai,aadsm,clayborg
> 
> Subscribers:
> 
> Added:
>    lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestPlatformClient.py
> Modified:
>    lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py
>    lldb/trunk/source/Commands/CommandObjectPlatform.cpp
>    lldb/trunk/source/Commands/Options.td
>    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
> 
> Added: lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestPlatformClient.py
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestPlatformClient.py?rev=374584&view=auto
> ==============================================================================
> --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestPlatformClient.py (added)
> +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestPlatformClient.py Fri Oct 11 12:41:12 2019
> @@ -0,0 +1,35 @@
> +import lldb
> +import binascii
> +import os
> +from lldbsuite.test.lldbtest import *
> +from lldbsuite.test.decorators import *
> +from gdbclientutils import *
> +
> +
> +class TestPlatformClient(GDBRemoteTestBase):
> +
> +    def test_process_list_with_all_users(self):
> +        """Test connecting to a remote linux platform"""
> +
> +        class MyResponder(MockGDBServerResponder):
> +            def qfProcessInfo(self, packet):
> +                if "all_users:1" in packet:
> +                    return "pid:10;ppid:1;uid:1;gid:1;euid:1;egid:1;name:" + binascii.hexlify("/a/test_process") + ";"
> +                else:
> +                    return "E04"
> +
> +        self.server.responder = MyResponder()
> +
> +        self.runCmd("platform select remote-linux")
> +
> +        try:
> +            self.runCmd("platform connect connect://localhost:%d" %
> +                        self.server.port)
> +            self.assertTrue(self.dbg.GetSelectedPlatform().IsConnected())
> +            self.expect("platform process list -x",
> +                        substrs=["1 matching process was found", "test_process"])
> +            self.expect("platform process list",
> +                        error=True,
> +                        substrs=["error: no processes were found on the \"remote-linux\" platform"])
> +        finally:
> +            self.dbg.GetSelectedPlatform().DisconnectRemote()
> 
> Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py?rev=374584&r1=374583&r2=374584&view=diff
> ==============================================================================
> --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py (original)
> +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py Fri Oct 11 12:41:12 2019
> @@ -160,9 +160,34 @@ class MockGDBServerResponder:
>             return self.QListThreadsInStopReply()
>         if packet.startswith("qMemoryRegionInfo:"):
>             return self.qMemoryRegionInfo()
> +        if packet == "qQueryGDBServer":
> +            return self.qQueryGDBServer()
> +        if packet == "qHostInfo":
> +            return self.qHostInfo()
> +        if packet == "qGetWorkingDir":
> +            return self.qGetWorkingDir()
> +        if packet == "qsProcessInfo":
> +            return self.qsProcessInfo()
> +        if packet.startswith("qfProcessInfo"):
> +            return self.qfProcessInfo(packet)
> 
>         return self.other(packet)
> 
> +    def qsProcessInfo(self):
> +        return "E04"
> +
> +    def qfProcessInfo(self, packet):
> +        raise "E04"
> +
> +    def qGetWorkingDir(self):
> +        return "2f"
> +
> +    def qHostInfo(self):
> +        return "ptrsize:8;endian:little;"
> +
> +    def qQueryGDBServer(self):
> +        return "E04"
> +
>     def interrupt(self):
>         raise self.UnexpectedPacketException()
> 
> @@ -171,7 +196,7 @@ class MockGDBServerResponder:
> 
>     def vCont(self, packet):
>         raise self.UnexpectedPacketException()
> -    
> +
>     def readRegisters(self):
>         return "00000000" * self.registerCount
> 
> @@ -425,7 +450,6 @@ class MockGDBServer:
>     class InvalidPacketException(Exception):
>         pass
> 
> -
> class GDBRemoteTestBase(TestBase):
>     """
>     Base class for GDB client tests.
> 
> Modified: lldb/trunk/source/Commands/CommandObjectPlatform.cpp
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectPlatform.cpp?rev=374584&r1=374583&r2=374584&view=diff
> ==============================================================================
> --- lldb/trunk/source/Commands/CommandObjectPlatform.cpp (original)
> +++ lldb/trunk/source/Commands/CommandObjectPlatform.cpp Fri Oct 11 12:41:12 2019
> @@ -1264,6 +1264,10 @@ protected:
>         verbose = true;
>         break;
> 
> +      case 'x':
> +        match_info.SetMatchAllUsers(true);
> +        break;
> +
>       default:
>         llvm_unreachable("Unimplemented option");
>       }
> 
> Modified: lldb/trunk/source/Commands/Options.td
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/Options.td?rev=374584&r1=374583&r2=374584&view=diff
> ==============================================================================
> --- lldb/trunk/source/Commands/Options.td (original)
> +++ lldb/trunk/source/Commands/Options.td Fri Oct 11 12:41:12 2019
> @@ -591,6 +591,9 @@ let Command = "platform process list" in
>   def platform_process_list_show_args : Option<"show-args", "A">,
>     GroupRange<1, 6>,
>     Desc<"Show process arguments instead of the process executable basename.">;
> +  def platform_process_list_all_users: Option<"all-users", "x">,
> +    GroupRange<1,6>,
> +    Desc<"Show processes matching all user IDs.">;
>   def platform_process_list_verbose : Option<"verbose", "v">, GroupRange<1, 6>,
>     Desc<"Enable verbose output.">;
> }
> 
> Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=374584&r1=374583&r2=374584&view=diff
> ==============================================================================
> --- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp (original)
> +++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Fri Oct 11 12:41:12 2019
> @@ -2176,8 +2176,7 @@ uint32_t GDBRemoteCommunicationClient::F
>       if (match_info.GetProcessInfo().EffectiveGroupIDIsValid())
>         packet.Printf("egid:%u;",
>                       match_info.GetProcessInfo().GetEffectiveGroupID());
> -      if (match_info.GetProcessInfo().EffectiveGroupIDIsValid())
> -        packet.Printf("all_users:%u;", match_info.GetMatchAllUsers() ? 1 : 0);
> +      packet.Printf("all_users:%u;", match_info.GetMatchAllUsers() ? 1 : 0);
>       if (match_info.GetProcessInfo().GetArchitecture().IsValid()) {
>         const ArchSpec &match_arch =
>             match_info.GetProcessInfo().GetArchitecture();
> 
> 
> _______________________________________________
> lldb-commits mailing list
> lldb-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20191011/90240ef1/attachment-0001.html>


More information about the lldb-commits mailing list