<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jun 27, 2018, at 7:54 PM, Ella Oikawa <<a href="mailto:alansnape3058@gmail.com" class="">alansnape3058@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Hi George,</div><div class=""><br class=""></div>> <span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline" class="">You can compile LLVM with assertions disabled, but I don’t think it would solve your problem.</span><div class=""><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline" class=""><br class=""></span></div><div class=""><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline" class="">I think so.</span></div><div class=""><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline" class=""><br class=""></span></div><div class=""><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline" class="">> <span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline" class="">By the time the assertion is hit, your program is already in an inconsistent state it can not recover from.</span></span></div><div class=""><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline" class=""><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline" class=""><br class=""></span></span></div><div class=""><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline" class=""><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline" class="">Not the entire program, only the process analyzing that function. The data of analyzing each function is isolated from each other, if the analysis of a function crashes, these bad data will not affect other functions and the entire program as far as I think.</span></span></div><div class=""><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline" class=""><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline" class=""><br class=""></span></span></div><div class=""><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline" class=""><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline" class="">So I think the forking method is at least an acceptable bypass for the problem I encountered.</span></span></div></div></div></blockquote><div><br class=""></div>OK then indeed analyzing each function in a separate process is a good approach for you.</div><div><br class=""></div><div><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline" class=""><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline" class=""><br class=""></span></span></div><div class=""><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline" class=""><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline" class="">Regards,</span></span></div><div class=""><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline" class=""><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline" class="">Ella</span></span></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="">George Karpenkov <<a href="mailto:ekarpenkov@apple.com" class="">ekarpenkov@apple.com</a>> 于2018年6月28日周四 上午10:43写道:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space" class="">Hi Ella,<div class=""><br class=""></div><div class="">I still don’t understand your question.</div><div class="">You can compile LLVM with assertions disabled, but I don’t think it would solve your problem.</div><div class=""><br class=""></div><div class=""><div class=""><blockquote type="cite" class=""><div class="">On Jun 27, 2018, at 7:24 PM, Ella Oikawa <<a href="mailto:alansnape3058@gmail.com" target="_blank" class="">alansnape3058@gmail.com</a>> wrote:</div><br class="m_6514131091398065724Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Hi <span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline" class="">George,</span></div><div class=""><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline" class=""><br class=""></span></div>As you mentioned above, assertions are good for developers. But for users, they are annoyed, especially when the scan process is nearly finished</div></div></blockquote><div class=""><br class=""></div><div class="">What would you like to do once this happens? By the time the assertion is hit, your program is already in an inconsistent state it can not recover from.</div><div class=""><br class=""></div><div class="">One possibility here is to run clang once to ask it to dump analyzer entry points in a file [you would have to implement that],</div><div class="">and then fork a separate process per each entry point.</div><div class="">Then if the process crashes, all other functions could still be analyzed.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class="">. My team is developing the tool, but the users are from other teams, so the "production" version for these teams should be "stable" enough, even though all the mistakes are hidden.<div class="">The errors vary from project to project, and only a few open source projects in our benchmark will trigger the assertions in clang, so they are hard to model. And my team has very few developers, we do not have enough time to model these errors, neither the user team (they even do not want to provide their code to us).</div><div class="">My team is using the old version (3.3) of the llvm/clang project</div></div></div></blockquote><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""> (the oldest code may be written originally by Zhongxing Xu, the writer of the paper which the clang static analyzer is based on, even older than the clang static analyzer itself), I am not sure these "bugs" in clang and llvm still exists in the latest versions. And the count of developers limits us from updating the clang/llvm version, as we have so many features to develop and have limited time to do so.</div><div class=""><br class=""></div><div class="">Regards,</div><div class="">Ella</div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="">George Karpenkov <<a href="mailto:ekarpenkov@apple.com" target="_blank" class="">ekarpenkov@apple.com</a>> 于2018年6月26日周二 上午2:38写道:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space" class="">Hi Ella,<br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Jun 24, 2018, at 1:23 AM, alan snape via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" class="">cfe-dev@lists.llvm.org</a>> wrote:</div><br class="m_6514131091398065724m_-2221221588749048722Apple-interchange-newline"><div class=""><div dir="ltr" class="">My team is developing a static analysis tool based on clang and llvm, but the assertion failures in the source code of llvm and clang will always crash the program execution, which is not acceptable in a **stable product**.</div></div></blockquote><div class=""><br class=""></div><div class="">Each assertion failure is a bug you can report at <a href="http://bugs.llvm.org/" target="_blank" class="">bugs.llvm.org</a>. Do you really get that many?</div><div class="">We at Apple regularly run the clang static analyzer on huge chunks of the internal codebase, and in my understanding Google does the same,</div><div class="">so I am quite surprised this is a problem for you.</div><div class=""> </div><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""> The tool analyzes the functions one by one in the Call Graph SCC order, so is there any way to tolerate the assertion failures and continue the analysis on the next function when assertion failures occur on calling some APIs of clang and llvm? (crashes only the analysis of the function<span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline" class=""><span class=""> </span>(the analysis methods of the FunctionDecl)</span> being analyzed, not the entire program)</div></div></blockquote><div class=""><br class=""></div><div class="">I would really like to challenge your assumption here that assertions are unacceptable.</div><div class=""><br class=""></div><div class="">A clean crash with an understandable stack trace means that the problem can be fixed.</div><div class="">Adding layers of indirection which hide those failures means that the bug gets unnoticed,</div><div class="">and the analyzer probably ends up doing something wrong.</div><div class=""><br class=""></div><div class="">Could you clarify what is the common error mode for you?</div><div class=""><br class=""></div><div class="">Regards,</div><div class="">George</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Ella</div></div>
_______________________________________________<br class="">cfe-dev mailing list<br class=""><a href="mailto:cfe-dev@lists.llvm.org" target="_blank" class="">cfe-dev@lists.llvm.org</a><br class=""><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br class=""></div></blockquote></div><br class=""></div></blockquote></div>
</div></blockquote></div><br class=""></div></div></blockquote></div>
</div></blockquote></div><br class=""></body></html>