Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bear spawns an endless number of processes on FreeBSD #557

Open
Jehops opened this issue Jan 2, 2024 · 2 comments
Open

Bear spawns an endless number of processes on FreeBSD #557

Jehops opened this issue Jan 2, 2024 · 2 comments
Labels

Comments

@Jehops
Copy link

Jehops commented Jan 2, 2024

After this commit on FreeBSD's main branch, bear will indefinitely spawn new processes.

root@15amd64-default:~ # uname -a
FreeBSD 15amd64-default 15.0-CURRENT FreeBSD 15.0-CURRENT 1500008 amd64

root@15amd64-default:~ # pkg info bear | head -11
bear-3.1.3_4
Name           : bear
Version        : 3.1.3_4
Installed on   : Tue Jan  2 13:54:27 2024 UTC
Origin         : devel/bear
Architecture   : FreeBSD:15:amd64
Prefix         : /usr/local
Categories     : devel
Licenses       : GPLv3+
Maintainer     : jrm@FreeBSD.org
WWW            : https://github.com/rizsotto/Bear

root@15amd64-default:~ # bear --verbose -- ls
bear_ls_output_freebsd15.txt
Until SIGKILL is sent, new process will be spawned indefinitely.

Bear runs as expected on FreeBSD systems built prior to that commit.

root@14amd64-default:~ # uname -a
FreeBSD 14amd64-default 14.0-RC4 FreeBSD 14.0-RC4 amd64

root@14amd64-default:~ # pkg info bear | head -11
bear-3.1.3_4
Name           : bear
Version        : 3.1.3_4
Installed on   : Tue Jan  2 13:38:57 2024 UTC
Origin         : devel/bear
Architecture   : FreeBSD:14:amd64
Prefix         : /usr/local
Categories     : devel
Licenses       : GPLv3+
Maintainer     : jrm@FreeBSD.org
WWW            : https://github.com/rizsotto/Bear

root@14amd64-default:~ # bear --verbose -- ls
bear_ls_output_freebsd14.txt

@Jehops Jehops changed the title Bear spawns an endless number processes on FreeBSD Bear spawns an endless number of processes on FreeBSD Jan 2, 2024
@rizsotto rizsotto added the bug label Jan 4, 2024
@illegalcoding
Copy link

I just upgraded to 14.0-STABLE and I'm getting the same issue, just endless wrappers spawning. If I run with --force-wrapper it seems to run the Makefile and exit, but it doesn't write anything in compile_commands.json.

@rizsotto
Copy link
Owner

Thanks guys for the reporting... Yes, if the newly introduced execve is causing the issue. (The fact that the posix_spawn is calling execve is the problem for this application.)

The potential workarounds are not easy with my time budget this time... Static linking of the wrapper could fix that. (A lot of work on the build system, which will not be as portable as it is today.) Instead of calling posix_spawn the wrapper should call the execve directly. (Seems like the cheapest solution.)

Using the --force-wapper is the no-code-change workaround. This mode of the interception is more depending on the build system... This page might be helpful to set it up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants