[hatari-devel] Uninitialized value errors from Valgrind

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

While debugging some other issues (which keep me busy for now), I noticed Valgrind printing a lot of uninitialized value errors for Hatari.

These are from running ScummVM in emulated 32Mhz Falcon + FPU with 8+64MB RAM, and DSP disabled, using latest EmuTOS git version.

EmuTOS boot:
==5238== Conditional jump or move depends on uninitialised value(s)
==5238==    at 0x7FC8C9: op_6601_23_ff (cpuemu_23.c:28838)
==5238==    by 0x340AF0: m68k_run_2ce (newcpu.c:7036)
==5238==    by 0x33CDE1: m68k_go (newcpu.c:7832)
==5238==    by 0x2B5576: main (main.c:983)

Corresponds to generated code:
        /* OP zero */
        if (cctrue(6)) {

Warning from early ScummVM startup (I can look into that):
==5238== Conditional jump or move depends on uninitialised value(s)
==5238==    at 0x2D52FF: GemDOS_SFirst (gemdos.c:3020)
==5238==    by 0x2D6717: GemDOS_Trap (gemdos.c:4070)
==5238==    by 0x35FF15: OpCode_GemDos (hatari-glue.c:269)
==5238==    by 0x35FF15: OpCode_GemDos_noret (hatari-glue.c:285)
==5238==    by 0x340AF0: m68k_run_2ce (newcpu.c:7036)
==5238==    by 0x33CDE1: m68k_go (newcpu.c:7832)
==5238==    by 0x2B5576: main (main.c:983)


Then further issues from CPU core while ScummVM startup continued:
==5238== Conditional jump or move depends on uninitialised value(s)
==5238==    at 0xC1E2F4: m68k_mull (newcpu_common.c:1357)
==5238==    by 0x7F287B: op_4c3c_23_ff (cpuemu_23.c:21610)
==5238==    by 0x340AF0: m68k_run_2ce (newcpu.c:7036)
==5238==    by 0x33CDE1: m68k_go (newcpu.c:7832)
==5238==    by 0x2B5576: main (main.c:983)
==5238==
==5238== Conditional jump or move depends on uninitialised value(s)
==5238==    at 0x7FD20A: op_6c00_23_ff (cpuemu_23.c:29262)
==5238==    by 0x340AF0: m68k_run_2ce (newcpu.c:7036)
==5238==    by 0x33CDE1: m68k_go (newcpu.c:7832)
==5238==    by 0x2B5576: main (main.c:983)
==5238==
==5238== Use of uninitialised value of size 8
==5238==    at 0x333FAB: read_dcache030_2 (newcpu.c:10235)
==5238==    by 0x32F157: read_dcache030 (newcpu.c:10312)
==5238==    by 0x32F157: read_dcache030_bget (newcpu.c:10338)
==5238==    by 0x32F157: get_byte_dc030 (cpu_prefetch.h:303)
==5238==    by 0x7E115A: op_1130_23_ff (cpuemu_23.c:9214)
==5238==    by 0x340AF0: m68k_run_2ce (newcpu.c:7036)
==5238==    by 0x33CDE1: m68k_go (newcpu.c:7832)
==5238==    by 0x2B5576: main (main.c:983)
....
==5238== Use of uninitialised value of size 8
==5238==    at 0x32F40A: dcache_check_nommu (newcpu.c:848)
==5238==    by 0x333FC3: read_dcache030_2 (newcpu.c:10238)
==5238==    by 0x32F157: read_dcache030 (newcpu.c:10312)
==5238==    by 0x32F157: read_dcache030_bget (newcpu.c:10338)
==5238==    by 0x32F157: get_byte_dc030 (cpu_prefetch.h:303)
==5238==    by 0x7E115A: op_1130_23_ff (cpuemu_23.c:9214)
==5238==    by 0x340AF0: m68k_run_2ce (newcpu.c:7036)
==5238==    by 0x33CDE1: m68k_go (newcpu.c:7832)
==5238==    by 0x2B5576: main (main.c:983)
==5238==
==5238== Use of uninitialised value of size 8
==5238==    at 0x330902: mem_access_delay_long_read_ce020 (newcpu.c:9512)
==5238==    by 0x333FD9: read_dcache030_2 (newcpu.c:10241)
==5238==    by 0x32F157: read_dcache030 (newcpu.c:10312)
==5238==    by 0x32F157: read_dcache030_bget (newcpu.c:10338)
==5238==    by 0x32F157: get_byte_dc030 (cpu_prefetch.h:303)
==5238==    by 0x7E115A: op_1130_23_ff (cpuemu_23.c:9214)
==5238==    by 0x340AF0: m68k_run_2ce (newcpu.c:7036)
==5238==    by 0x33CDE1: m68k_go (newcpu.c:7832)
==5238==    by 0x2B5576: main (main.c:983)
==5238==
==5238== Use of uninitialised value of size 8
==5238==    at 0x35F7CC: memory_get_long (memory.c:2044)
==5238==    by 0x33099C: get_long (memory.h:560)
==5238==    by 0x33099C: mem_access_delay_long_read_ce020 (newcpu.c:9527)
==5238==    by 0x333FD9: read_dcache030_2 (newcpu.c:10241)
==5238==    by 0x32F157: read_dcache030 (newcpu.c:10312)
==5238==    by 0x32F157: read_dcache030_bget (newcpu.c:10338)
==5238==    by 0x32F157: get_byte_dc030 (cpu_prefetch.h:303)
==5238==    by 0x7E115A: op_1130_23_ff (cpuemu_23.c:9214)
==5238==    by 0x340AF0: m68k_run_2ce (newcpu.c:7036)
==5238==    by 0x33CDE1: m68k_go (newcpu.c:7832)
==5238==    by 0x2B5576: main (main.c:983)
==5238==
==5238== Use of uninitialised value of size 8
==5238==    at 0x35F7E8: __bswap_32 (byteswap.h:52)
==5238==    by 0x35F7E8: do_get_mem_long (maccess.h:46)
==5238==    by 0x35F7E8: memory_get_long (memory.c:2052)
==5238==    by 0x33099C: get_long (memory.h:560)
==5238==    by 0x33099C: mem_access_delay_long_read_ce020 (newcpu.c:9527)
==5238==    by 0x333FD9: read_dcache030_2 (newcpu.c:10241)
==5238==    by 0x32F157: read_dcache030 (newcpu.c:10312)
==5238==    by 0x32F157: read_dcache030_bget (newcpu.c:10338)
==5238==    by 0x32F157: get_byte_dc030 (cpu_prefetch.h:303)
==5238==    by 0x7E115A: op_1130_23_ff (cpuemu_23.c:9214)
==5238==    by 0x340AF0: m68k_run_2ce (newcpu.c:7036)
==5238==    by 0x33CDE1: m68k_go (newcpu.c:7832)
==5238==    by 0x2B5576: main (main.c:983)
==5238==
==5238== Use of uninitialised value of size 8
==5238==    at 0x333FDA: update_dcache030 (newcpu.c:9799)
==5238==    by 0x333FDA: read_dcache030_2 (newcpu.c:10242)
==5238==    by 0x32F157: read_dcache030 (newcpu.c:10312)
==5238==    by 0x32F157: read_dcache030_bget (newcpu.c:10338)
==5238==    by 0x32F157: get_byte_dc030 (cpu_prefetch.h:303)
==5238==    by 0x7E115A: op_1130_23_ff (cpuemu_23.c:9214)
==5238==    by 0x340AF0: m68k_run_2ce (newcpu.c:7036)
==5238==    by 0x33CDE1: m68k_go (newcpu.c:7832)
==5238==    by 0x2B5576: main (main.c:983)
==5238==
==5238== Use of uninitialised value of size 8
==5238==    at 0x333FE8: update_dcache030 (newcpu.c:9800)
==5238==    by 0x333FE8: read_dcache030_2 (newcpu.c:10242)
==5238==    by 0x32F157: read_dcache030 (newcpu.c:10312)
==5238==    by 0x32F157: read_dcache030_bget (newcpu.c:10338)
==5238==    by 0x32F157: get_byte_dc030 (cpu_prefetch.h:303)
==5238==    by 0x7E115A: op_1130_23_ff (cpuemu_23.c:9214)
==5238==    by 0x340AF0: m68k_run_2ce (newcpu.c:7036)
==5238==    by 0x33CDE1: m68k_go (newcpu.c:7832)
==5238==    by 0x2B5576: main (main.c:983)
==5238==
==5238== Use of uninitialised value of size 8
==5238==    at 0x333FFE: update_dcache030 (newcpu.c:9803)
==5238==    by 0x333FFE: read_dcache030_2 (newcpu.c:10242)
==5238==    by 0x32F157: read_dcache030 (newcpu.c:10312)
==5238==    by 0x32F157: read_dcache030_bget (newcpu.c:10338)
==5238==    by 0x32F157: get_byte_dc030 (cpu_prefetch.h:303)
==5238==    by 0x7E115A: op_1130_23_ff (cpuemu_23.c:9214)
==5238==    by 0x340AF0: m68k_run_2ce (newcpu.c:7036)
==5238==    by 0x33CDE1: m68k_go (newcpu.c:7832)
==5238==    by 0x2B5576: main (main.c:983)
==5238==
==5238== Use of uninitialised value of size 8
==5238==    at 0x334004: update_dcache030 (newcpu.c:9804)
==5238==    by 0x334004: read_dcache030_2 (newcpu.c:10242)
==5238==    by 0x32F157: read_dcache030 (newcpu.c:10312)
==5238==    by 0x32F157: read_dcache030_bget (newcpu.c:10338)
==5238==    by 0x32F157: get_byte_dc030 (cpu_prefetch.h:303)
==5238==    by 0x7E115A: op_1130_23_ff (cpuemu_23.c:9214)
==5238==    by 0x340AF0: m68k_run_2ce (newcpu.c:7036)
==5238==    by 0x33CDE1: m68k_go (newcpu.c:7832)
==5238==    by 0x2B5576: main (main.c:983)
==5238==
==5238== Use of uninitialised value of size 8
==5238==    at 0x333DA8: dcache030_maybe_burst.constprop.0 (newcpu.c:10087)
==5238==    by 0x3341D8: read_dcache030_2 (newcpu.c:10244)
==5238==    by 0x32F157: read_dcache030 (newcpu.c:10312)
==5238==    by 0x32F157: read_dcache030_bget (newcpu.c:10338)
==5238==    by 0x32F157: get_byte_dc030 (cpu_prefetch.h:303)
==5238==    by 0x7E115A: op_1130_23_ff (cpuemu_23.c:9214)
==5238==    by 0x340AF0: m68k_run_2ce (newcpu.c:7036)
==5238==    by 0x33CDE1: m68k_go (newcpu.c:7832)
==5238==    by 0x2B5576: main (main.c:983)
==5238==
==5238== Use of uninitialised value of size 8
==5238==    at 0x333DEA: dcache030_maybe_burst.constprop.0 (newcpu.c:10093)
==5238==    by 0x3341D8: read_dcache030_2 (newcpu.c:10244)
==5238==    by 0x32F157: read_dcache030 (newcpu.c:10312)
==5238==    by 0x32F157: read_dcache030_bget (newcpu.c:10338)
==5238==    by 0x32F157: get_byte_dc030 (cpu_prefetch.h:303)
==5238==    by 0x7E115A: op_1130_23_ff (cpuemu_23.c:9214)
==5238==    by 0x340AF0: m68k_run_2ce (newcpu.c:7036)
==5238==    by 0x33CDE1: m68k_go (newcpu.c:7832)
==5238==    by 0x2B5576: main (main.c:983)
==5238==
==5238== Use of uninitialised value of size 8
==5238==    at 0x333DF6: dcache030_maybe_burst.constprop.0 (newcpu.c:10096)
==5238==    by 0x3341D8: read_dcache030_2 (newcpu.c:10244)
==5238==    by 0x32F157: read_dcache030 (newcpu.c:10312)
==5238==    by 0x32F157: read_dcache030_bget (newcpu.c:10338)
==5238==    by 0x32F157: get_byte_dc030 (cpu_prefetch.h:303)
==5238==    by 0x7E115A: op_1130_23_ff (cpuemu_23.c:9214)
==5238==    by 0x340AF0: m68k_run_2ce (newcpu.c:7036)
==5238==    by 0x33CDE1: m68k_go (newcpu.c:7832)
==5238==    by 0x2B5576: main (main.c:983)
....
(lot more of these)


Then something I could look again:
==5238== Conditional jump or move depends on uninitialised value(s)
==5238==    at 0xC3B748: Console_Check (console.c:273)
==5238==    by 0x34021C: do_specialties.constprop.0 (newcpu.c:5274)
==5238==    by 0x340BDF: m68k_run_2ce (newcpu.c:7060)
==5238==    by 0x33CDE1: m68k_go (newcpu.c:7832)
==5238==    by 0x2B5576: main (main.c:983)
==5238==
==5238== Conditional jump or move depends on uninitialised value(s)
==5238==    at 0xC3B8D0: vt52_emu (console.c:167)
==5238==    by 0xC3B8D0: Console_Check (console.c:284)
==5238==    by 0x34021C: do_specialties.constprop.0 (newcpu.c:5274)
==5238==    by 0x340BDF: m68k_run_2ce (newcpu.c:7060)
==5238==    by 0x33CDE1: m68k_go (newcpu.c:7832)
==5238==    by 0x2B5576: main (main.c:983)
==5238==
==5238== Conditional jump or move depends on uninitialised value(s)
==5238==    at 0xC3B93D: vt52_emu (console.c:204)
==5238==    by 0xC3B93D: Console_Check (console.c:284)
==5238==    by 0x34021C: do_specialties.constprop.0 (newcpu.c:5274)
==5238==    by 0x340BDF: m68k_run_2ce (newcpu.c:7060)
==5238==    by 0x33CDE1: m68k_go (newcpu.c:7832)
==5238==    by 0x2B5576: main (main.c:983)
==5238== Conditional jump or move depends on uninitialised value(s)
==5238==    at 0xC3B5FF: map_character (console.c:96)
==5238==    by 0xC3B95E: vt52_emu (console.c:219)
==5238==    by 0xC3B95E: Console_Check (console.c:284)
==5238==    by 0x34021C: do_specialties.constprop.0 (newcpu.c:5274)
==5238==    by 0x340BDF: m68k_run_2ce (newcpu.c:7060)
==5238==    by 0x33CDE1: m68k_go (newcpu.c:7832)
==5238==    by 0x2B5576: main (main.c:983)
==5238==
==5238== Conditional jump or move depends on uninitialised value(s)
==5238==    at 0xC3B604: map_character (console.c:98)
==5238==    by 0xC3B95E: vt52_emu (console.c:219)
==5238==    by 0xC3B95E: Console_Check (console.c:284)
==5238==    by 0x34021C: do_specialties.constprop.0 (newcpu.c:5274)
==5238==    by 0x340BDF: m68k_run_2ce (newcpu.c:7060)
==5238==    by 0x33CDE1: m68k_go (newcpu.c:7832)
==5238==    by 0x2B5576: main (main.c:983)
==5238==
==5238== Conditional jump or move depends on uninitialised value(s)
==5238==    at 0x542F249: _IO_file_overflow@@GLIBC_2.2.5 (fileops.c:782)
==5238==    by 0x542A879: fputc (fputc.c:38)
==5238==    by 0xC3B95E: vt52_emu (console.c:219)
==5238==    by 0xC3B95E: Console_Check (console.c:284)
==5238==    by 0x34021C: do_specialties.constprop.0 (newcpu.c:5274)
==5238==    by 0x340BDF: m68k_run_2ce (newcpu.c:7060)
==5238==    by 0x33CDE1: m68k_go (newcpu.c:7832)
==5238==    by 0x2B5576: main (main.c:983)


Then again warnings for CPU core, until ScummVM started to use Videl...

Several of these from screenConvert.c lines 173-180, then from lines 165-172:
==5238== Use of uninitialised value of size 8
==5238==    at 0x2F938C: idx2pal (screenConvert.c:87)
==5238==    by 0x2F938C: Screen_BitplaneToChunky32 (screenConvert.c:173)
==5238== by 0x2F9F40: ScreenConv_BitplaneLineTo32bpp (screenConvert.c:203) ==5238== by 0x2F9F40: ScreenConv_BitplaneTo32bppZoomed (screenConvert.c:469)
==5238==    by 0x2F9F40: Screen_ConvertWithZoom (screenConvert.c:665)
==5238==    by 0x2F9F40: Screen_GenConvert (screenConvert.c:686)
==5238==    by 0x313E66: VIDEL_renderScreen (videl.c:968)
==5238==    by 0x3081C4: Video_DrawScreen (video.c:4441)
==5238==    by 0x3081C4: Video_InterruptHandler_VBL (video.c:4610)
==5238==    by 0x340BA0: CycInt_Process_stop (cycInt.h:135)
==5238==    by 0x340BA0: m68k_run_2ce (newcpu.c:7053)
==5238==    by 0x33CDE1: m68k_go (newcpu.c:7832)
==5238==    by 0x2B5576: main (main.c:983)


Some more errors from CPU core until ScummVM started to use FPU...

==5238== Conditional jump or move depends on uninitialised value(s)
==5238==    at 0x34663F: fpsr_set_result_always (fpp.c:606)
==5238==    by 0x346737: fp_arithmetic (fpp.c:3155)
==5238==    by 0x34A299: fpuop_arithmetic2 (fpp.c:3582)
==5238==    by 0x34A299: fpuop_arithmetic (fpp.c:3610)
==5238==    by 0x818087: op_f200_23_ff (cpuemu_23.c:46258)
==5238==    by 0x340AF0: m68k_run_2ce (newcpu.c:7036)
==5238==    by 0x33CDE1: m68k_go (newcpu.c:7832)
==5238==    by 0x2B5576: main (main.c:983)
==5238==
==5238== Conditional jump or move depends on uninitialised value(s)
==5238==    at 0x34665C: fpsr_set_result (fpp.c:615)
==5238==    by 0x34673F: fp_arithmetic (fpp.c:3156)
==5238==    by 0x34A299: fpuop_arithmetic2 (fpp.c:3582)
==5238==    by 0x34A299: fpuop_arithmetic (fpp.c:3610)
==5238==    by 0x818087: op_f200_23_ff (cpuemu_23.c:46258)
==5238==    by 0x340AF0: m68k_run_2ce (newcpu.c:7036)
==5238==    by 0x33CDE1: m68k_go (newcpu.c:7832)
==5238==    by 0x2B5576: main (main.c:983)
==5238==
==5238== Conditional jump or move depends on uninitialised value(s)
==5238==    at 0x34667B: fpsr_set_result (fpp.c:617)
==5238==    by 0x34667B: fpsr_set_result (fpp.c:612)
==5238==    by 0x34673F: fp_arithmetic (fpp.c:3156)
==5238==    by 0x34A299: fpuop_arithmetic2 (fpp.c:3582)
==5238==    by 0x34A299: fpuop_arithmetic (fpp.c:3610)
==5238==    by 0x818087: op_f200_23_ff (cpuemu_23.c:46258)
==5238==    by 0x340AF0: m68k_run_2ce (newcpu.c:7036)
==5238==    by 0x33CDE1: m68k_go (newcpu.c:7832)
==5238==    by 0x2B5576: main (main.c:983)
==5238==
==5238== Conditional jump or move depends on uninitialised value(s)
==5238==    at 0x4A6653C: frexpl (s_frexpl.c:48)
==5238==    by 0x34C0EC: fp_sglmul (fpp_native.c:966)
==5238==    by 0x3469DE: fp_arithmetic (fpp.c:3100)
==5238==    by 0x34A299: fpuop_arithmetic2 (fpp.c:3582)
==5238==    by 0x34A299: fpuop_arithmetic (fpp.c:3610)
==5238==    by 0x818087: op_f200_23_ff (cpuemu_23.c:46258)
==5238==    by 0x340AF0: m68k_run_2ce (newcpu.c:7036)
==5238==    by 0x33CDE1: m68k_go (newcpu.c:7832)
==5238==    by 0x2B5576: main (main.c:983)
==5238==
==5238== Conditional jump or move depends on uninitialised value(s)
==5238==    at 0x4A665D6: ldexpl (s_ldexp_template.c:23)
==5238==    by 0x34C109: fp_sglmul (fpp_native.c:967)
==5238==    by 0x3469DE: fp_arithmetic (fpp.c:3100)
==5238==    by 0x34A299: fpuop_arithmetic2 (fpp.c:3582)
==5238==    by 0x34A299: fpuop_arithmetic (fpp.c:3610)
==5238==    by 0x818087: op_f200_23_ff (cpuemu_23.c:46258)
==5238==    by 0x340AF0: m68k_run_2ce (newcpu.c:7036)
==5238==    by 0x33CDE1: m68k_go (newcpu.c:7832)
==5238==    by 0x2B5576: main (main.c:983)
....
==5238== Conditional jump or move depends on uninitialised value(s)
==5238==    at 0x34D200: fp_to_int (fpp_native.c:486)
==5238==    by 0x34ADBA: put_fp_value2 (fpp.c:1901)
==5238==    by 0x34ADBA: put_fp_value (fpp.c:2035)
==5238==    by 0x34ADBA: fpuop_arithmetic2 (fpp.c:3191)
==5238==    by 0x34ADBA: fpuop_arithmetic (fpp.c:3610)
==5238==    by 0x818087: op_f200_23_ff (cpuemu_23.c:46258)
==5238==    by 0x340AF0: m68k_run_2ce (newcpu.c:7036)
==5238==    by 0x33CDE1: m68k_go (newcpu.c:7832)
==5238==    by 0x2B5576: main (main.c:983)


After which Valgrind stopped reporting additional ones, as its limit had been exceeded (until I got into crash I was debugging).


	- Eero



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/