tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

make(1): Unbalanced Lst_Open/Lst_Close in SuffFindCmds



Hi,

Since the initial import of usr.bin/make 27 years ago, the function
SuffFindCmds has an unbalanced Lst_Open/Lst_Close in the case where it
finds a source.  This looks suspicious.

Lst_Open:
https://github.com/NetBSD/src/blob/61f282557f0bc41c0b762c629a2f4c14be8b7591/usr.bin/make/suff.c#L1064

Return without Lst_Close:
https://github.com/NetBSD/src/blob/61f282557f0bc41c0b762c629a2f4c14be8b7591/usr.bin/make/suff.c#L1112

Return with Lst_Close:
https://github.com/NetBSD/src/blob/61f282557f0bc41c0b762c629a2f4c14be8b7591/usr.bin/make/suff.c#L1117

A few days ago, I had added an assertion to Lst_Open to ensure that it
is not yet open.  This assertion reliably fails in "./build.sh -j1
tools", while without the -j1 everything is fine.

Adding the Lst_Close to the return path fails ./build.sh (with or
without the -j1 option), with this error message:

install ===> compat
cd: can't cd to include
*** [includes] Error code 2

I didn't manage to produce a minimal example for this.  Can anyone help
me with this?  I'd like to understand why the build fails and what the
exact circumstances are.

OpenBSD has fixed this by not using Lst_Open anymore:
https://github.com/openbsd/src/blob/9424095da53ae512cc53b1ddd85c6375da9ebcfa/usr.bin/make/suff.c#L835

Roland


Home | Main Index | Thread Index | Old Index