segfault in incremental build mode with partial files
Scott Mcdermott <[email protected]> Sun, 28 Jul 2024 08:00:45 -0700
| Newsgroups | gmane.comp.gnu.global.bugs |
|---|---|
| Message-ID | <CACRKOwxNjOfWsaS0LiKPaUBHbN39nMJbM0XADxxK+-zM8agQ=A@mail.gmail.com> |
--000000000000f4bad9061e50022a
Content-Type: text/plain; charset="UTF-8"
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
--000000000000f4bad9061e50022a
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">This is to report a crash and segfault when running gtags<=
br>in incremental mode.<br><br>My editor is configured to run gtags in all =
git repos.=C2=A0 It's crashing<br>when I edit in my ~/.vim/ directory, =
which is a checkout of<br><a href=3D"https://github.com/smemsh/.vim/">https=
://github.com/smemsh/.vim/</a> repo (config file is "gtags.conf"<=
br>therein).=C2=A0 This gtags was built in May of this year from the<br>the=
n-current trunk.=C2=A0 I checked and it looks=C2=A0like=C2=A0no crash fixes=
<br>have been committed since. System is Ubuntu22 on x86_64.<br><br>This pr=
oblem went away when I removed the existing files<br>(so it was non-increme=
ntal).=C2=A0 The tags update script has a trap<br>to remove partials if no =
finish (editor exits before gtags finishes,<br>process group is killed), bu=
t the update wrapper has race<br>conditions so it probably didn't work =
and the file generation was<br>incomplete.<br><br>Nonetheless, gtags still =
should not crash.<br><br>Let me know if more information is needed (i.e., b=
uild with -g, or<br>upload the partials -- which I saved -- somewhere).<br>=
<br>See below; eom.<br><div><br>=C2=A0$ cd var/vim/tags/home-scott-.vim<br>=
<br>=C2=A0$ lsa<br>-rw-r--r-- 1 1001 666 2.0M 20240712000626 GPATH<br>-rw-r=
--r-- 1 1001 666 4.1M 20240712055818 GRTAGS<br>-rw-r--r-- 1 1001 666 338M 2=
0240712055818 GTAGS<br><br>=C2=A0$ gdb -q -d ~/upsrc/global --args `which g=
tags` --incremental /home/scott/var/vim/tags/home-scott-.vim<br>Reading sym=
bols from /usr/local/bin/gtags...<br>(gdb) r<br>Starting program: /usr/loca=
l/bin/gtags --incremental /home/scott/var/vim/tags/home-scott-.vim<br>[Thre=
ad debugging using libthread_db enabled]<br>Using host libthread_db library=
"/lib/x86_64-linux-gnu/libthread_db.so.1".<br>[Detaching after f=
ork from child process 4066050]<br>[Detaching after fork from child process=
4066053]<br>[Detaching after fork from child process 4066054]<br><br>Progr=
am received signal SIGSEGV, Segmentation fault.<br>__bt_dleaf (t=3Dt@entry=
=3D0x555555694920, key=3Dkey@entry=3D0x0, h=3Dh@entry=3D0x55555588a630, ind=
ex=3D0) at bt_delete.c:507<br>507 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ip[0] =3D ip[1] < offset ? ip[1] + nbytes :=
ip[1];<br>(gdb) bt<br>#0 =C2=A0__bt_dleaf (t=3Dt@entry=3D0x555555694920, k=
ey=3Dkey@entry=3D0x0, h=3Dh@entry=3D0x55555588a630, index=3D0) at bt_delete=
.c:507<br>#1 =C2=A00x0000555555609515 in __bt_delete (dbp=3D<optimized o=
ut>, key=3D<optimized out>, flags=3D<optimized out>) at bt_d=
elete.c:114<br>#2 =C2=A00x0000555555573356 in dbop_delete (dbop=3D<optim=
ized out>, path=3Dpath@entry=3D0x0) at dbop.c:506<br>#3 =C2=A00x00005555=
55578ce3 in gtags_delete (gtop=3D0x555555693660, deleteset=3Ddeleteset@entr=
y=3D0x55555565a090) at gtagsop.c:592<br>#4 =C2=A00x000055555556553f in upda=
tetags (dbpath=3Ddbpath@entry=3D0x7fffffffc1f0 "/home/scott/var/vim/ta=
gs/home-scott-.vim", <br>=C2=A0 =C2=A0 root=3Droot@entry=3D0x7fffffffd=
1f0 "/home/scott/.vim", deleteset=3Ddeleteset@entry=3D0x55555565a=
090, addlist=3Daddlist@entry=3D0x55555567e680) at gtags.c:957<br>#5 =C2=A00=
x0000555555565aa1 in incremental (dbpath=3Ddbpath@entry=3D0x7fffffffc1f0 &q=
uot;/home/scott/var/vim/tags/home-scott-.vim", <br>=C2=A0 =C2=A0 root=
=3Droot@entry=3D0x7fffffffd1f0 "/home/scott/.vim") at gtags.c:808=
<br>#6 =C2=A00x00005555555647c0 in main (argc=3D<optimized out>, argv=
=3D<optimized out>) at gtags.c:576<br></div></div>
--000000000000f4bad9061e50022a--