Hello, As you pointed out, this is a bug in htags. Internally, htags performs the same processing as xargs(1), but it limits the environment with an outdated small value. I'm going to take GNU findutils as a reference and change the limit to the correct value. Thank you for the report!
Regards, Shigio On Mon, Jan 8, 2024 at 11:24 PM Peter Maydell <[email protected]> wrote: > > Hi; I'd like to report a bug in 'htags': it fails with an obscure > error message if the environment happens to be large. Here's a > repro case: > > $ mkdir htags-bug > $ cd htags-bug/ > $ cat >hello.c > #include <stdio.h> > > int main(void) { > printf("hello world\n"); > return 0; > } > $ gtags > $ htags -anT > $ BIGVAR=$(perl -e 'print "x" x 100000') htags -anT > htags: Negative exec line limit = -80391 > > As you can see, htags works normally with a small environment, but > if there happens to be an environment variable whose value is large > then it fails. > > We ran into this with QEMU, because it happens that the GitLab CI > system puts the text of the git commit message into an environment > variable. So our CI job that runs 'htags' fell over if the commit > being tested had a large commit message... > (The QEMU bug about this is > https://gitlab.com/qemu-project/qemu/-/issues/2080 -- we'll work > around this by clearing that environment variable before running > htags, but I wanted to report it to you upstream as well.) > > I've tested this with "htags (GNU Global) 6.6.11"; the bug > is also present in earlier versions, such as those distributed > in Debian and Ubuntu. > > thanks > -- Peter Maydell > -- Shigio YAMAGUCHI <[email protected]> PGP fingerprint: 26F6 31B4 3D62 4A92 7E6F 1C33 969C 3BE3 89DD A6EB
