Re: git: 8ccd0b876e67 - main - libc: expose execvpe for Linux compat

From: Kristof Provost <kp_at_FreeBSD.org>
Date: Sat, 23 Dec 2023 19:30:55 UTC
Hi Brooks, Joseph,

On 11 Dec 2023, at 20:27, Brooks Davis wrote:
> The branch main has been updated by brooks:
>
> URL: 
> https://cgit.FreeBSD.org/src/commit/?id=8ccd0b876e67fda6249f294ff484798cc1e1569f
>
> commit 8ccd0b876e67fda6249f294ff484798cc1e1569f
> Author:     Brooks Davis <brooks@FreeBSD.org>
> AuthorDate: 2023-12-11 19:24:53 +0000
> Commit:     Brooks Davis <brooks@FreeBSD.org>
> CommitDate: 2023-12-11 19:24:53 +0000
>
>     libc: expose execvpe for Linux compat
>
>     We already implemented execvpe internally with an _ prefix in libc 
> so
>     go ahead and expose it for compatibility with Linux.
>
>     This reverts c605eea952146348e5e1ad5cab6c127d7a1bd164.
>
>     Bump __FreeBSD_version for the addition and add definitions to 
> supress
>     compat shims in libzfs (zfs changes were merged from upstream).
>
>     PR:             275370 (request and exp-run (thanks antoine!))
>     Reviewed by:    kevans
>     Differential Revision:  https://reviews.freebsd.org/D42846

I don’t understand why, but this breaks devel/bear (“Tool that 
generates a compilation database for clang tooling”).

Rather than generate a list of commands it seems to recursively spawn 
endless “wrapper” processes:

```
82661  0  I+       0:00.18 | |     `-- bear -- ls
82662  0  I+       0:06.90 | |       `-- /usr/local/bin/bear intercept 
--library /usr/local/lib/bear/libexec.so --wrapper 
/usr/local/lib/bear/wrapper --wrapper-dir /usr/local/lib/bear/wr
82663  0  I+       0:00.13 | |         `-- /usr/local/lib/bear/wrapper 
--destination dns:///localhost:30309 --execute /bin/ls -- ls
82664  0  I+       0:00.09 | |           `-- /usr/local/lib/bear/wrapper 
--destination dns:///localhost:30309 --execute /bin/ls -- ls
82665  0  I+       0:00.06 | |             `-- 
/usr/local/lib/bear/wrapper --destination dns:///localhost:30309 
--execute /bin/ls -- ls
82666  0  I+       0:00.06 | |               `-- 
/usr/local/lib/bear/wrapper --destination dns:///localhost:30309 
--execute /bin/ls -- ls
```

It’s trivially reproducible at least. Without this patch `bear -- ls` 
returns immediately and generates a compile_commands.json file (empty, 
but that’s fine here). With it it’ll spin endlessly.

Best regards,
Kristof