jsonptr icon indicating copy to clipboard operation
jsonptr copied to clipboard

VS Code debugger: "read memory from 0xc0 failed"

Open chanced opened this issue 1 year ago • 4 comments

@asmello

While debugging something unrelated, I ran into this after a call to Pointer::as_str. This pointer should have been root/default. This is using vs code. I assume the debugger is not throwing bogus data but I suppose that is also a possibility?

Screenshot 2024-10-03 at 2 33 26 PM

chanced avatar Oct 03 '24 18:10 chanced

The behavior is consistent on each run of the test. It requires getting to the end and encountering my faulty logic before it manifests.

https://github.com/chanced/grill/blob/f48725f562b8972a92156a29b620d7406e4a0ce3/grill-core/src/source/walk/to.rs

chanced avatar Oct 03 '24 18:10 chanced

Hmm, interesting, Does it behave in some abnormal way otherwise? Or is it just the debugger that's throwing a fit?

asmello avatar Oct 04 '24 07:10 asmello

My only guess, assuming this is indeed a bug, is that it's a lifetime bug, and the &str is outliving the original Pointer.

asmello avatar Oct 04 '24 07:10 asmello

Hmm, interesting, Does it behave in some abnormal way otherwise? Or is it just the debugger that's throwing a fit?

It behaves normally

chanced avatar Oct 04 '24 13:10 chanced