<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <br>
    <div class="moz-cite-prefix">On 01/28/15 02:46 PM, Lucas Tanure
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAJyon0vCfdQbPr9agunaoHr_ZywBxQztH04WBptCNKMC-HDYQQ@mail.gmail.com"
      type="cite">
      <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>
    </blockquote>
    I'm using NetBeans for that. Last time I checked It handled Linux
    kernel pretty well. <br>
    I use "Project from existing sources" and build it once from the IDE
    to allow it auto detect compiler options like in [1].<br>
    <br>
    It works reasonably fast if you give it enough memory (i.e. whole
    LLVM+CLang+Extra source tree is parsed within 1 min on my linux
    laptop when I start "netbeans -J-Xmx2G --cachedir /ram/mounted/dir
    ").<br>
    <br>
    Hope it helps,<br>
    Vladimir.<br>
    [1] Studio is based on top of NetBeans<br>
<a class="moz-txt-link-freetext" href="https://www.youtube.com/watch?v=uEtFOtkzMO4&index=9&list=PLKCk3OyNwIzuRh2YsM2MtFAwB_qEWC5Rn">https://www.youtube.com/watch?v=uEtFOtkzMO4&index=9&list=PLKCk3OyNwIzuRh2YsM2MtFAwB_qEWC5Rn</a><br>
    <br>
    <blockquote
cite="mid:CAJyon0vCfdQbPr9agunaoHr_ZywBxQztH04WBptCNKMC-HDYQQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <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 moz-do-not-send="true"
              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
                          moz-do-not-send="true"
                          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 moz-do-not-send="true"
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 moz-do-not-send="true" href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
            <a moz-do-not-send="true"
              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>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
cfe-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>