[lldb-dev] [Bug 48203] New: lldb crash on clang::Decl::getASTContext()

2020-11-17 Thread via lldb-dev
https://bugs.llvm.org/show_bug.cgi?id=48203

Bug ID: 48203
   Summary: lldb crash on clang::Decl::getASTContext()
   Product: lldb
   Version: unspecified
  Hardware: Macintosh
OS: MacOS X
Status: NEW
  Severity: normal
  Priority: P
 Component: All Bugs
  Assignee: lldb-dev@lists.llvm.org
  Reporter: darthu...@gmail.com
CC: jdevliegh...@apple.com, llvm-b...@lists.llvm.org

Created attachment 24171
  --> https://bugs.llvm.org/attachment.cgi?id=24171&action=edit
lldb crash report

My lldb start crashing on debugging Greenplum binary (PostgreSQL fork for
analytics). Nothing special about binary and debugging - just step next in some
arbitrary place in the code and lldb crashed (and asked to make report here).
Crash report in attachment "lld_crash.txt"

MacOS version 10.15 (Catalina)
lldb version 12.0.0
  clang revision 3e69871ab5a66fb55913a2a2f5e7f5b42899a4c9
  llvm revision 3e69871ab5a66fb55913a2a2f5e7f5b42899a4c9

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


[lldb-dev] [Bug 48205] New: lldb-server --min/max-gdbserver-port port map is not shared between processes

2020-11-17 Thread via lldb-dev
https://bugs.llvm.org/show_bug.cgi?id=48205

Bug ID: 48205
   Summary: lldb-server --min/max-gdbserver-port port map is not
shared between processes
   Product: lldb
   Version: 11.0
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P
 Component: All Bugs
  Assignee: lldb-dev@lists.llvm.org
  Reporter: david.spick...@linaro.org
CC: jdevliegh...@apple.com, llvm-b...@lists.llvm.org

I have been running tests in a QEMU VM with select ports forwarded to the host
machine. To do this I used the --min/max-gdbserver-port options to lldb-server.

This is what the tree looks like when I connect two lldbs to the lldb-server in
qemu:
589 pts/0T  0:01  \_ ./build-cross/bin/lldb-server platform
--server --listen 0.0.0.0:54321 --min-gdbserver-port 12346 --max-gdbserver-port
12347
590 pts/0Tl 0:00  |   \_ ./build-cross/bin/lldb-server platform
--server --listen 0.0.0.0:54321 --min-gdbserver-port 12346 --max-gdbserver-port
12347
600 pts/0T  0:01  |   |   \_
/mnt/virt_root/build-cross/bin/lldb-server gdbserver tcp://10.0.2.2:12346
--native-regs --pipe 6
612 pts/0t  0:00  |   |   \_ /mnt/virt_root/target
593 pts/0Tl 0:00  |   \_ ./build-cross/bin/lldb-server platform
--server --listen 0.0.0.0:54321 --min-gdbserver-port 12346 --max-gdbserver-port
12347
602 pts/0T  0:01  |   \_
/mnt/virt_root/build-cross/bin/lldb-server gdbserver tcp://10.0.2.2:12346
--native-regs --pipe 6
613 pts/0t  0:00  |   \_ /mnt/virt_root/target2

You can see that I'm saying only use port 12346 for spawning gdbservers. (the
max is the limit, that port is not included in the range)

The processes are roughly:
the platform
  process for connection 1
 gdbserver for connection 1
   target
  process for connection 2
 gdbserver for connection 2
   target

You can't log out of the per connection process
(https://bugs.llvm.org/show_bug.cgi?id=23169) so I added some prints. The first
number is the PID.

589: Set m_port_map
589: Connection established.
589: Set m_port_map
589: Connection established.
589: Set m_port_map
590: Looking for next available port...
590: Port 12346 is free
593: Looking for next available port...
593: Port 12346 is free
590: Associating port 12346 with process 600
593: Associating port 12346 with process 602

Because the per connection process gets a fresh copy of the port map, they
always think port 12346 is free and use it. Which defeats the purpose of the
option.

Weirdly, you can debug the two programs just fine. I have no idea how that
works, perhaps a human typing commands is just too slow to mess it up.

If you use an API testcase you can get a single connection to spawn two
gdbservers and that *does* fail to find a port the second time, as expected.
(though the error is confusing at best)

The cause of this is the same as https://bugs.llvm.org/show_bug.cgi?id=23169 I
think. I don't know much about IPC but I assume moving to threads would also
help share this port map correctly.

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