rizinorg / rizin

UNIX-like reverse engineering framework and command-line toolset.
https://rizin.re
GNU Lesser General Public License v3.0
2.66k stars 357 forks source link

SDB and analysis UBSAN errors #3966

Open XVilka opened 11 months ago

XVilka commented 11 months ago
rizin(69447,0x1e6485ec0) malloc: nano zone abandoned due to inability to reserve vm space.
../librz/lang/lang.c:128:3: runtime error: call to function lang_c_init through pointer to incorrect function type 'int (*)(struct rz_lang_t *)'
c.c:99: note: lang_c_init defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../librz/lang/lang.c:128:3 in
../librz/util/ht/ht_inc.c:23:26: runtime error: call to function sdb_hash through pointer to incorrect function type 'unsigned int (*)(const void *)'
util.c:22: note: sdb_hash defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../librz/util/ht/ht_inc.c:23:26 in
../librz/util/sdb/src/sdb.c:263:27: runtime error: call to function sdb_hash through pointer to incorrect function type 'unsigned int (*)(const void *)'
util.c:22: note: sdb_hash defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../librz/util/sdb/src/sdb.c:263:27 in
../librz/util/sdb/src/ls.c:139:3: runtime error: call to function sdbkv_free through pointer to incorrect function type 'void (*)(void *)'
sdb.c:522: note: sdbkv_free defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../librz/util/sdb/src/ls.c:139:3 in
../librz/config/config.c:176:8: runtime error: call to function cb_analysiscc through pointer to incorrect function type 'bool (*)(void *, void *)'
cconfig.c:2645: note: cb_analysiscc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../librz/config/config.c:176:8 in
../librz/config/config.c:186:8: runtime error: call to function cb_analysis_gp through pointer to incorrect function type 'bool (*)(void *, void *)'
cconfig.c:2656: note: cb_analysis_gp defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../librz/config/config.c:186:8 in
../librz/config/config.c:340:8: runtime error: call to function cb_analysis_limits through pointer to incorrect function type 'bool (*)(void *, void *)'
cconfig.c:2670: note: cb_analysis_limits defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../librz/config/config.c:340:8 in
../librz/util/list.c:635:14: runtime error: call to function regcmp through pointer to incorrect function type 'int (*)(const void *, const void *)'
reg.c:238: note: regcmp defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../librz/util/list.c:635:14 in
../librz/util/vector.c:325:2: runtime error: call to function rz_type_callable_arg_free through pointer to incorrect function type 'void (*)(void *)'
function.c:101: note: rz_type_callable_arg_free defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../librz/util/vector.c:325:2 in
../librz/util/ht/ht_inc.c:143:5: runtime error: call to function sdbkv_fini through pointer to incorrect function type 'void (*)(struct ht_pp_kv *)'
sdbht.c:6: note: sdbkv_fini defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../librz/util/ht/ht_inc.c:143:5 in
../librz/util/list.c:158:3: runtime error: call to function rz_reg_profile_alias_free through pointer to incorrect function type 'void (*)(void *)'
profile.c:27: note: rz_reg_profile_alias_free defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../librz/util/list.c:158:3 in
../subprojects/tree-sitter-0.20.7/lib/src/./parser.c:1790:38: runtime error: call to function tree_sitter_rzcmd_external_scanner_create through pointer to incorrect function type 'void *(*)(void)'
scanner.c:24: note: tree_sitter_rzcmd_external_scanner_create defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../subprojects/tree-sitter-0.20.7/lib/src/./parser.c:1790:38 in
../librz/cons/cons.c:375:3: runtime error: call to function rz_core_break through pointer to incorrect function type 'void (*)(void *)'
core.c:2092: note: rz_core_break defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../librz/cons/cons.c:375:3 in
../librz/util/ht/ht_inc.c:23:26: runtime error: call to function sdb_hash through pointer to incorrect function type 'unsigned int (*)(const void *)'
util.c:22: note: sdb_hash defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../librz/util/ht/ht_inc.c:23:26 in
WARNING: bin_file_strings: search interval size (0x20ad96c) exeeds bin.maxstrbuf (0xa00000), skipping it.
../librz/util/thread.c:21:13: runtime error: call to function search_string_thread_runner through pointer to incorrect function type 'void *(*)(void *)'
bfile_string.c:110: note: search_string_thread_runner defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../librz/util/thread.c:21:13 in
WARNING: bin_file_strings: search interval size (0x20ad96c) exeeds bin.maxstrbuf (0xa00000), skipping it.
../librz/util/vector.c:54:4: runtime error: call to function RzBinDwarfPiece_fini through pointer to incorrect function type 'void (*)(void *, void *)'
op.c:662: note: RzBinDwarfPiece_fini defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../librz/util/vector.c:54:4 in
 -- Rename a function using the 'afr <newname> @ <offset>' command.
../librz/config/config.c:124:4: runtime error: call to function cb_color_getter through pointer to incorrect function type 'bool (*)(void *, void *)'
cconfig.c:1262: note: cb_color_getter defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../librz/config/config.c:124:4 in
[0x80080020]> ../librz/cons/cons.c:447:9: runtime error: call to function rz_core_sleep_begin through pointer to incorrect function type 'void *(*)(void *)'
core.c:2094: note: rz_core_sleep_begin defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../librz/cons/cons.c:447:9 in
../librz/cons/cons.c:452:3: runtime error: call to function rz_core_sleep_end through pointer to incorrect function type 'void (*)(void *, void *)'
core.c:2104: note: rz_core_sleep_end defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../librz/cons/cons.c:452:3 in
[0x80080020]> aaa
[../librz/analysis/op.c:105:4: runtime error: call to function archbits through pointer to incorrect function type 'void (*)(void *, unsigned long long)'
core.c:342: note: archbits defined here
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
../librz/util/list.c:719:10: runtime error: call to function ref_cmp through pointer to incorrect function type 'int (*)(const void *, const void *)'
xrefs.c:66: note: ref_cmp defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../librz/util/list.c:719:10 in
../librz/analysis/block.c:511:13: runtime error: call to function analysis_block_cb through pointer to incorrect function type 'bool (*)(struct rz_analysis_bb_t *, void *)'
canalysis.c:1638: note: analysis_block_cb defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../librz/analysis/block.c:511:13 in
../librz/analysis/block.c:547:20: runtime error: call to function analysis_block_cb through pointer to incorrect function type 'bool (*)(struct rz_analysis_bb_t *, void *)'
canalysis.c:1638: note: analysis_block_cb defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../librz/analysis/block.c:547:20 in
../librz/analysis/block.c:553:5: runtime error: call to function analysis_block_on_exit through pointer to incorrect function type 'bool (*)(struct rz_analysis_bb_t *, void *)'
canalysis.c:1625: note: analysis_block_on_exit defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../lib

cc @imbillow (the Tricore ones, see also capstone https://github.com/capstone-engine/capstone/issues/2188)

officialasishkumar commented 10 months ago

@XVilka How to generate this error?

XVilka commented 10 months ago

@officialasishkumar I cannot share the file, sorry.