Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » Bugs (& fixes) » Problem with MemorySanitizer
Re: Problem with MemorySanitizer [message #56678 is a reply to message #56676] Fri, 02 April 2021 18:09 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
jjacksonRIAB wrote on Fri, 02 April 2021 17:16
#include <Core/Core.h>
#include <portaudio.h>

using namespace Upp;

void test() {
    Pa_Initialize();
}

INITBLOCK {
    test();
}

int main(int argc, const char *argv[]) {
	return 0;
}


Clang, linux.

Uninitialized bytes in __interceptor_strcmp at offset 8 inside [0x7010000002f0, 9)
==5039==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7fe8e59f8fea  (/usr/lib/x86_64-linux-gnu/libasound.so.2+0x2dfea)
    #1 0x7fe8e59f9e65  (/usr/lib/x86_64-linux-gnu/libasound.so.2+0x2ee65)
    #2 0x7fe8e59fa3fe  (/usr/lib/x86_64-linux-gnu/libasound.so.2+0x2f3fe)
    #3 0x7fe8e59fd77e in snd_config_update_r (/usr/lib/x86_64-linux-gnu/libasound.so.2+0x3277e)
    #4 0x7fe8e59fde0d in snd_config_update_ref (/usr/lib/x86_64-linux-gnu/libasound.so.2+0x32e0d)
    #5 0x7fe8e5a088b9 in snd_ctl_open (/usr/lib/x86_64-linux-gnu/libasound.so.2+0x3d8b9)
    #6 0x7fe8e6016737  (/usr/lib/x86_64-linux-gnu/libportaudio.so.2+0x11737)
    #7 0x7fe8e601a33c in PaAlsa_Initialize (/usr/lib/x86_64-linux-gnu/libportaudio.so.2+0x1533c)
    #8 0x7fe8e600d10f in Pa_Initialize (/usr/lib/x86_64-linux-gnu/libportaudio.so.2+0x810f)
    #9 0x4a10f6 in test() /mnt/ssd-b/MyApps/inittest/inittest.cpp:7:2
    #10 0x4a1108 in s__s10_fn() /mnt/ssd-b/MyApps/inittest/inittest.cpp:11:2
    #11 0x4a1259 in Upp::Callinit::Callinit(void (*)(), char const*, int) /home/borntactical/upp.src/uppsrc/Core/Defs.h:86:83
    #12 0x422914 in __cxx_global_var_init /mnt/ssd-b/MyApps/inittest/inittest.cpp:10:1
    #13 0x422928 in _GLOBAL__sub_I_inittest.cpp /mnt/ssd-b/MyApps/inittest/inittest.cpp
    #14 0x90de0c in __libc_csu_init (/home/borntactical/out/MyApps/CLANGsanitize.Debug.Debug_Full.Shared.Usemalloc/inittest+0x90de0c)
    #15 0x7fe8e5aed03f in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:264:6
    #16 0x42601d in _start (/home/borntactical/out/MyApps/CLANGsanitize.Debug.Debug_Full.Shared.Usemalloc/inittest+0x42601d)

SUMMARY: MemorySanitizer: use-of-uninitialized-value (/usr/lib/x86_64-linux-gnu/libasound.so.2+0x2dfea) 
Exiting
<--- Finished, press [ENTER] to close the window --->


I brought it up because it makes me wonder if an INITBLOCK is causing that complaint too


I actually think that the cause here is that INITBLOCK runs before main - it is possible that something in those libs is not initialised yet at that point.

Does it behave the same in main?
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Upp 12405 broken ?
Next Topic: strange situation in the ide with package that hasn't opened anymore.
Goto Forum:
  


Current Time: Tue May 07 07:02:19 CEST 2024

Total time taken to generate the page: 0.02135 seconds