Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Memory Region command causes segfault #36550

Open Quuxplusone opened 6 years ago

Quuxplusone commented 6 years ago
Bugzilla Link PR37577
Status NEW
Importance P normal
Reported by Max Shavrick (maxshavrick@gmail.com)
Reported on 2018-05-24 04:40:17 -0700
Last modified on 2018-09-11 07:16:07 -0700
Version unspecified
Hardware Macintosh MacOS X
CC llvm-bugs@lists.llvm.org, teemperor@gmail.com
Fixed by commit(s)
Attachments Screen Shot 2018-05-24 at 7.43.30 AM.png (392322 bytes, image/png)
Blocks
Blocked by
See also

Created attachment 20336 Screenshot of it

( This is lldb lldb-902.0.79.2\n Swift-4.1 )

When using memory region command twice, there is a segmentation fault. Steps as follows:

$lldb ./test_program (lldb) process launch --stop-at-entry (lldb) ni (lldb) ni (lldb) register read rsp rsp = 0x00007ffeefbff5c8 (lldb) memory region 0x00007ffeefbff5c8 (lldb) memory region

Note the last memory region line I do not pass an address to. Should show the help screen again.

Thank you Max

Quuxplusone commented 6 years ago

Attached Screen Shot 2018-05-24 at 7.43.30 AM.png (392322 bytes, image/png): Screenshot of it

Quuxplusone commented 6 years ago

Actually 'memory region' without any parameter will only print help if it hasn't been used before with an argument (or the last call printed the last memory region in the address space). Otherwise it will just print the next memory region afterwards. This isn't really documented anywhere it seems.

So the segfault is caused by LLDB trying to print information about the next memory region, which somehow went wrong.