This is to report a crash and segfault when running gtags in incremental mode.
My editor is configured to run gtags in all git repos. It's crashing when I edit in my ~/.vim/ directory, which is a checkout of https://github.com/smemsh/.vim/ repo (config file is "gtags.conf" therein). This gtags was built in May of this year from the then-current trunk. I checked and it looks like no crash fixes have been committed since. System is Ubuntu22 on x86_64. This problem went away when I removed the existing files (so it was non-incremental). The tags update script has a trap to remove partials if no finish (editor exits before gtags finishes, process group is killed), but the update wrapper has race conditions so it probably didn't work and the file generation was incomplete. Nonetheless, gtags still should not crash. Let me know if more information is needed (i.e., build with -g, or upload the partials -- which I saved -- somewhere). See below; eom. $ cd var/vim/tags/home-scott-.vim $ lsa -rw-r--r-- 1 1001 666 2.0M 20240712000626 GPATH -rw-r--r-- 1 1001 666 4.1M 20240712055818 GRTAGS -rw-r--r-- 1 1001 666 338M 20240712055818 GTAGS $ gdb -q -d ~/upsrc/global --args `which gtags` --incremental /home/scott/var/vim/tags/home-scott-.vim Reading symbols from /usr/local/bin/gtags... (gdb) r Starting program: /usr/local/bin/gtags --incremental /home/scott/var/vim/tags/home-scott-.vim [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [Detaching after fork from child process 4066050] [Detaching after fork from child process 4066053] [Detaching after fork from child process 4066054] Program received signal SIGSEGV, Segmentation fault. __bt_dleaf (t=t@entry=0x555555694920, key=key@entry=0x0, h=h@entry=0x55555588a630, index=0) at bt_delete.c:507 507 ip[0] = ip[1] < offset ? ip[1] + nbytes : ip[1]; (gdb) bt #0 __bt_dleaf (t=t@entry=0x555555694920, key=key@entry=0x0, h=h@entry=0x55555588a630, index=0) at bt_delete.c:507 #1 0x0000555555609515 in __bt_delete (dbp=<optimized out>, key=<optimized out>, flags=<optimized out>) at bt_delete.c:114 #2 0x0000555555573356 in dbop_delete (dbop=<optimized out>, path=path@entry=0x0) at dbop.c:506 #3 0x0000555555578ce3 in gtags_delete (gtop=0x555555693660, deleteset=deleteset@entry=0x55555565a090) at gtagsop.c:592 #4 0x000055555556553f in updatetags (dbpath=dbpath@entry=0x7fffffffc1f0 "/home/scott/var/vim/tags/home-scott-.vim", root=root@entry=0x7fffffffd1f0 "/home/scott/.vim", deleteset=deleteset@entry=0x55555565a090, addlist=addlist@entry=0x55555567e680) at gtags.c:957 #5 0x0000555555565aa1 in incremental (dbpath=dbpath@entry=0x7fffffffc1f0 "/home/scott/var/vim/tags/home-scott-.vim", root=root@entry=0x7fffffffd1f0 "/home/scott/.vim") at gtags.c:808 #6 0x00005555555647c0 in main (argc=<optimized out>, argv=<optimized out>) at gtags.c:576
