<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 22, 2015 at 11:52 AM, Riyad Parvez via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" onclick="window.open('https://mail.google.com/mail/?view=cm&tf=1&to=cfe-dev@lists.llvm.org&cc=&bcc=&su=&body=','_blank');return false;">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi All,<div><br></div><div>With "-fsanitize=integer" flag, when an overflow is detected the program is terminated with zero exit code.</div></div></blockquote><div><br></div><div>You can change this behavior by using env. var.</div><div>UBSAN_OPTIONS=halt_on_error=1<br></div><div><br></div><div>(Not sure if this is properly documented anywhere. Alexey? )</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div> But with "-fsanitize=address" flag, the program terminates with non-zero exit code. I think the address sanitizer behavior of non-zero exit code is more intuitive since the program did exit in error. Is there any reason integer overflow sanitizer exits the program with zero exit code?</div></div></blockquote><div><br></div><div>One of the reasons, maybe:</div><div>Programs are more often ubsan-unclean than asan-unclean, and halting on every ubsan message makes it harder to deploy the tool. </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><br></div><div>Thanks,</div><div>Riyad</div></div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" onclick="window.open('https://mail.google.com/mail/?view=cm&tf=1&to=cfe-dev@lists.llvm.org&cc=&bcc=&su=&body=','_blank');return false;">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div></div>