[clang] [analyzer] Avoid crashes in the stream checker (PR #100901)

2024-07-29 Thread via cfe-commits
vabridgers wrote: Thanks @steakhal ! https://github.com/llvm/llvm-project/pull/100901 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Avoid crashes in the stream checker (PR #100901)

2024-07-29 Thread Balazs Benics via cfe-commits
https://github.com/steakhal closed https://github.com/llvm/llvm-project/pull/100901 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Avoid crashes in the stream checker (PR #100901)

2024-07-29 Thread Balazs Benics via cfe-commits
steakhal wrote: Thanks for the really valuable reduced case @vabridgers. I'll close this in favor of #100990 if you don't mind. Thanks again for reporting the crash. https://github.com/llvm/llvm-project/pull/100901 ___ cfe-commits mailing list cfe-com

[clang] [analyzer] Avoid crashes in the stream checker (PR #100901)

2024-07-29 Thread via cfe-commits
vabridgers wrote: Thanks for the comments. I do not mind abandoning this change in favor of a better solution. Please let me know when you have posted an improved PR and I'll abandon this one. Best https://github.com/llvm/llvm-project/pull/100901 __

[clang] [analyzer] Avoid crashes in the stream checker (PR #100901)

2024-07-29 Thread Balázs Kéri via cfe-commits
balazske wrote: > Exactly. I didn't want to rush too much, but I can share that my current idea > is to call `assumeNoAliasingWithStdStreams` only on the success path. This can be a better (and more simple) solution. https://github.com/llvm/llvm-project/pull/100901

[clang] [analyzer] Avoid crashes in the stream checker (PR #100901)

2024-07-29 Thread Balazs Benics via cfe-commits
steakhal wrote: > In the state dump I see that `stdout` seems to be NULL (last line in > "constraints"). This explains why the `StateNull` becomes NULL, because call > to `assumeNoAliasingWithStdStreams` was called already. I think the better > solution is to check NULL-ness of the std stream

[clang] [analyzer] Avoid crashes in the stream checker (PR #100901)

2024-07-29 Thread Balázs Kéri via cfe-commits
balazske wrote: In the state dump I see that `stdout` seems to be NULL (last line in "constraints"). This explains why the `StateNull` becomes NULL, because call to `assumeNoAliasingWithStdStreams` was called already. I think the better solution is to check NULL-ness of the std stream variable

[clang] [analyzer] Avoid crashes in the stream checker (PR #100901)

2024-07-28 Thread via cfe-commits
vabridgers wrote: A little background on how this was found, and a few debugging notes. This was found in a daily static analysis systems level test that we drive internally on our daily integrations, on the lz4 project, found here https://github.com/lz4/lz4.git. There are a number of open so

[clang] [analyzer] Avoid crashes in the stream checker (PR #100901)

2024-07-27 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 Author: None (vabridgers) Changes This change avoids crashes in the stream checker when bifurcating the analysis state produces a non-null return value for opening a stream and does not produces a null return value because of co

[clang] [analyzer] Avoid crashes in the stream checker (PR #100901)

2024-07-27 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (vabridgers) Changes This change avoids crashes in the stream checker when bifurcating the analysis state produces a non-null return value for opening a stream and does not produces a null return value because of constraints found du

[clang] [analyzer] Avoid crashes in the stream checker (PR #100901)

2024-07-27 Thread via cfe-commits
https://github.com/vabridgers created https://github.com/llvm/llvm-project/pull/100901 This change avoids crashes in the stream checker when bifurcating the analysis state produces a non-null return value for opening a stream and does not produces a null return value because of constraints fou