<div dir="ltr">Hi, <div><br></div><div>Well, I just jumped in kdevelop, just because I need a good editor to develop linux kernel. I don't understand the code of kdevelop and clang. </div><div>My "test case" is import the top makefile from linux tree and wait to clang to parse. Just that. It crashes a few minutes latter in a thread from clang parser.</div><div><br></div><div>I know that this asserts are important, but I get this tip to disable asserts from kdevelop community. I think that would take a few days for me to understand what's happening.</div><div>I really would like to understand and fix this issue. If someone is willing to help me and mentor would be great.<br></div><div><br></div><div>I compiled all llvm, clang, kdevelop and kdev-clang plugin in my Arch Linux Desktop. My goal is to have a good editor for linux kernel, with the same features that I had with vim+cscope.</div><div><br></div><div>Thanks</div><div><br></div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div>--</div>Lucas Tanure <br>+55 (19) 988176559<br></div></div></div>
<br><div class="gmail_quote">On Wed, Jan 28, 2015 at 12:10 AM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div class="h5">On Mon, Jan 26, 2015 at 11:46 PM, Olivier J. G. <span dir="ltr"><<a href="mailto:olivier.jg@gmail.com" target="_blank">olivier.jg@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div>void Lexer::lexVerbatimBlockFirstLine(Token &T) {</div><div>again:</div><div> assert(BufferPtr < CommentEnd);</div><div><br></div></div><div>So, failing that assertion is equivalent to memory OOB access.</div><div><br></div><div>Barring an enormous push to stabilize Clang and make it less crashy, you have two options:</div><div>1. Try to recover from assertion failures and segfaults with CrashRecoveryContext</div><div>2. Rig up a separate process to run clang in from kdevelop</div><div><br></div><div>A separate process will be more stable but far more effort.</div><div><br>You'd think compilers wouldn't crash very often, but take a look at the list of crashers found by AFL:</div><div><a href="http://llvm.org/bugs/buglist.cgi?quicksearch=fuzz&list_id=66187" target="_blank">http://llvm.org/bugs/buglist.cgi?quicksearch=fuzz&list_id=66187</a></div><div>While these are all bugs we'd like fixed, it's not clear how soon that will happen. Until then, KDevelop and IDEs in general will need to cope with compiler crashes somehow.</div></div></div></div>
<br></blockquote><div><br></div></span><div>While it seems like this assertion failure would lead to a crash, I should note that I haven't run into any crashes during AST traversal when clang is in release mode. OTOH, clang compiled in debug mode will fairly regularly come up with assertions during AST traversal.<br><br></div><div>For the initial parsing we see plenty of crashes and asserts in both debug and release, but libclang already runs those in a CrashRecoveryContext, so it's not usually an issue (unless you're trying to run KDevelop in gdb...).<br><br></div><div>In short, KDevelop/kdev-clang runs smoothly with release-build clang and is not really usable when clang is built w/ assertions.</div></div></div></div></blockquote><div><br></div></div></div><div>Nonetheless, if you can provide us with testcases for the crashes, we'd appreciate them. </div></div></div></div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>