bloomberg / memray

Memray is a memory profiler for Python
https://bloomberg.github.io/memray/
Apache License 2.0
13.36k stars 397 forks source link

Native C++ trace flamegraph error #686

Open xty438307820 opened 1 month ago

xty438307820 commented 1 month ago

Is there an existing issue for this?

Current Behavior

No response

Expected Behavior

No response

Steps To Reproduce

when I use --native to start my program, I get the bin, I try to use memray flamegraph to convert, I get

⚠ This capture file is large and may take a long time to process ⚠

Next time, consider using the --aggregate option to memray run to reduce the size of the file. Check https://bloomberg.github.io/memray/run.html#aggregated-capture-files for more information.

Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/root/server_trunk_cn/lib/python3.11/site-packages/memray/main.py", line 6, in sys.exit(main()) ^^^^^^ File "/root/server_trunk_cn/lib/python3.11/site-packages/memray/commands/init.py", line 138, in main arg_values.entrypoint(arg_values, parser) File "/root/server_trunk_cn/lib/python3.11/site-packages/memray/commands/common.py", line 304, in run self.write_report( File "/root/server_trunk_cn/lib/python3.11/site-packages/memray/commands/common.py", line 203, in write_report reporter = self.reporter_factory( ^^^^^^^^^^^^^^^^^^^^^^ File "/root/server_trunk_cn/lib/python3.11/site-packages/memray/reporters/flamegraph.py", line 359, in from_snapshot return cls._from_any_snapshot( ^^^^^^^^^^^^^^^^^^^^^^^ File "/root/server_trunk_cn/lib/python3.11/site-packages/memray/reporters/flamegraph.py", line 288, in _from_any_snapshot tuple(record.hybrid_stack_trace()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "src/memray/_memray.pyx", line 351, in memray._memray.AllocationRecord.hybrid_stack_trace File "src/memray/_memray.pyx", line 260, in memray._memray.hybrid_stack_trace AssertionError

what the reason? thank you

Memray Version

1.14.0

Python Version

3.11

Operating System

Linux

Anything else?

No response

pablogsal commented 1 month ago

Unfortunately without the code that you are running and a description of how to make it run we cannot do much on our side as we cannot reproduce this.

could you please give us a minimal reproducer?