News for hackers. Stuff that matters.
Re:Current hardware trends make C++ exceptions harder to jus... by gumby on Tuesday February 22, 2022 @03:47PM (#30433526)
Th problem is that the corpus of deployed libraries is a de facto ABI. Even with dylib versioning, catching the case of API version is hard.

I think it could be done by changing the mangling algorithm (basically: compile fails if new-ABI versions are not available) but I haven't thought enough about it to remove the words "I think" from the beginning of the sentence.

Re:Current hardware trends make C++ exceptions harder to jus... by atq2119 on Wednesday February 23, 2022 @01:15AM (#30438238)
Since this is about immutable "side car" data structures used during unwinding: could this be achieved using a soft ABI transition as opposed to a hard, flag day ABI break?

Basically, going forward the compiler would emit two versions of the unwinding tables by default: the legacy one and the one that allows fixing the thread contention issue. The unwinder is changed to use the efficient version by default with the ability to fall back to locking if it encounters a shared object that only has the old version.

Space conscious users could choose to emit only one version by using a compiler flag, and after a decade or so the compiler is switched to only emit the new version by default (but the unwinder could retain the capability to understand the old format for a few decades longer).

It seems like most of the table contents should even be shareable between versions? The locking seems to be only there to guard against shared object loading/unloading which should only affect the topmost level of the data structure.

Admittedly I have no idea how those tables are actually defined today.

Re:Current hardware trends make C++ exceptions harder to jus... by gumby on Wednesday February 23, 2022 @03:56PM (#30446333)
That might work. It would be yet another thing that would slow down compilation (link phase in this case) but not the worst.

Compilers would have to generate both forms forever (except for new architectures) but probably that wouldn’t be terrible.

Re:Current hardware trends make C++ exceptions harder to jus... by atq2119 on Wednesday February 23, 2022 @05:50PM (#30447697)
It only took ~two decades to remove a.out support from the Linux kernel :)

(I wonder when software engineers will more commonly think about their work on a generational time scale. Like how the cathedral builders of old must have thought about their work...)