What exactly is the "memory history" command?

crentagon

Summary: I got the message:

AddressSanitizer debugger support is active. Memory error breakpoint has been installed and you can now use it in the 'memory history' command.

What is the "memory history" command, and how exactly do I use it?

Details:

  • I had a bit of code that had a memory warning, which resulted to a crash.
  • I turned on the Address Sanitizer by going "Edit Scheme" > "Run" > "Enable Address Sanitizer".
  • Upon turning it on and running the same bit of code again, the crash didn't happen anymore, but the message appeared.

What does it mean, and what exactly is the memory history command? How do I use it? I have searched, but I haven't found anything that answers my question.

kuba

Running under Address Sanitizer allows you to see how were objects allocated. The memory history command needs a pointer/address and it will show how that object was allocated (a historical stacktrace of the allocation):

(lldb) po self
<MasterViewController: 0x61800000e080>

(lldb) memory history 0x61800000e080
  thread ... name = 'Memory allocated at'
    frame #0: 0x00000001051bba97 libclang_rt.asan_iossim_dynamic.dylib`wrap_calloc + 199
    frame #1: 0x00000001064362fd libobjc.A.dylib`class_createInstance + 84
    frame #2: 0x0000000106440dc7 libobjc.A.dylib`_objc_rootAlloc + 41
    frame #3: 0x00000001072d6d25 UIKit`-[UIClassSwapper initWithCoder:] + 175
    frame #4: 0x00000001074c731b UIKit`UINibDecoderDecodeObjectForValue + 683
    ...

It even works on already-deallocated objects, where it also shows the deallocation backtrace! This is extremely useful when you're accidentally accessing an already freed object.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

What exactly is the 'react-scripts start' command?

What exactly does --no-debug parameter for the clear:cache command

How do I find out what a linux command does exactly?

What is exactly meaning of commit command in git

What exactly happens when you create a pipe after a fork() command?

What does > (greater than) exactly do at the beginning of a command line

What does the command "cpan reports" do exactly?

What init 1 command exactly does?

What does the eclipse command-line argument "-clean" exactly does?

What does exactly *.* mean when used in IMAP command?

Is there any way to tell exactly what files a command is accessing?

What does the command pkill -USR1 -n -x dd mean exactly?

What exactly happens when you use the 'copy /b' command?

What exactly does the dd command do?

What exactly does the "p" option of the `command` command in the bash shell do?

What does `/profile` switch of Windows `runas` command exactly load?

What are exactly mknod command parameters?

What exactly happens when a redis command like 'get' is executed?

What exactly happens when a built-in command is run in a shell?

What does this command do, exactly?

What does `args` in Linux command `ps ao args` means exactly?

what does "usb start" command do exactly?

What does the ioctl CDROMPLAYMSF command do exactly?

What does env_variable=value && command exactly do

What is ${@:$#} exactly?

A way to see what command exactly sshd executes?

what exactly does the command ncu -u does?

What does the "start" command exactly do

The nextflow script didn't run exactly what I command

TOP Ranking

  1. 1

    Failed to listen on localhost:8000 (reason: Cannot assign requested address)

  2. 2

    pump.io port in URL

  3. 3

    How to import an asset in swift using Bundle.main.path() in a react-native native module

  4. 4

    Loopback Error: connect ECONNREFUSED 127.0.0.1:3306 (MAMP)

  5. 5

    Compiler error CS0246 (type or namespace not found) on using Ninject in ASP.NET vNext

  6. 6

    BigQuery - concatenate ignoring NULL

  7. 7

    Spring Boot JPA PostgreSQL Web App - Internal Authentication Error

  8. 8

    ggplotly no applicable method for 'plotly_build' applied to an object of class "NULL" if statements

  9. 9

    ngClass error (Can't bind ngClass since it isn't a known property of div) in Angular 11.0.3

  10. 10

    How to remove the extra space from right in a webview?

  11. 11

    Change dd-mm-yyyy date format of dataframe date column to yyyy-mm-dd

  12. 12

    Jquery different data trapped from direct mousedown event and simulation via $(this).trigger('mousedown');

  13. 13

    maven-jaxb2-plugin cannot generate classes due to two declarations cause a collision in ObjectFactory class

  14. 14

    java.lang.NullPointerException: Cannot read the array length because "<local3>" is null

  15. 15

    How to use merge windows unallocated space into Ubuntu using GParted?

  16. 16

    flutter: dropdown item programmatically unselect problem

  17. 17

    Pandas - check if dataframe has negative value in any column

  18. 18

    Nuget add packages gives access denied errors

  19. 19

    Can't pre-populate phone number and message body in SMS link on iPhones when SMS app is not running in the background

  20. 20

    Generate random UUIDv4 with Elm

  21. 21

    Client secret not provided in request error with Keycloak

HotTag

Archive