Skip to content
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

support rust panic backtrace #414

Closed
wants to merge 0 commits into from

Conversation

zhaoyao73
Copy link
Contributor

mini-backtrace has llvm's unwind cpp source to support backtrace/unwind. as unwind/backtrace needs dynamically allocates memory, mini-backtrace uses stack memory to capture fixed number of backtrace to avoid heap allocation.
as unwind library needed, it needs to turn on eh_frame_hdr

@@ -36,6 +36,7 @@ acpi = { git = "https://git.mirrors.dragonos.org/DragonOS-Community/acpi-rs.git"
intertrait = { path = "src/libs/intertrait" }
linkme = "0.2"
ida = { path = "src/libs/ida" }
mini-backtrace = { path = "/home/yaozhao/github/mini-backtrace", version = "0.1.4" }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to add a compilation flag to mini-backtrace to get rid of the stack protection in its build.rs. Is there an easy way to do it here?

@fslongjin
Copy link
Member

fslongjin commented Oct 29, 2023 via email

@fslongjin
Copy link
Member

fslongjin commented Oct 29, 2023 via email

@zhaoyao73
Copy link
Contributor Author

这个库使用的是本地的地址,我没法测试

---Original--- From: @.> Date: Sun, Oct 29, 2023 21:56 PM To: @.>; Cc: @.>; Subject: Re: [DragonOS-Community/DragonOS] support rust panic backtrace (PR#414) @zhaoyao73 commented on this pull request. In kernel/Cargo.toml: > @@ -36,6 +36,7 @@ acpi = { git = "https://git.mirrors.dragonos.org/DragonOS-Community/acpi-rs.git" intertrait = { path = "src/libs/intertrait" } linkme = "0.2" ida = { path = "src/libs/ida" } +mini-backtrace = { path = "/home/yaozhao/github/mini-backtrace", version = "0.1.4" } need to add a compilation flag to mini-backtrace to get rid of the stack protection in its build.rs. Is there an easy way to do it here? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.>

只是想让你先看一下。现在把mini-backtrace的克隆上传了。应该可以测试了,我都是用gdb手工制造panic测试的,但是serial_opt.txt的打印似乎乱掉了,似乎打印没有加锁似的。但gdb下是打symbol了。

@fslongjin
Copy link
Member

fslongjin commented Oct 30, 2023 via email

@zhaoyao73
Copy link
Contributor Author

好嘞,我明天看看! 话说,gdb怎么手动制造Panic呀

---Original--- From: @.> Date: Mon, Oct 30, 2023 19:27 PM To: @.>; Cc: @.@.>; Subject: Re: [DragonOS-Community/DragonOS] support rust panic backtrace (PR#414) 这个库使用的是本地的地址,我没法测试 … ---Original--- From: @.> Date: Sun, Oct 29, 2023 21:56 PM To: @.>; Cc: @.>; Subject: Re: [DragonOS-Community/DragonOS] support rust panic backtrace (PR#414) @zhaoyao73 commented on this pull request. In kernel/Cargo.toml: > @@ -36,6 +36,7 @@ acpi = { git = "https://git.mirrors.dragonos.org/DragonOS-Community/acpi-rs.git" intertrait = { path = "src/libs/intertrait" } linkme = "0.2" ida = { path = "src/libs/ida" } +mini-backtrace = { path = "/home/yaozhao/github/mini-backtrace", version = "0.1.4" } need to add a compilation flag to mini-backtrace to get rid of the stack protection in its build.rs. Is there an easy way to do it here? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.> 只是想让你先看一下。现在把mini-backtrace的克隆上传了。应该可以测试了,我都是用gdb手工制造panic测试的,但是serial_opt.txt的打印似乎乱掉了,似乎打印没有加锁似的。但gdb下是打symbol了。 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

就是直接改某些值,走panic 分支。dragonOS还不太会使用,制造panic还没那么容易,自己加一个也行,但不想加在critical path上,用的熟些就可以这么做了。

@fslongjin
Copy link
Member

由于这个pr需要更正,请开一下Allow edits by maintainer

@fslongjin
Copy link
Member

Sorry,难崩,我刚才force push了一下,然后pr被自动关闭了。
太神奇了,因为我把你的mini-backtrace导入到社区仓库,更改了一下源地址,但是我的提交push不到这个分支,pull下来又提示already updated.
结果force push就自动关了,难崩。
我帮你重新开一个pr然后把你的merge进主线,。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants