[cfe-dev] Uninitialized Variables Analysis crashing

Artem Dergachev via cfe-dev cfe-dev at lists.llvm.org
Mon Sep 24 12:36:46 PDT 2018


Is the DeclRefExpr for __spec_mode pointing to a valid VarDecl? Would 
this VarDecl be encountered previously during analysis in order to 
populate TransferFunctions::vals()? Dunno if that makes sense, i didn't 
really look at this analysis.

I guess i want to look at your full -ast-dump. It seems that you are not 
only adding a new Stmt kind, but also you're getting into business of 
auto-generating AST made of some regular nodes, probably as its 
children. This is often hard because it's very easy to break invariants 
that the normal AST obeys and there's no way to verify those invariants 
other than seeing how everything crashes and debugging.

On 9/24/18 4:43 AM, João Paulo Labegalini de Carvalho via cfe-dev wrote:
> You are right, I should have been more specific. In my case crashing 
> means segmentation fault inside runOnBlock function 
> (lib/Analysis/UninitializedValues.cpp).
>
> Please find the stack trace attached.
>
> On Mon, Sep 24, 2018 at 4:09 AM Csaba Raduly <rcsaba at gmail.com 
> <mailto:rcsaba at gmail.com>> wrote:
>
>     Hi João Paulo,
>
>
>     On Sun, Sep 23, 2018 at 11:39 PM, João Paulo Labegalini de Carvalho
>     via cfe-dev <cfe-dev at lists.llvm.org
>     <mailto:cfe-dev at lists.llvm.org>> wrote:
>     > Hi,
>     >
>     > I have implemented a new Stmt in clang which given
>     >
>     > __speculate {
>     >  // user code
>     > }
>     >
>     > generates LLVM IR equivalent to as if the following code was given:
>     >
>     ...
>     >
>     > However, if UninitializedVariablesAnalysis is enabled, clang
>     crashes at
>     > runOnBlock function (lib/Analysis/UninitializedValues.cpp). If I
>     disable it
>     > via -Wno-uninitialized, the code generated runs flawlessly and
>     works as
>     > expected.
>
>     "crash" is a meaningless term. Does it generate an access violation,
>     an assertion failure, or something else?
>     What was the error message? Is there a stack trace?
>
>
>     Csaba
>
>     -- 
>     You can get very substantial performance improvements
>     by not doing the right thing. - Scott Meyers, An Effective
>     C++11/14 Sampler
>     So if you're looking for a completely portable, 100%
>     standards-conformat way
>     to get the wrong information: this is what you want. - Scott
>     Meyers (C++TDaWYK)
>
>
>
> -- 
> João Paulo L. de Carvalho
> Computer Science |  IC-UNICAMP | Campinas , SP - Brazil
> jaopaulolc at gmail.com <mailto:jaopaulolc at gmail.com>
> joao.carvalho at ic.unicamp.br <mailto:joao.carvalho at ic.unicamp.br>
> j160924 at dac.unicamp.br <mailto:j160924 at dac.unicamp.br>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180924/b438c638/attachment.html>


More information about the cfe-dev mailing list