-
-
Notifications
You must be signed in to change notification settings - Fork 706
Enable GC dump on OOM #4782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Enable GC dump on OOM #4782
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
0bc6093
to
4137098
Compare
Manually tested on T2T1 using the following patch: diff --git a/core/src/apps/base.py b/core/src/apps/base.py
index 5552fc86ba..0bb5d7b9ac 100644
--- a/core/src/apps/base.py
+++ b/core/src/apps/base.py
@@ -275,6 +275,16 @@ async def handle_Ping(msg: Ping) -> Success:
from trezor.ui.layouts import confirm_action
await confirm_action("ping", TR.words__confirm, "ping", br_code=B.ProtectCall)
+
+ try:
+ count = int(msg.message)
+ except ValueError:
+ count = 0
+
+ L = ['x']
+ for _ in range(count):
+ L = L + L
+
return Success(message=msg.message) Test stepsCollect the log with: tio /dev/ttyACM0 | tee debug.log Extract the JSON dump: awk '/^\[\s?$/,/^\]\s?$/' debug.log >| dump.json Analyze and generate memory HTML: core/tools/analyze-memory-dump.py dump.json |
cc6e027
to
ec2bf1f
Compare
Please also create PR in the trezor/micropython repo. |
mmilata
approved these changes
Mar 17, 2025
Enabled on debug firmware and non-frozen emulator. [no changelog]
Enabled for debug firmware and non-frozen emulator. JSON dump can be extracted from debug log and analyzed using: $ awk '/^\[$/,/^\]$/' <debug.log >dump.json $ core/tools/analyze-memory-dump.py dump.json [no changelog]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
core
Trezor Core firmware. Runs on Trezor Model T and T2B1.
micropython
Python interpreter and runtime that runs Trezor firmware
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Requires the following MicroPython patch: trezor/micropython#14