-
-
Notifications
You must be signed in to change notification settings - Fork 373
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
RISC-V 32: Crash when trying to display disassembly code #4577
Comments
The crash occurs because the Line 4076 in 706a6bf
I also have another file that also causes a crash, but in a different place, where the Line 5696 in e4958fc
This quick fix helped (but I'm not sure it's correct): diff --git a/librz/flag/flag.c b/librz/flag/flag.c
index 1baee1dff6..84367de61d 100644
--- a/librz/flag/flag.c
+++ b/librz/flag/flag.c
@@ -680,7 +680,7 @@ RZ_API void rz_flag_item_set_comment(RzFlagItem *item, const char *comment) {
RZ_API void rz_flag_item_set_realname(RzFlagItem *item, const char *realname) {
rz_return_if_fail(item);
free_item_realname(item);
- item->realname = RZ_STR_ISEMPTY(realname) ? NULL : strdup(realname);
+ item->realname = RZ_STR_ISEMPTY(realname) ? item->name : strdup(realname);
}
/* add/replace/remove the color of a flag item */ |
|
@moste00 could you please help us to fix this crash before the release? It will help to delve into the Rizin architecture code as well. |
Quick fix is enough, since the RISC-V code will be completely rewritten after the Capstone update is finished. |
@XVilka Hello, I investigated this crash a bit and here's what I think about it. (1) This, almost certainly, has nothing to do with RISC-V. The crash-relevant code paths has no RISC-V logic in it, just Elf handling (2) Similarly, the crash also has nothing to do with the "culprit" function (3) The crash is an Elf issue:
(4) The crash has several possible fixes, but none strike me as ideal
I personally like the second solution better, it solves the issue with minimum assumptions. If it's super important to know why is it the case that only |
@moste00 go ahead with the second one but please open a new issue, since it's only a temporary bandaid and the underlying issue is a big one and would need some refactoring. |
…ever null in rz_core_bin_apply_symbols
@XVilka the PR fixing this is ready for review |
Environment information
ELF (RISC-V 32)
Describe the bug
Crash when trying to display disassembly code.
MacOS report
To Reproduce
Steps to reproduce the behavior:
Open file:
blink-crash.elf
from blink.zipTry open function
blink.copy_data
<Crash>
Expected behavior
Show disassembly code.
Additional context
If I remove the
copy_data
function, then the crash does not occur(fileblink-no-copy_data.elf
in archive).The text was updated successfully, but these errors were encountered: