That could be the case under vfork
… but Haiku doesn’t have a real vfork
(it just calls fork
). So, all memory areas are cloned (copy-on-write) into the new team.
Building and running the software:
hg clone https://phab.mallen.id.au/source/lgi/ code/lgi/trunk
cd code/lgi/trunk/lvc
ln -s haiku/Makefile.haiku makefile
make -j 6
./lvc
Usually clicking the “Open Folder” button may be needed to get the lock error to show in the console.
I don’t think there is anything else needed, but sorry if there is some library dependency or something I missed. It may need a link to code/lgi/trunk/Debug/liblgid.so to run? But it seems to work ok for me on a fairly clean system.
The thread that does the forking is in code/lgi/trunk/lvc/src/Main.cpp in GetVcsVersions::Main. It’s entirely possible I’m just doing something dumb somewhere. Hopefully not.
Ok I’ve spent some more time looking at this and found something interesting. I’m trying execute 4 apps: cvs, svn, git and hg. Some of which aren’t installed. Obviously I’m expecting those to fail. However something about the non-present ones is causing it to have problems. If I remove those from the list, and just run the present processes it’s fine.
I’ve also culled the code down to a minimal fork/exec example. Just to isolate the LSubProcess class from the equation.
So I think the problem starts when ‘execvp’ fails to execute the process. I’m just calling ‘exit’ after that in the child process. But somehow the parent process gets it’s locks all messed up at that point.
Now this is extremely interesting. If you could please open a ticket with your reproducer, that would be much appreciated.
If you can’t break, Just log it