I had some things built with debug symbols for something else so as I was set up for this atm I built xscreensaver likewise and got a bt from the coredump with gdb, & ran it with valgrind if it helps.
gdb log of backtrace, cat in terminal to get color display from the included control chars:
#0 ^[[34m0x00007f5137d41f25^[[m in ^[[33mraise^[[m () from /usr/lib/libc.so.6
#1 ^[[34m0x00007f5137d2b897^[[m in ^[[33mabort^[[m () from /usr/lib/libc.so.6
#2 ^[[34m0x00007f5137d85258^[[m in ^[[33m__libc_message^[[m () from /usr/lib/libc.so.6
#3 ^[[34m0x00007f5137d8c77a^[[m in ^[[33mmalloc_printerr^[[m () from /usr/lib/libc.so.6
#4 ^[[34m0x00007f5137d8f6c4^[[m in ^[[33m_int_malloc^[[m () from /usr/lib/libc.so.6
#5 ^[[34m0x00007f5137d91c15^[[m in ^[[33mcalloc^[[m () from /usr/lib/libc.so.6
#6 ^[[34m0x00007f51357a967d^[[m in ^[[33mnv50_miptree_create^[[m (^[[36mpscreen^[[m=0x55f772e4e440, ^[[36mtempl^[[m=0x7ffcb5a6bc20) at ^[[32m../mesa-19.2.3/src/gallium/drivers/n
ouveau/nv50/nv50_miptree.c^[[m:339
#7 ^[[34m0x00007f51357acdbc^[[m in ^[[33mnv50_resource_create^[[m (^[[36mscreen^[[m=<optimized out>, ^[[36mtempl^[[m=<optimized out>) at ^[[32m../mesa-19.2.3/src/gallium/drivers
/nouveau/nv50/nv50_resource.c^[[m:18
#8 ^[[34m0x00007f5135a1a13a^[[m in ^[[33mst_texture_create^[[m (^[[36mst=st@entry^[[m=0x55f772eadea0, ^[[36mtarget^[[m=<optimized out>, ^[[36mformat=format@entry^[[m=PIPE_FORMAT
_R8G8B8A8_UNORM, ^[[36mlast_level=last_level@entry^[[m=0, ^[[m
^[[m^[[36mwidth0^[[m=<optimized out>, ^[[36mheight0^[[m=<optimized out>, ^[[36mdepth0^[[m=1, ^[[36mlayers^[[m=1, ^[[36mnr_samples^[[m=0, ^[[36mbind^[[m=10) at ^[[32m../mesa-1
9.2.3/src/mesa/state_tracker/st_texture.c^[[m:100
#9 ^[[34m0x00007f5135a077da^[[m in ^[[33mguess_and_alloc_texture^[[m (^[[36mst=st@entry^[[m=0x55f772eadea0, ^[[36mstObj=stObj@entry^[[m=0x55f772edcdd0, ^[[36mstImage=stImage@ent
ry^[[m=0x55f772ed54e0)^[[m
^[[m at ^[[32m../mesa-19.2.3/src/mesa/state_tracker/st_cb_texture.c^[[m:632
#10 ^[[34m0x00007f5135a07ed4^[[m in ^[[33mst_AllocTextureImageBuffer^[[m (^[[36mctx^[[m=0x55f772defaf0, ^[[36mtexImage^[[m=0x55f772ed54e0) at ^[[32m../mesa-19.2.3/src/mesa/state_
tracker/st_cb_texture.c^[[m:689
#11 ^[[34m0x00007f5135a0b341^[[m in ^[[33mst_TexImage^[[m (^[[36mctx^[[m=0x55f772defaf0, ^[[36mdims^[[m=2, ^[[36mtexImage^[[m=0x55f772ed54e0, ^[[36mformat^[[m=6408, ^[[36mtype^[[
m=5121, ^[[36mpixels^[[m=0x55f772ee4010, ^[[36munpack^[[m=0x55f772df9530)^[[m
^[[m at ^[[32m../mesa-19.2.3/src/mesa/state_tracker/st_cb_texture.c^[[m:1716
#12 ^[[34m0x00007f51359c5cf2^[[m in ^[[33mteximage^[[m (^[[36mno_error^[[m=false, ^[[36mpixels^[[m=0x55f772ee4010, ^[[36mimageSize^[[m=0, ^[[36mtype^[[m=5121, ^[[36mformat^[[m=64
08, ^[[36mborder^[[m=0, ^[[36mdepth^[[m=<optimized out>, ^[[36mheight^[[m=<optimized out>, ^[[m
^[[m^[[36mwidth^[[m=<optimized out>, ^[[36minternalFormat^[[m=6408, ^[[36mlevel^[[m=0, ^[[36mtarget^[[m=3553, ^[[36mtexObj^[[m=0x55f772edcdd0, ^[[36mdims^[[m=2, ^[[36mcompres
sed^[[m=0 '\000', ^[[36mctx^[[m=0x55f772defaf0)^[[m
^[[m at ^[[32m../mesa-19.2.3/src/mesa/main/teximage.c^[[m:3141
#13 ^[[33mteximage_err^[[m (^[[36mctx^[[m=0x55f772defaf0, ^[[36mcompressed=compressed@entry^[[m=0 '\000', ^[[36mdims=dims@entry^[[m=2, ^[[36mtarget^[[m=3553, ^[[36mlevel^[[m=0, [
^[[36minternalFormat^[[m=<optimized out>, ^[[36mwidth^[[m=256, ^[[36mheight^[[m=256, ^[[m
^[[m^[[36mdepth^[[m=1, ^[[36mborder^[[m=<optimized out>, ^[[36mformat^[[m=6408, ^[[36mtype^[[m=5121, ^[[36mimageSize^[[m=0, ^[[36mpixels^[[m=0x55f772ee4010) at ^[[32m../mesa-
19.2.3/src/mesa/main/teximage.c^[[m:3168
#14 ^[[34m0x00007f51359c77ac^[[m in ^[[33m_mesa_TexImage2D^[[m (^[[36mtarget^[[m=<optimized out>, ^[[36mlevel^[[m=<optimized out>, ^[[36minternalFormat^[[m=<optimized out>, ^[[36
mwidth^[[m=<optimized out>, ^[[36mheight^[[m=<optimized out>, ^[[m
^[[m^[[36mborder^[[m=<optimized out>, ^[[36mformat^[[m=6408, ^[[36mtype^[[m=5121, ^[[36mpixels^[[m=0x55f772ee4010) at ^[[32m../mesa-19.2.3/src/mesa/main/teximage.c^[[m:3239
#15 ^[[34m0x000055f7724e1928^[[m in ^[[33mmakeTextures^[[m (^[[36mglhanoi=glhanoi@entry^[[m=0x55f772dec6d0) at ^[[32mglhanoi.c^[[m:1560
#16 ^[[34m0x000055f7724e3917^[[m in ^[[33minit_glhanoi^[[m (^[[36mmi^[[m=0x55f772debe80) at ^[[32mglhanoi.c^[[m:1927
#17 ^[[34m0x000055f7724e5595^[[m in ^[[33mxlockmore_do_init^[[m (^[[36mmi=mi@entry^[[m=0x55f772debe80) at ^[[32mxlockmore.c^[[m:576
#18 ^[[34m0x000055f7724e55b6^[[m in ^[[33mxlockmore_check_init^[[m (^[[36mmi=mi@entry^[[m=0x55f772debe80) at ^[[32mxlockmore.c^[[m:603
#19 ^[[34m0x000055f7724e55db^[[m in ^[[33mxlockmore_event^[[m (^[[36mdpy^[[m=<optimized out>, ^[[36mwindow^[[m=<optimized out>, ^[[36mclosure^[[m=0x55f772debe80, ^[[36mevent^[[m=
0x7ffcb5a6bf90) at ^[[32mxlockmore.c^[[m:679
#20 ^[[34m0x000055f7724e4517^[[m in ^[[33mscreenhack_table_handle_events^[[m (^[[36mdpy^[[m=0x55f772db73d0, ^[[36mft^[[m=0x55f7724fb380 <glhanoi_xscreensaver_function_table>, ^[[
36mwindow^[[m=41943041, ^[[36mclosure^[[m=0x55f772debe80, ^[[m
^[[m^[[36mwindow2^[[m=0, ^[[36mclosure2^[[m=0x0) at ^[[32mscreenhack.c^[[m:459
#21 ^[[34m0x000055f7724e4652^[[m in ^[[33musleep_and_process_events^[[m (^[[36mdpy^[[m=0x55f772db73d0, ^[[36mft^[[m=0x55f7724fb380 <glhanoi_xscreensaver_function_table>, ^[[36mwi
ndow^[[m=41943041, ^[[36mfpst^[[m=0x0, ^[[m
^[[m^[[36mclosure^[[m=0x55f772debe80, ^[[36mdelay^[[m=0, ^[[36mwindow2^[[m=0, ^[[36mfpst2^[[m=0x0, ^[[36mclosure2^[[m=0x0, ^[[36mdelay2^[[m=0) at ^[[32mscreenhack.c^[[m:526
#22 ^[[34m0x000055f7724e47ce^[[m in ^[[33mrun_screenhack_table^[[m (^[[36mdpy^[[m=0x55f772db73d0, ^[[36mwindow^[[m=41943041, ^[[36mwindow2^[[m=0, ^[[36mft^[[m=0x55f7724fb380 <glh
anoi_xscreensaver_function_table>) at ^[[32mscreenhack.c^[[m:586
#23 ^[[34m0x000055f7724e5147^[[m in ^[[33mmain^[[m (^[[36margc^[[m=<optimized out>, ^[[36margv^[[m=<optimized out>) at ^[[32mscreenhack.c^[[m:987
(deleted ioctl false positive below btw)
$ valgrind --tool=memcheck --fullpath-after=/home/me --num-callers=100 /usr/lib/xscreensaver/glhanoi
==25044== Memcheck, a memory error detector
==25044== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==25044== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==25044== Command: /usr/lib/xscreensaver/glhanoi
==25044==
==25044== Invalid write of size 4
==25044== at 0x10F79A: makeTexture (/xscreensaver/build/src/xscreensaver-5.43/hacks/glx/glhanoi.c:1448)
==25044== by 0x10F880: makeTextures (/xscreensaver/build/src/xscreensaver-5.43/hacks/glx/glhanoi.c:1550)
==25044== by 0x111916: init_glhanoi (/xscreensaver/build/src/xscreensaver-5.43/hacks/glx/glhanoi.c:1927)
==25044== by 0x113594: xlockmore_do_init (/xscreensaver/build/src/xscreensaver-5.43/hacks/xlockmore.c:576)
==25044== by 0x1135B5: xlockmore_check_init (/xscreensaver/build/src/xscreensaver-5.43/hacks/xlockmore.c:603)
==25044== by 0x1135DA: xlockmore_event (/xscreensaver/build/src/xscreensaver-5.43/hacks/xlockmore.c:679)
==25044== by 0x112516: screenhack_table_handle_events (/xscreensaver/build/src/xscreensaver-5.43/hacks/screenhack.c:469)
==25044== by 0x112651: usleep_and_process_events (/xscreensaver/build/src/xscreensaver-5.43/hacks/screenhack.c:526)
==25044== by 0x1127CD: run_screenhack_table (/xscreensaver/build/src/xscreensaver-5.43/hacks/screenhack.c:586)
==25044== by 0x113146: main (/xscreensaver/build/src/xscreensaver-5.43/hacks/screenhack.c:987)
==25044== Address 0xf46db50 is 0 bytes after a block of size 65,536 alloc'd
==25044== at 0x483AB65: calloc (/build/valgrind/src/valgrind/coregrind/m_replacemalloc/vg_replace_malloc.c:762)
==25044== by 0x10F70F: makeTexture (/xscreensaver/build/src/xscreensaver-5.43/hacks/glx/glhanoi.c:1433)
==25044== by 0x10F880: makeTextures (/xscreensaver/build/src/xscreensaver-5.43/hacks/glx/glhanoi.c:1550)
==25044== by 0x111916: init_glhanoi (/xscreensaver/build/src/xscreensaver-5.43/hacks/glx/glhanoi.c:1927)
==25044== by 0x113594: xlockmore_do_init (/xscreensaver/build/src/xscreensaver-5.43/hacks/xlockmore.c:576)
==25044== by 0x1135B5: xlockmore_check_init (/xscreensaver/build/src/xscreensaver-5.43/hacks/xlockmore.c:603)
==25044== by 0x1135DA: xlockmore_event (/xscreensaver/build/src/xscreensaver-5.43/hacks/xlockmore.c:679)
==25044== by 0x112516: screenhack_table_handle_events (/xscreensaver/build/src/xscreensaver-5.43/hacks/screenhack.c:469)
==25044== by 0x112651: usleep_and_process_events (/xscreensaver/build/src/xscreensaver-5.43/hacks/screenhack.c:526)
==25044== by 0x1127CD: run_screenhack_table (/xscreensaver/build/src/xscreensaver-5.43/hacks/screenhack.c:586)
==25044== by 0x113146: main (/xscreensaver/build/src/xscreensaver-5.43/hacks/screenhack.c:987)
==25044==
--25044-- VALGRIND INTERNAL ERROR: Valgrind received a signal 7 (SIGBUS) - exiting
--25044-- si_code=128; Faulting address: 0x0; sp: 0x1003310e10
valgrind: the 'impossible' happened:
Killed by fatal signal
host stacktrace:
==25044== at 0x58050DBB: get_bszB_as_is (/build/valgrind/src/valgrind/coregrind/m_mallocfree.c:303)
==25044== by 0x58050DBB: get_bszB (/build/valgrind/src/valgrind/coregrind/m_mallocfree.c:315)
==25044== by 0x58050DBB: vgPlain_arena_malloc (/build/valgrind/src/valgrind/coregrind/m_mallocfree.c:1799)
==25044== by 0x580059C4: vgMemCheck_new_block (/build/valgrind/src/valgrind/memcheck/mc_malloc_wrappers.c:372)
==25044== by 0x5800614A: vgMemCheck_calloc (/build/valgrind/src/valgrind/memcheck/mc_malloc_wrappers.c:448)
==25044== by 0x580A4ECA: do_client_request (/build/valgrind/src/valgrind/coregrind/m_scheduler/scheduler.c:1966)
==25044== by 0x580A4ECA: vgPlain_scheduler (/build/valgrind/src/valgrind/coregrind/m_scheduler/scheduler.c:1521)
==25044== by 0x580F3550: thread_wrapper (/build/valgrind/src/valgrind/coregrind/m_syswrap/syswrap-linux.c:103)
==25044== by 0x580F3550: run_a_thread_NORETURN (/build/valgrind/src/valgrind/coregrind/m_syswrap/syswrap-linux.c:156)
sched status:
running_tid=1
Thread 1: status = VgTs_Runnable (lwpid 25044)
==25044== at 0x483AB65: calloc (/build/valgrind/src/valgrind/coregrind/m_replacemalloc/vg_replace_malloc.c:762)
==25044== by 0x69AC386: st_NewTextureImage (20mesa/src/build/../mesa-19.2.3/src/mesa/state_tracker/st_cb_texture.c:139)
==25044== by 0x6968CE2: _mesa_get_tex_image (20mesa/src/build/../mesa-19.2.3/src/mesa/main/teximage.c:396)
==25044== by 0x696C8F8: teximage (20mesa/src/build/../mesa-19.2.3/src/mesa/main/teximage.c:3122)
==25044== by 0x696C8F8: teximage_err (20mesa/src/build/../mesa-19.2.3/src/mesa/main/teximage.c:3168)
==25044== by 0x696E7AB: _mesa_TexImage2D (20mesa/src/build/../mesa-19.2.3/src/mesa/main/teximage.c:3239)
==25044== by 0x10F927: makeTextures (/xscreensaver/build/src/xscreensaver-5.43/hacks/glx/glhanoi.c:1560)
==25044== by 0x111916: init_glhanoi (/xscreensaver/build/src/xscreensaver-5.43/hacks/glx/glhanoi.c:1927)
==25044== by 0x113594: xlockmore_do_init (/xscreensaver/build/src/xscreensaver-5.43/hacks/xlockmore.c:576)
==25044== by 0x1135B5: xlockmore_check_init (/xscreensaver/build/src/xscreensaver-5.43/hacks/xlockmore.c:603)
==25044== by 0x1135DA: xlockmore_event (/xscreensaver/build/src/xscreensaver-5.43/hacks/xlockmore.c:679)
==25044== by 0x112516: screenhack_table_handle_events (/xscreensaver/build/src/xscreensaver-5.43/hacks/screenhack.c:469)
==25044== by 0x112651: usleep_and_process_events (/xscreensaver/build/src/xscreensaver-5.43/hacks/screenhack.c:526)
==25044== by 0x1127CD: run_screenhack_table (/xscreensaver/build/src/xscreensaver-5.43/hacks/screenhack.c:586)
==25044== by 0x113146: main (/xscreensaver/build/src/xscreensaver-5.43/hacks/screenhack.c:987)
client stack range: [0x1FFEFF6000 0x1FFF000FFF] client SP: 0x1FFEFFFA80
valgrind stack range: [0x1003211000 0x1003310FFF] top usage: 13472 of 1048576
Thread 2: status = VgTs_WaitSys syscall 202 (lwpid 25045)
==25044== at 0x4976C45: pthread_cond_wait@@GLIBC_2.3.2 (in /usr/lib/libpthread-2.30.so)
==25044== by 0x6C9BF8D: cnd_wait (20mesa/src/build/../mesa-19.2.3/include/c11/threads_posix.h:155)
==25044== by 0x6C9BF8D: util_queue_thread_func (20mesa/src/build/../mesa-19.2.3/src/util/u_queue.c:272)
==25044== by 0x6C9BA83: impl_thrd_routine (20mesa/src/build/../mesa-19.2.3/include/c11/threads_posix.h:87)
==25044== by 0x49704CE: start_thread (in /usr/lib/libpthread-2.30.so)
==25044== by 0x4DAD2D2: clone (in /usr/lib/libc-2.30.so)
client stack range: [0xEBC8000 0xF3C6FFF] client SP: 0xF3C6CB0
valgrind stack range: [0x1006F53000 0x1007052FFF] top usage: 2936 of 1048576
Note: see also the FAQ in the source distribution.
It contains workarounds to several common problems.
In particular, if Valgrind aborted or crashed after
identifying problems in your program, there's a good chance
that fixing those problems will prevent Valgrind aborting or
crashing, especially if it happened in m_mallocfree.c.
If that doesn't help, please report this bug to: www.valgrind.org
In the bug report, send all the above text, the valgrind
version, and what OS and version you are using. Thanks.