Run new potential and sllod using kokkos in gpu

Hi,
I am currently running LAMMPS for SLLOD with a potential that we implemented in LAMMPS. One of the paper the potetial is mentioned is the following:
Leishangthem, P., Parmar, A. & Sastry, S. The yielding transition in amorphous solids under oscillatory shear deformation. Nat Commun 8, 14653 (2017). The yielding transition in amorphous solids under oscillatory shear deformation | Nature Communications

Now I want to run on gpu. As SLLOD is only implemented in kokkos package, I installed it. But the correspoding run is nearly 20 times slower than the cpu run. I suspect this might be because the pair potential is cpu version only. So I tried implementing it in kokkos. It compiled successfully but throws bunch of errors while running. The error is following.It will be nice if you could help some way.

*** Error in /home/swarnendu.tsu.jncasr/check_lammps_v4/lammps-23Jun2022/src/lmp_kokkos_cuda_mpi’: free(): invalid pointer: 0x000000000872fe40 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x81679)[0x7f9bf71ac679]
/home/swarnendu.tsu.jncasr/check_lammps_v4/lammps-23Jun2022/src/lmp_kokkos_cuda_mpi[0xbee026]
/home/swarnendu.tsu.jncasr/check_lammps_v4/lammps-23Jun2022/src/lmp_kokkos_cuda_mpi[0xf59ad0]
/home/swarnendu.tsu.jncasr/check_lammps_v4/lammps-23Jun2022/src/lmp_kokkos_cuda_mpi[0xf859d6]
/home/swarnendu.tsu.jncasr/check_lammps_v4/lammps-23Jun2022/src/lmp_kokkos_cuda_mpi[0xf9bb90]
/home/swarnendu.tsu.jncasr/check_lammps_v4/lammps-23Jun2022/src/lmp_kokkos_cuda_mpi[0xf9e9ab]
/home/swarnendu.tsu.jncasr/check_lammps_v4/lammps-23Jun2022/src/lmp_kokkos_cuda_mpi[0x5debf2]
/home/swarnendu.tsu.jncasr/check_lammps_v4/lammps-23Jun2022/src/lmp_kokkos_cuda_mpi[0xa0642a]
/home/swarnendu.tsu.jncasr/check_lammps_v4/lammps-23Jun2022/src/lmp_kokkos_cuda_mpi[0x46bb60]
/home/swarnendu.tsu.jncasr/check_lammps_v4/lammps-23Jun2022/src/lmp_kokkos_cuda_mpi[0x46c0b3]
/home/swarnendu.tsu.jncasr/check_lammps_v4/lammps-23Jun2022/src/lmp_kokkos_cuda_mpi[0x442a68]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7f9bf714d505]
/home/swarnendu.tsu.jncasr/check_lammps_v4/lammps-23Jun2022/src/lmp_kokkos_cuda_mpi[0x460dff]
======= Memory map: ========
00400000-03b88000 r-xp 00000000 b5:84fa2 144115643543806090 /home/swarnendu.tsu.jncasr/check_lammps_v4/lammps-23Jun2022/src/lmp_kokkos_cuda_mpi
03d87000-03d89000 r–p 03787000 b5:84fa2 144115643543806090 /home/swarnendu.tsu.jncasr/check_lammps_v4/lammps-23Jun2022/src/lmp_kokkos_cuda_mpi
03d89000-03d8c000 rw-p 03789000 b5:84fa2 144115643543806090 /home/swarnendu.tsu.jncasr/check_lammps_v4/lammps-23Jun2022/src/lmp_kokkos_cuda_mpi
03d8c000-0410a000 rw-p 00000000 00:00 0
043c6000-08a33000 rw-p 00000000 00:00 0 [heap]
200000000-200400000 —p 00000000 00:00 0
200400000-200600000 rw-s 00000000 00:05 397296 /dev/nvidiactl
200600000-200800000 rw-s 00000000 00:05 200720 /dev/nvidia0
200800000-205000000 rw-s 00000000 00:05 397296 /dev/nvidiactl
205000000-206000000 —p 00000000 00:00 0
206000000-206200000 rw-s 00000000 00:05 397296 /dev/nvidiactl
206200000-206400000 rw-s 00000000 00:05 397296 /dev/nvidiactl
206400000-206600000 rw-s 206400000 00:05 199818 /dev/nvidia-uvm
206600000-206800000 rw-s 00000000 00:05 397296 /dev/nvidiactl
206800000-206a00000 —p 00000000 00:00 0
206a00000-206c00000 rw-s 00000000 00:05 397296 /dev/nvidiactl
206c00000-206e00000 rw-s 00000000 00:01 9359527 /dev/zero (deleted)
206e00000-600200000 —p 00000000 00:00 0
10000000000-10004000000 —p 00000000 00:00 0
7f9ba0000000-7f9ba0021000 rw-p 00000000 00:00 0
7f9ba0021000-7f9ba4000000 —p 00000000 00:00 0
7f9ba4000000-7f9bb6c00000 —p 00000000 00:00 0
7f9bb6c00000-7f9bb6e00000 rw-s 00000000 00:01 9359530 /dev/zero (deleted)
7f9bb6e00000-7f9bb8600000 —p 00000000 00:00 0
7f9bb8600000-7f9bb8800000 rw-s 00000000 00:01 9359531 /dev/zero (deleted)
7f9bb8800000-7f9bc8000000 —p 00000000 00:00 0
7f9bc8000000-7f9bc8021000 rw-p 00000000 00:00 0
7f9bc8021000-7f9bcc000000 —p 00000000 00:00 0
7f9bce000000-7f9be0000000 —p 00000000 00:00 0
7f9be2000000-7f9be2400000 —p 00000000 00:00 0
7f9be2400000-7f9be2600000 rw-s 00000000 00:01 9359525 /dev/zero (deleted)
7f9be2600000-7f9be2800000 rw-s 00000000 00:05 397296 /dev/nvidiactl
7f9be2800000-7f9be2a00000 rw-s 00000000 00:01 9359526 /dev/zero (deleted)
7f9be2a00000-7f9be3000000 —p 00000000 00:00 0
7f9be3000000-7f9be3200000 rw-s 00000000 00:05 397296 /dev/nvidiactl
7f9be3200000-7f9be3400000 rw-s 00000000 00:01 9359528 /dev/zero (deleted)
7f9be3400000-7f9be3619000 rw-s 00000000 00:05 397296 /dev/nvidiactl
7f9be3619000-7f9be4000000 —p 00000000 00:00 0
7f9be4000000-7f9be4021000 rw-p 00000000 00:00 0
7f9be4021000-7f9be8000000 —p 00000000 00:00 0
7f9bea320000-7f9bea5fa000 rw-p 00000000 00:00 0
7f9bea5fa000-7f9bea5fb000 —p 00000000 00:00 0
7f9bea5fb000-7f9beadfb000 rw-p 00000000 00:00 0
7f9beadfb000-7f9beadfc000 —p 00000000 00:00 0
7f9beadfc000-7f9beb69d000 rw-p 00000000 00:00 0
7f9beb69d000-7f9bf169d000 —p 00000000 00:00 0
7f9bf169d000-7f9bf193e000 rw-p 00000000 00:00 0
7f9bf193e000-7f9bf194a000 r-xp 00000000 00:25 73150 /usr/lib64/libnss_files-2.17.so
7f9bf194a000-7f9bf1b49000 —p 0000c000 00:25 73150 /usr/lib64/libnss_files-2.17.so
7f9bf1b49000-7f9bf1b4a000 r–p 0000b000 00:25 73150 /usr/lib64/libnss_files-2.17.so
7f9bf1b4a000-7f9bf1b4b000 rw-p 0000c000 00:25 73150 /usr/lib64/libnss_files-2.17.so
7f9bf1b4b000-7f9bf1b51000 rw-p 00000000 00:00 0
7f9bf1b51000-7f9bf6a57000 rw-s 00000000 00:13 9357052 /dev/shm/mpich_shar_tmpvTXNkM (deleted)
7f9bf6a57000-7f9bf6a9c000 r-xp 00000000 00:2f 962058264 /opt/ohpc/pub/compiler/gcc/9.3.0/lib64/libquadmath.so.0.0.0
7f9bf6a9c000-7f9bf6c9b000 —p 00045000 00:2f 962058264 /opt/ohpc/pub/compiler/gcc/9.3.0/lib64/libquadmath.so.0.0.0
7f9bf6c9b000-7f9bf6c9c000 r–p 00044000 00:2f 962058264 /opt/ohpc/pub/compiler/gcc/9.3.0/lib64/libquadmath.so.0.0.0
7f9bf6c9c000-7f9bf6c9d000 rw-p 00045000 00:2f 962058264 /opt/ohpc/pub/compiler/gcc/9.3.0/lib64/libquadmath.so.0.0.0
7f9bf6c9d000-7f9bf6f29000 r-xp 00000000 00:2f 962053768 /opt/ohpc/pub/compiler/gcc/9.3.0/lib64/libgfortran.so.5.0.0
7f9bf6f29000-7f9bf7128000 —p 0028c000 00:2f 962053768 /opt/ohpc/pub/compiler/gcc/9.3.0/lib64/libgfortran.so.5.0.0
7f9bf7128000-7f9bf7129000 r–p 0028b000 00:2f 962053768 /opt/ohpc/pub/compiler/gcc/9.3.0/lib64/libgfortran.so.5.0.0
7f9bf7129000-7f9bf712b000 rw-p 0028c000 00:2f 962053768 /opt/ohpc/pub/compiler/gcc/9.3.0/lib64/libgfortran.so.5.0.0
7f9bf712b000-7f9bf72ee000 r-xp 00000000 00:25 73114 /usr/lib64/libc-2.17.so
7f9bf72ee000-7f9bf74ee000 —p 001c3000 00:25 73114 /usr/lib64/libc-2.17.so
7f9bf74ee000-7f9bf74f2000 r–p 001c3000 00:25 73114 /usr/lib64/libc-2.17.so
7f9bf74f2000-7f9bf74f4000 rw-p 001c7000 00:25 73114 /usr/lib64/libc-2.17.so
7f9bf74f4000-7f9bf74f9000 rw-p 00000000 00:00 0
7f9bf74f9000-7f9bf750f000 r-xp 00000000 00:2f 962058278 /opt/ohpc/pub/compiler/gcc/9.3.0/lib64/libgcc_s.so.1
7f9bf750f000-7f9bf770f000 —p 00016000 00:2f 962058278 /opt/ohpc/pub/compiler/gcc/9.3.0/lib64/libgcc_s.so.1
7f9bf770f000-7f9bf7710000 r–p 00016000 00:2f 962058278 /opt/ohpc/pub/compiler/gcc/9.3.0/lib64/libgcc_s.so.1
7f9bf7710000-7f9bf7711000 rw-p 00017000 00:2f 962058278 /opt/ohpc/pub/compiler/gcc/9.3.0/lib64/libgcc_s.so.1
7f9bf7711000-7f9bf7812000 r-xp 00000000 00:25 73130 /usr/lib64/libm-2.17.so
7f9bf7812000-7f9bf7a11000 —p 00101000 00:25 73130 /usr/lib64/libm-2.17.so
7f9bf7a11000-7f9bf7a12000 r–p 00100000 00:25 73130 /usr/lib64/libm-2.17.so
7f9bf7a12000-7f9bf7a13000 rw-p 00101000 00:25 73130 /usr/lib64/libm-2.17.so
7f9bf7a13000-7f9bf7bdc000 r-xp 00000000 00:2f 962053776 /opt/ohpc/pub/compiler/gcc/9.3.0/lib64/libstdc++.so.6.0.28
7f9bf7bdc000-7f9bf7ddc000 —p 001c9000 00:2f 962053776 /opt/ohpc/pub/compiler/gcc/9.3.0/lib64/libstdc++.so.6.0.28
7f9bf7ddc000-7f9bf7de7000 r–p 001c9000 00:2f 962053776 /opt/ohpc/pub/compiler/gcc/9.3.0/lib64/libstdc++.so.6.0.28
7f9bf7de7000-7f9bf7dea000 rw-p 001d4000 00:2f 962053776 /opt/ohpc/pub/compiler/gcc/9.3.0/lib64/libstdc++.so.6.0.28
7f9bf7dea000-7f9bf7ded000 rw-p 00000000 00:00 0
7f9bf7ded000-7f9bf7e04000 r-xp 00000000 00:25 73167 /usr/lib64/libpthread-2.17.so
7f9bf7e04000-7f9bf8003000 —p 00017000 00:25 73167 /usr/lib64/libpthread-2.17.so
7f9bf8003000-7f9bf8004000 r–p 00016000 00:25 73167 /usr/lib64/libpthread-2.17.so
7f9bf8004000-7f9bf8005000 rw-p 00017000 00:25 73167 /usr/lib64/libpthread-2.17.so
7f9bf8005000-7f9bf8009000 rw-p 00000000 00:00 0
7f9bf8009000-7f9bf8010000 r-xp 00000000 00:25 73175 /usr/lib64/librt-2.17.so
7f9bf8010000-7f9bf820f000 —p 00007000 00:25 73175 /usr/lib64/librt-2.17.so
7f9bf820f000-7f9bf8210000 r–p 00006000 00:25 73175 /usr/lib64/librt-2.17.so
7f9bf8210000-7f9bf8211000 rw-p 00007000 00:25 73175 /usr/lib64/librt-2.17.so
7f9bf8211000-7f9bf84fe000 r-xp 00000000 00:2f 1891806736 /opt/ohpc/pub/compiler/mpich/3.3.2/lib/libmpi.so.12.1.8
7f9bf84fe000-7f9bf86fd000 —p 002ed000 00:2f 1891806736 /opt/ohpc/pub/compiler/mpich/3.3.2/lib/libmpi.so.12.1.8
7f9bf86fd000-7f9bf870b000 r–p 002ec000 00:2f 1891806736 /opt/ohpc/pub/compiler/mpich/3.3.2/lib/libmpi.so.12.1.8
7f9bf870b000-7f9bf870e000 rw-p 002fa000 00:2f 1891806736 /opt/ohpc/pub/compiler/mpich/3.3.2/lib/libmpi.so.12.1.8
7f9bf870e000-7f9bf874f000 rw-p 00000000 00:00 0
7f9bf874f000-7f9bf876d000 r-xp 00000000 00:2f 1891806744 /opt/ohpc/pub/compiler/mpich/3.3.2/lib/libmpicxx.so.12.1.8
7f9bf876d000-7f9bf896d000 —p 0001e000 00:2f 1891806744 /opt/ohpc/pub/compiler/mpich/3.3.2/lib/libmpicxx.so.12.1.8
7f9bf896d000-7f9bf896f000 r–p 0001e000 00:2f 1891806744 /opt/ohpc/pub/compiler/mpich/3.3.2/lib/libmpicxx.so.12.1.8
7f9bf896f000-7f9bf8970000 rw-p 00020000 00:2f 1891806744 /opt/ohpc/pub/compiler/mpich/3.3.2/lib/libmpicxx.so.12.1.8
7f9bf8970000-7f9bfa2fe000 r-xp 00000000 00:2f 962130484 /opt/ohpc/pub/apps/cuda/cuda-11.4/targets/x86_64-linux/lib/libcufft.so.10.5.0.43
7f9bfa2fe000-7f9bfa4fe000 —p 0198e000 00:2f 962130484 /opt/ohpc/pub/apps/cuda/cuda-11.4/targets/x86_64-linux/lib/libcufft.so.10.5.0.43
7f9bfa4fe000-7f9bfa50d000 r–p 0198e000 00:2f 962130484 /opt/ohpc/pub/apps/cuda/cuda-11.4/targets/x86_64-linux/lib/libcufft.so.10.5.0.43
7f9bfa50d000-7f9c0e3ff000 rw-p 0199d000 00:2f 962130484 /opt/ohpc/pub/apps/cuda/cuda-11.4/targets/x86_64-linux/lib/libcufft.so.10.5.0.43
7f9c0e3ff000-7f9c0e5ef000 rw-p 00000000 00:00 0
7f9c0e5ef000-7f9c0f933000 r-xp 00000000 00:25 76926 /usr/lib64/libcuda.so.470.57.02
7f9c0f933000-7f9c0fb32000 —p 01344000 00:25 76926 /usr/lib64/libcuda.so.470.57.02
7f9c0fb32000-7f9c0fc20000 r–p 01343000 00:25 76926 /usr/lib64/libcuda.so.470.57.02
7f9c0fc20000-7f9c0fd2b000 rw-p 01431000 00:25 76926 /usr/lib64/libcuda.so.470.57.02
7f9c0fd2b000-7f9c0fd4b000 rw-p 00000000 00:00 0
7f9c0fd4b000-7f9c0fde5000 r-xp 00000000 00:2f 962130469 /opt/ohpc/pub/apps/cuda/cuda-11.4/targets/x86_64-linux/lib/libcudart.so.11.4.43
7f9c0fde5000-7f9c0ffe5000 —p 0009a000 00:2f 962130469 /opt/ohpc/pub/apps/cuda/cuda-11.4/targets/x86_64-linux/lib/libcudart.so.11.4.43
7f9c0ffe5000-7f9c0ffea000 r–p 0009a000 00:2f 962130469 /opt/ohpc/pub/apps/cuda/cuda-11.4/targets/x86_64-linux/lib/libcudart.so.11.4.43
7f9c0ffea000-7f9c0ffeb000 rw-p 0009f000 00:2f 962130469 /opt/ohpc/pub/apps/cuda/cuda-11.4/targets/x86_64-linux/lib/libcudart.so.11.4.43
7f9c0ffeb000-7f9c0ffec000 rw-p 00000000 00:00 0
7f9c0ffec000-7f9c0fff2000 r-xp 00000000 00:2f 962058263 /opt/ohpc/pub/compiler/gcc/9.3.0/lib64/libatomic.so.1.2.0
7f9c0fff2000-7f9c101f1000 —p 00006000 00:2f 962058263 /opt/ohpc/pub/compiler/gcc/9.3.0/lib64/libatomic.so.1.2.0
7f9c101f1000-7f9c101f2000 r–p 00005000 00:2f 962058263 /opt/ohpc/pub/compiler/gcc/9.3.0/lib64/libatomic.so.1.2.0
7f9c101f2000-7f9c101f3000 rw-p 00006000 00:2f 962058263 /opt/ohpc/pub/compiler/gcc/9.3.0/lib64/libatomic.so.1.2.0
7f9c101f3000-7f9c101f4000 rw-p 00000000 00:00 0
7f9c101f4000-7f9c101f6000 r-xp 00000000 00:25 73126 /usr/lib64/libdl-2.17.so
7f9c101f6000-7f9c103f6000 —p 00002000 00:25 73126 /usr/lib64/libdl-2.17.so
7f9c103f6000-7f9c103f7000 r–p 00002000 00:25 73126 /usr/lib64/libdl-2.17.so
7f9c103f7000-7f9c103f8000 rw-p 00003000 00:25 73126 /usr/lib64/libdl-2.17.so
7f9c103f8000-7f9c1041a000 r-xp 00000000 00:25 72816 /usr/lib64/ld-2.17.so
7f9c1043c000-7f9c1043d000 rw-p 00000000 00:00 0
7f9c1043d000-7f9c1043e000 rw-s 00000000 00:05 397296 /dev/nvidiactl
7f9c1043e000-7f9c1043f000 rw-s 00000000 00:05 397296 /dev/nvidiactl
7f9c1043f000-7f9c10440000 rw-s 00000000 00:05 397296 /dev/nvidiactl
7f9c10440000-7f9c10441000 rw-s 00000000 00:05 397296 /dev/nvidiactl
7f9c10441000-7f9c10442000 rw-s 00000000 00:05 397296 /dev/nvidiactl
7f9c10442000-7f9c10443000 rw-s 00000000 00:05 397296 /dev/nvidiactl
7f9c10443000-7f9c10444000 rw-s 00000000 00:05 397296 /dev/nvidiactl
7f9c10444000-7f9c10445000 rw-s 00000000 00:05 397296 /dev/nvidiactl
7f9c10445000-7f9c10446000 rw-s 00000000 00:05 397296 /dev/nvidiactl
7f9c10446000-7f9c10447000 rw-s 00000000 00:05 397296 /dev/nvidiactl
7f9c10447000-7f9c10448000 rw-s 00000000 00:05 397296 /dev/nvidiactl
7f9c10448000-7f9c10449000 rw-s 00000000 00:05 397296 /dev/nvidiactl
7f9c10449000-7f9c1044a000 rw-s 00000000 00:05 397296 /dev/nvidiactl
7f9c1044a000-7f9c1044b000 rw-s 00000000 00:05 397296 /dev/nvidiactl
7f9c1044b000-7f9c1044c000 rw-s 00000000 00:05 397296 /dev/nvidiactl
7f9c1044c000-7f9c1044d000 rw-s 00000000 00:05 397296 /dev/nvidiactl
7f9c1044d000-7f9c1044e000 rw-s 00000000 00:05 397296 /dev/nvidiactl
7f9c1044e000-7f9c1044f000 rw-s 00000000 00:05 397296 /dev/nvidiactl
7f9c1044f000-7f9c10450000 rw-s 00000000 00:05 397296 /dev/nvidiactl
7f9c10450000-7f9c10451000 rw-s 00000000 00:05 397296 /dev/nvidiactl
7f9c10451000-7f9c10452000 rw-s 00000000 00:05 397296 /dev/nvidiactl
7f9c10452000-7f9c10453000 rw-s 00000000 00:05 397296 /dev/nvidiactl
7f9c10453000-7f9c10454000 rw-s 00000000 00:05 397296 /dev/nvidiactl
7f9c10454000-7f9c10455000 rw-s 00000000 00:05 397296 /dev/nvidiactl
7f9c10455000-7f9c10456000 rw-s 00000000 00:05 397296 /dev/nvidiactl
7f9c10456000-7f9c10457000 rw-s 00000000 00:05 397296 /dev/nvidiactl
7f9c10457000-7f9c10458000 rw-s 00000000 00:05 397296 /dev/nvidiactl
7f9c10458000-7f9c10459000 rw-s 00000000 00:05 397296 /dev/nvidiactl
7f9c10459000-7f9c10483000 rw-p 00000000 00:00 0
7f9c10483000-7f9c10484000 r–s 00000000 00:05 149174 /dev/nvidia3
7f9c10484000-7f9c10494000 -w-s 00000000 00:05 149174 /dev/nvidia3
7f9c10494000-7f9c10495000 r–s 00000000 00:05 170643 /dev/nvidia2
7f9c10495000-7f9c104a5000 -w-s 00000000 00:05 170643 /dev/nvidia2
7f9c104a5000-7f9c104b5000 -w-s 00000000 00:05 182546 /dev/nvidia1
7f9c104b5000-7f9c10606000 rw-p 00000000 00:00 0
7f9c10606000-7f9c10607000 r–s 00000000 00:05 182546 /dev/nvidia1
7f9c10607000-7f9c10608000 r–s 00000000 00:05 200720 /dev/nvidia0
7f9c10608000-7f9c10618000 -w-s 00000000 00:05 200720 /dev/nvidia0
7f9c10618000-7f9c10619000 rw-p 00000000 00:00 0
7f9c10619000-7f9c1061a000 r–p 00021000 00:25 72816 /usr/lib64/ld-2.17.so
7f9c1061a000-7f9c1061b000 rw-p 00022000 00:25 72816 /usr/lib64/ld-2.17.so
7f9c1061b000-7f9c1061c000 rw-p 00000000 00:00 0
7ffeaab83000-7ffeaaba7000 rw-p 00000000 00:00 0 [stack]
7ffeaabc6000-7ffeaabc8000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]`

That is not correct. Any command or style that is available in the KOKKOS package is also available without.

Fix nv/tsllod is part of the core LAMMPS functionality and thus always available. In addition, it exists for the INTEL, KOKKOS, and OPENMP package.

Sorry, I meant it is not available in gpu package and I want use gpu for simulations.

The GPU package does not run fixes on the GPU, only the force computation is GPU accelerated. But if your custom pair style does not use the GPU there is no point in using a GPU.

Okay, the pair style must be in kokkos then. Now I have tried to implement the pair style in kokkos by editing some other kokkos implemented pair style namely pair_morse_kokkos.* files. This is where the above mentioned error comes while running. No error while building lammps through make kokkos_cuda_mpi, though.

Not necessarily.

The error looks like you are trying to free a device pointer on the host. This is near impossible to diagnose and to make suggestions for correction from remote and without access to the source code. Because you compiled LAMMPS without debug info, it is impossible to narrow down which specific free() call is causing the problem.

You can, of course, apply standard debugging techniques and check your execution, define breakpoints for interruption to inspect the pointer(s) at different stages with a debugger.

How to do that in detail, however, is beyond the scope of this forum.

Typically I see this when trying to free a “wild” pointer.

As Axel said, you need to compile a “Debug” build, i.e. with the -g flag to get debugging symbols. Then you can use GDB, Valgrind, or also compile with -fsanitize=address to use AddressSanitizer.

If you submit a “Draft” pull request on GitHub, we MAY be able to take a quick look (no promises).