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

tricore: runtime errors of integer overflow (detected by UBSAN) #2188

Closed
XVilka opened this issue Nov 7, 2023 · 2 comments · Fixed by #2204
Closed

tricore: runtime errors of integer overflow (detected by UBSAN) #2188

XVilka opened this issue Nov 7, 2023 · 2 comments · Fixed by #2204

Comments

@XVilka
Copy link
Contributor

XVilka commented Nov 7, 2023

../subprojects/capstone-next/arch/TriCore/TriCoreInstPrinter.c:282:32: runtime error: signed integer overflow: -2146827818 + -1834846 cannot be represented in type 'int32_t' (aka 'int')
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../subprojects/capstone-next/arch/TriCore/TriCoreInstPrinter.c:282:32 in
../subprojects/capstone-next/arch/TriCore/TriCoreInstPrinter.c:295:32: runtime error: signed integer overflow: -2146732090 + -16725016 cannot be represented in type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../subprojects/capstone-next/arch/TriCore/TriCoreInstPrinter.c:295:32 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../librz/analysis/op.c:105:4 in
../subprojects/capstone-next/arch/TriCore/TriCoreInstPrinter.c:247:15: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../subprojects/capstone-next/arch/TriCore/TriCoreInstPrinter.c:247:15 in
../librz/analysis/p/analysis_tricore_cs.c:1021:14: runtime error: index -1 out of bounds for type 'RzAnalysisValue *[6]' (aka 'struct rz_analysis_value_t *[6]')
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../librz/analysis/p/analysis_tricore_cs.c:1021:14 in

cc @imbillow

@imbillow
Copy link
Contributor

What should be the behavior when overflow, just abort?

@XVilka
Copy link
Contributor Author

XVilka commented Nov 19, 2023

Good question. Probably some error message, "invalid" instruction, or something like that. These values should be checked before they can cause overflow.

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 a pull request may close this issue.

2 participants