[PATCH] D126550: Make report_fatal_error respect its GenCrashDiag argument so it doesn't generate a backtrace

Nuno Lopes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 1 02:04:45 PDT 2022


nlopes added inline comments.


================
Comment at: llvm/lib/Support/ErrorHandling.cpp:125
+  else
+    exit(-1);
 }
----------------
MaskRay wrote:
> MaskRay wrote:
> > nlopes wrote:
> > > MaskRay wrote:
> > > > nlopes wrote:
> > > > > MaskRay wrote:
> > > > > > MaskRay wrote:
> > > > > > > nlopes wrote:
> > > > > > > > MaskRay wrote:
> > > > > > > > > MaskRay wrote:
> > > > > > > > > > https://www.opengroup.org/austin/docs/austin_1110.pdf
> > > > > > > > > > 
> > > > > > > > > > "Calling exit() with a value greater than 255 or less than 0 is something that only programs
> > > > > > > > > > which are specifically designed to have their exit status obtained by waitid() should do
> > > > > > > > > > (since it does not truncate the exit status to 8 bits). ``Pure ISO Cā€™ā€™ programs that call
> > > > > > > > > > exit(EXIT_FAILURE) do not meet this design criterion."
> > > > > > > > > A value between 1 and 125 can be used.
> > > > > > > > > 
> > > > > > > > > 1 and 2 are often used for other purposes.
> > > > > > > > > 
> > > > > > > > > Perhaps use a value larger than `EX__MAX` in sysexits.h
> > > > > > > > Man page disagrees:
> > > > > > > > "The exit() function causes normal process termination and the value of status & 0377 is returned to the parent see wait(2))."
> > > > > > > The Linux manpage is incorrect. With waitid you may access more than the least significant 8 bites, but that's not usage in practice.
> > > > > > > 
> > > > > > > bash has this https://www.gnu.org/software/bash/manual/html_node/Exit-Status.html and zsh is similar.
> > > > > > 1 and 2 are often used for other purposes. So better to use another.
> > > > > I will not bikeshed over this. Please suggest a value you like, otherwise I think 1 is just fine. Anything non-zero works.
> > > > > 1 and 2 are often used for other purposes.
> > > > >
> > > > > Perhaps use a value larger than EX__MAX in sysexits.h
> > > > 
> > > > Please note that in a previous comment I mentioned this. Then I said it should be 126. A value in this range should be fine.
> > > > > 1 and 2 are often used for other purposes.
> > > > >
> > > > > Perhaps use a value larger than EX__MAX in sysexits.h
> > > > 
> > > > Please note that in a previous comment I mentioned this. Then I said it should be 126. A value in this range should be fine.
> > > 
> > > OK, thank you, will do.
> > Sorry, I made a typo as well. I should have said "between 1 and 125", as my previous comment said.
> > 
> > > A value between 1 and 125 can be used.
> Correction: the shell requires 1 to 125.
> Many utilities use 1 and 2 for other purposes, so better to avoid them.
> sysexits.h uses values up to 78.
> 
> A value satisfying all the requirement is good.
> Sorry, I made a typo as well. I should have said "between 1 and 125", as my previous comment said.

No worries. I had to quickly revert to 1 to fix build bots.
Feel free to change it; I really don't have any preference at all. (plus I don't have much hw resources to run LLVM tests frequently). Thank you!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126550/new/

https://reviews.llvm.org/D126550



More information about the llvm-commits mailing list