MozStackWalk() doesn't include many Rust stack frames

RESOLVED INVALID

Status

()

Core
mozglue
RESOLVED INVALID
16 days ago
14 days ago

People

(Reporter: mccr8, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

16 days ago
I'm looking at some stacks on Linux generated using DMD, which uses MozStackWalk().

I see some stacks like this:

replace_malloc(unsigned long) (/media/ssd/mc/memory/replace/dmd/DMD.cpp:1264)
Allocator<ReplaceMallocBase>::malloc(unsigned long) (/media/ssd/mc/memory/build/malloc_decls.h:37)
malloc (/media/ssd/mc/memory/build/malloc_decls.h:37)
alloc_system::platform::{{impl}}::alloc (/checkout/src/liballoc_system/lib.rs:140)
alloc::heap::{{impl}}::alloc (/checkout/src/liballoc/heap.rs:84)

I'm guessing that this is because it isn't producing any stack frames for Rust code. Having that would make it easier to investigate memory usage in Rust code.
(Reporter)

Comment 1

16 days ago
erahm points out that there is in fact rust code in this stack. I guess I was expecting that it would show more frames of the stack. Other call sites did have more. Maybe the stack walker is not at fault.
My experience is that stack traces involving Rust code appear as to involve lots of inlining. Usually if you squint you can work out what's going on, but it can be a bit tricky.
(Reporter)

Comment 3

15 days ago
This is with --disable-optimize, but I don't know what effect that has on Rust.
Summary: MozStackWalk() doesn't include Rust stack frames → MozStackWalk() doesn't include many Rust stack frames
(Reporter)

Comment 4

14 days ago
I symbolicated the DMD log, rather than the output of the DMD log, and now at least something is showing up, so I must have messed something up with the way I was dealing with it before.

allocation stack:
  #00: Allocator<ReplaceMallocBase>::malloc(unsigned long) (/media/ssd/mc/memory/build/malloc_decls.h:37)
  #00: malloc (/media/ssd/mc/memory/build/malloc_decls.h:37)
  #00: std::thread::local::{{impl}}::try_with<core::cell::RefCell<core::option::Option<alloc::boxed::Box<Write>>>,closure,()> (/checkout/src/libstd/thread/local.rs:371)
  #00: _$LT$ordermap..OrderMap$LT$K$C$$u20$V$C$$u20$S$GT$$GT$::double_capacity::he1500c4fc523568c (style2-8c9c3e402a41895f683bea6c197cc1ac.rs:?)
Status: NEW → RESOLVED
Last Resolved: 14 days ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.