News for hackers. Stuff that matters.
Re:Compilers are hard by thegrandpoobah on Thursday January 21, 2021 @12:31AM (#25855795)
Actually shocked to hear this considering the number of people and companies currently working on LLVM.
Re:Compilers are hard by jcranmer on Thursday January 21, 2021 @01:40AM (#25856188)
The code in question is related to setjmp/longjmp. As a general rule of thumb, this is something where the gut reaction to any bug report is going to be "you're doing it wrong"--the C standard actually provides a lot less guarantees here than most people believe it does. I haven't read the verbiage and the bug report in question in enough detail to ascertain if this is true or not, but it isn't in the least bit surprising that most people see setjmp/longjmp and immediately table the issue as being low-priority.
Re:Compilers are hard by usefulcat on Thursday January 21, 2021 @10:52AM (#25860141)
Having read the comments in the llvm bug report, it seems pretty clear that it is a real bug and that they have at least an idea of where the bug is.
Re:Compilers are hard by drivebycomment on Thursday January 21, 2021 @12:40AM (#25855845)
Not that surprising given that it seems specific to asan mode and only in the presence of setjmp/longjmp. I.e. this cant be that important unless the same bug shows also in non-asan Setjmp/longjmp case. Setjmp/longjmp are often a source of trouble for the register allocator or related optimization due to its unique properties. Often the optimizing compilers treat set/longjmp as "give up almost everything around those functions" but maybe llvm is trying hard to model it precisely and failing. But I haven't personally looked at the relevant code in llvm so this is mostly a speculation.
Re:Compilers are hard by cperciva on Thursday January 21, 2021 @12:46AM (#25855900)
The bug shows up without asan. We literally tripped over it in production with code compiled with "clang -O2".
Re:Compilers are hard by drivebycomment on Thursday January 21, 2021 @12:53AM (#25855939)
Then I agree that this is surprising. That means clang/llvm is not modeling set/longjmp correctly in general and that is not acceptable as a C compiler.
Re:Compilers are hard by scatters on Thursday January 21, 2021 @03:51AM (#25856861)
That's apparent from your ticket (which is marked as a duplicate) but on the one you linked to, all the offending compiler lines contain asan. Is there a chance this is impacting prioritization?
Re:Compilers are hard by cperciva on Thursday January 21, 2021 @11:27AM (#25860641)
Could be. I'm not an LLVM developer so I don't know how they prioritize issues.
Re:Compilers are hard by h_anna_h on Thursday January 21, 2021 @12:44AM (#25855880)
Regarding asan bugs, if you do not free all of your memory before exiting main it will complain about stuff and end up calling _exit I think which does not flush the buffers.