-
Notifications
You must be signed in to change notification settings - Fork 192
Description
I am opening this a like a tracking issue for some reports I got when running the memory sanitiser (go build -msan) on a GLFW app. To be fair, I don't quite know if the issues reported are because of memory in our project here being passed down to lower level libraries or if the other projects are having their own issues. If this isn't a bug on our side I guess it might be worth keeping track of it and link to any issues we open in the corresponding libraries. In general, I think we should get apps here runnable with the memory sanitizer so we can find issues more easily in more parts of the C code (also in C code that we have in Fyne for example).
More investigation needed, I think. I'm attaching reports from a regular x11 build and one with -tags wayland. This is on a Fedora 42 installation.
X11:
Uninitialized bytes in MemcmpInterceptorCommon at offset 0 inside [0x7020000004c0, 12)
==132388==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x0000004441d0 in memcmp (/var/home/jacob/git/hegelmote/hegelmote+0x4441d0) (BuildId: b14a41a3fb7d3178496a76805ae99f5c7f899159)
#1 0x7f6e89687ca8 in _XrmInternalStringToQuark (/lib64/libX11.so.6+0x1fca8) (BuildId: 8f28697b2d621047d2d9af73879f1178e7b7007c)
#2 0x7f6e896a8dfc in _XlcCreateDefaultCharSet (/lib64/libX11.so.6+0x40dfc) (BuildId: 8f28697b2d621047d2d9af73879f1178e7b7007c)
#3 0x7f6e896a91e2 in _XlcAddCT (/lib64/libX11.so.6+0x411e2) (BuildId: 8f28697b2d621047d2d9af73879f1178e7b7007c)
#4 0x7f6e896a9387 in _XlcInitCTInfo (/lib64/libX11.so.6+0x41387) (BuildId: 8f28697b2d621047d2d9af73879f1178e7b7007c)
#5 0x7f6e896aded3 (/lib64/libX11.so.6+0x45ed3) (BuildId: 8f28697b2d621047d2d9af73879f1178e7b7007c)
#6 0x7f6e896ade0e (/lib64/libX11.so.6+0x45e0e) (BuildId: 8f28697b2d621047d2d9af73879f1178e7b7007c)
#7 0x7f6e896a7653 in _XlcCreateLC (/lib64/libX11.so.6+0x3f653) (BuildId: 8f28697b2d621047d2d9af73879f1178e7b7007c)
#8 0x7f6e896d33eb in _XlcUtf8Loader (/lib64/libX11.so.6+0x6b3eb) (BuildId: 8f28697b2d621047d2d9af73879f1178e7b7007c)
#9 0x7f6e896b5748 in _XOpenLC (/lib64/libX11.so.6+0x4d748) (BuildId: 8f28697b2d621047d2d9af73879f1178e7b7007c)
#10 0x7f6e896b5ba6 in _XrmInitParseInfo (/lib64/libX11.so.6+0x4dba6) (BuildId: 8f28697b2d621047d2d9af73879f1178e7b7007c)
#11 0x7f6e8969dc2f (/lib64/libX11.so.6+0x35c2f) (BuildId: 8f28697b2d621047d2d9af73879f1178e7b7007c)
#12 0x7f6e8969e102 in XrmGetStringDatabase (/lib64/libX11.so.6+0x36102) (BuildId: 8f28697b2d621047d2d9af73879f1178e7b7007c)
#13 0x00000113ab88 in getSystemContentScale /var/home/jacob/go/pkg/mod/github.com/go-gl/glfw/v3.3/[email protected]/glfw/src/x11_init.c:932:26
#14 0x00000113ab88 in _glfwPlatformInit /var/home/jacob/go/pkg/mod/github.com/go-gl/glfw/v3.3/[email protected]/glfw/src/x11_init.c:1127:5
#15 0x000001117c94 in glfwInit /var/home/jacob/go/pkg/mod/github.com/go-gl/glfw/v3.3/[email protected]/glfw/src/init.c:327:10
#16 0x0000011472e3 in _cgo_6c72bc2475f0_Cfunc_glfwInit /tmp/go-build/cgo-gcc-prolog:105:11
#17 0x00000051b3e3 in runtime.asmcgocall.abi0 /usr/lib/golang/src/runtime/asm_amd64.s:923
SUMMARY: MemorySanitizer: use-of-uninitialized-value (/var/home/jacob/git/hegelmote/hegelmote+0x4441d0) (BuildId: b14a41a3fb7d3178496a76805ae99f5c7f899159) in memcmp
Exiting
Wayland
# github.com/go-gl/glfw/v3.3/glfw
In file included from ../../go/pkg/mod/github.com/go-gl/glfw/v3.3/[email protected]/c_glfw_lin.go:10:
../../go/pkg/mod/github.com/go-gl/glfw/v3.3/[email protected]/glfw/src/wl_window.c:29:9: warning: '_GNU_SOURCE' macro redefined [-Wmacro-redefined]
<command line>:2:9: note: previous definition is here
jacob@toolbx ~/g/hegelmote (main)> ./hegelmote
Uninitialized bytes in strlen at offset 0 inside [0x702000006480, 29)
==133469==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x7f48f46d26c9 in _dbus_strdup (/lib64/libdbus-1.so.3+0x2b6c9) (BuildId: 12065551b6de37fb1f63691d2d79463e8fb13937)
#1 0x7f48f46b658a (/lib64/libdbus-1.so.3+0xf58a) (BuildId: 12065551b6de37fb1f63691d2d79463e8fb13937)
#2 0x7f48a9b50e7a (/usr/lib64/libdecor/plugins-1/libdecor-gtk.so+0x6e7a) (BuildId: 6a476e7c73a4a479b711af2052f6e99883994060)
#3 0x7f48f5573a61 in libdecor_new (/lib64/libdecor-0.so.0+0x2a61) (BuildId: 9d1b6b4805d5238e5922f1f78d2e299b894333b2)
#4 0x00000112728f in _glfwPlatformInit /var/home/jacob/go/pkg/mod/github.com/go-gl/glfw/v3.3/[email protected]/glfw/src/wl_init.c:582:37
#5 0x000001116654 in glfwInit /var/home/jacob/go/pkg/mod/github.com/go-gl/glfw/v3.3/[email protected]/glfw/src/init.c:327:10
#6 0x00000113adf3 in _cgo_5106c43b8fc8_Cfunc_glfwInit /tmp/go-build/cgo-gcc-prolog:105:11
#7 0x00000051af23 in runtime.asmcgocall.abi0 /usr/lib/golang/src/runtime/asm_amd64.s:923
SUMMARY: MemorySanitizer: use-of-uninitialized-value (/lib64/libdbus-1.so.3+0x2b6c9) (BuildId: 12065551b6de37fb1f63691d2d79463e8fb13937) in _dbus_strdup
Exiting