-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable -Wuninitialized #381
Comments
heh, wish I was cc'ed on that thread (I'm not subbed to lkml, ducks) |
Neither am I, I happened to stumble across it while browsing https://lore.kernel.org/lkml/. Guess I should be after this. It is still possible to reply without being CC'd (if you use
|
Unfortunately, introduces a few warnings: https://gist.github.com/nathanchance/59f35754366c7d68141a5f44fe9302b8 Another project like #378 (seems like it could be achieved quicker). |
Yes; and many of those have the same source file (and even the same warning in some cases; like maybe a shared problematic macro). Thanks for the link; I'll file bugs for all of those, and we'll use this to track enabling the warning. |
12 altogether (including this one) |
This helps fine very dodgy behavior through both -Wuninitialized (warning that a variable is always uninitialized) and -Wsometimes-uninitialized (warning that a variable is sometimes uninitialized, like GCC's -Wmaybe-uninitialized). These warnings catch things that GCC doesn't such as: https://lore.kernel.org/lkml/86649ee4-9794-77a3-502c-f4cd10019c36@lca.pw/ We very much want to catch these so turn this warning on so that CI is aware of it. Link: ClangBuiltLinux#381 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
This helps fine very dodgy behavior through both -Wuninitialized (warning that a variable is always uninitialized) and -Wsometimes-uninitialized (warning that a variable is sometimes uninitialized, like GCC's -Wmaybe-uninitialized). These warnings catch things that GCC doesn't such as: https://lore.kernel.org/lkml/86649ee4-9794-77a3-502c-f4cd10019c36@lca.pw/ We very much want to catch these so turn this warning on so that CI is aware of it. Link: ClangBuiltLinux#381 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
This helps fine very dodgy behavior through both -Wuninitialized (warning that a variable is always uninitialized) and -Wsometimes-uninitialized (warning that a variable is sometimes uninitialized, like GCC's -Wmaybe-uninitialized). These warnings catch things that GCC doesn't such as: https://lore.kernel.org/lkml/86649ee4-9794-77a3-502c-f4cd10019c36@lca.pw/ We very much want to catch these so turn this warning on so that CI is aware of it. Link: ClangBuiltLinux#381 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
This helps fine very dodgy behavior through both -Wuninitialized (warning that a variable is always uninitialized) and -Wsometimes-uninitialized (warning that a variable is sometimes uninitialized, like GCC's -Wmaybe-uninitialized). These warnings catch things that GCC doesn't such as: https://lore.kernel.org/lkml/86649ee4-9794-77a3-502c-f4cd10019c36@lca.pw/ We very much want to catch these so turn this warning on so that CI is aware of it. Link: ClangBuiltLinux#381 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
This helps fine very dodgy behavior through both -Wuninitialized (warning that a variable is always uninitialized) and -Wsometimes-uninitialized (warning that a variable is sometimes uninitialized, like GCC's -Wmaybe-uninitialized). These warnings catch things that GCC doesn't such as: https://lore.kernel.org/lkml/86649ee4-9794-77a3-502c-f4cd10019c36@lca.pw/ We very much want to catch these so turn this warning on so that CI is aware of it. Link: ClangBuiltLinux#381 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Merged into mainline: https://git.kernel.org/torvalds/c/3a61925e91ba9f0ece1b444eb1aa49caa59e4ae7 |
This helps fine very dodgy behavior through both -Wuninitialized (warning that a variable is always uninitialized) and -Wsometimes-uninitialized (warning that a variable is sometimes uninitialized, like GCC's -Wmaybe-uninitialized). These warnings catch things that GCC doesn't such as: https://lore.kernel.org/lkml/86649ee4-9794-77a3-502c-f4cd10019c36@lca.pw/ We very much want to catch these so turn this warning on so that CI is aware of it. Link: ClangBuiltLinux/linux#381 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
This helps fine very dodgy behavior through both -Wuninitialized (warning that a variable is always uninitialized) and -Wsometimes-uninitialized (warning that a variable is sometimes uninitialized, like GCC's -Wmaybe-uninitialized). These warnings catch things that GCC doesn't such as: https://lore.kernel.org/lkml/86649ee4-9794-77a3-502c-f4cd10019c36@lca.pw/ We very much want to catch these so turn this warning on so that CI is aware of it. Link: ClangBuiltLinux/linux#381 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Eamon Powell <eamonpowell@outlook.com>
This helps fine very dodgy behavior through both -Wuninitialized (warning that a variable is always uninitialized) and -Wsometimes-uninitialized (warning that a variable is sometimes uninitialized, like GCC's -Wmaybe-uninitialized). These warnings catch things that GCC doesn't such as: https://lore.kernel.org/lkml/86649ee4-9794-77a3-502c-f4cd10019c36@lca.pw/ We very much want to catch these so turn this warning on so that CI is aware of it. Link: ClangBuiltLinux/linux#381 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
This helps fine very dodgy behavior through both -Wuninitialized (warning that a variable is always uninitialized) and -Wsometimes-uninitialized (warning that a variable is sometimes uninitialized, like GCC's -Wmaybe-uninitialized). These warnings catch things that GCC doesn't such as: https://lore.kernel.org/lkml/86649ee4-9794-77a3-502c-f4cd10019c36@lca.pw/ We very much want to catch these so turn this warning on so that CI is aware of it. Link: ClangBuiltLinux/linux#381 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
This will be turned on for the whole kernel, as we want to catch these cases. This reverts commit c562746. Link: ClangBuiltLinux/linux#381 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Albert I <kras@raphielgang.org>
This will be turned on for the whole kernel, as we want to catch these cases. This reverts commit c562746. Link: ClangBuiltLinux/linux#381 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Albert I <kras@raphielgang.org>
This will be turned on for the whole kernel, as we want to catch these cases. This reverts commit c562746. Link: ClangBuiltLinux/linux#381 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Albert I <kras@raphielgang.org>
This will be turned on for the whole kernel, as we want to catch these cases. This reverts commit c562746. Link: ClangBuiltLinux/linux#381 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Albert I <kras@raphielgang.org>
This will be turned on for the whole kernel, as we want to catch these cases. This reverts commit c562746. Link: ClangBuiltLinux/linux#381 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Albert I <kras@raphielgang.org> Signed-off-by: Akito Mizukito <akito@evolution-x.org>
This will be turned on for the whole kernel, as we want to catch these cases. This reverts commit c562746. Link: ClangBuiltLinux/linux#381 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Albert I <kras@raphielgang.org>
Add and use snd_pcm_stream_lock_nested() in snd_pcm_link/unlink implementation. The code is fine, but generates a lockdep complaint: ============================================ WARNING: possible recursive locking detected 5.7.1mq+ #381 Tainted: G O -------------------------------------------- pulseaudio/4180 is trying to acquire lock: ffff888402d6f508 (&group->lock){-...}-{2:2}, at: snd_pcm_common_ioctl+0xda8/0xee0 [snd_pcm] but task is already holding lock: ffff8883f7a8cf18 (&group->lock){-...}-{2:2}, at: snd_pcm_common_ioctl+0xe4e/0xee0 [snd_pcm] other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&group->lock); lock(&group->lock); *** DEADLOCK *** May be due to missing lock nesting notation 2 locks held by pulseaudio/4180: #0: ffffffffa1a05190 (snd_pcm_link_rwsem){++++}-{3:3}, at: snd_pcm_common_ioctl+0xca0/0xee0 [snd_pcm] #1: ffff8883f7a8cf18 (&group->lock){-...}-{2:2}, at: snd_pcm_common_ioctl+0xe4e/0xee0 [snd_pcm] [...] Cc: stable@vger.kernel.org Fixes: f57f3df ("ALSA: pcm: More fine-grained PCM link locking") Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Link: https://lore.kernel.org/r/37252c65941e58473b1219ca9fab03d48f47e3e3.1591610330.git.mirq-linux@rere.qmqm.pl Signed-off-by: Takashi Iwai <tiwai@suse.de>
This will be turned on for the whole kernel, as we want to catch these cases. This reverts commit c562746. Link: ClangBuiltLinux/linux#381 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Albert I <kras@raphielgang.org>
This will be turned on for the whole kernel, as we want to catch these cases. This reverts commit c562746. Link: ClangBuiltLinux/linux#381 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Albert I <kras@raphielgang.org>
This will be turned on for the whole kernel, as we want to catch these cases. This reverts commit c562746. Link: ClangBuiltLinux/linux#381 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
This will be turned on for the whole kernel, as we want to catch these cases. This reverts commit c562746. Link: ClangBuiltLinux/linux#381 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
This will be turned on for the whole kernel, as we want to catch these cases. This reverts commit c562746. Link: ClangBuiltLinux/linux#381 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
This will be turned on for the whole kernel, as we want to catch these cases. This reverts commit c562746. Link: ClangBuiltLinux/linux#381 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
This will be turned on for the whole kernel, as we want to catch these cases. This reverts commit c562746. Link: ClangBuiltLinux/linux#381 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
This helps fine very dodgy behavior through both -Wuninitialized (warning that a variable is always uninitialized) and -Wsometimes-uninitialized (warning that a variable is sometimes uninitialized, like GCC's -Wmaybe-uninitialized). These warnings catch things that GCC doesn't such as: https://lore.kernel.org/lkml/86649ee4-9794-77a3-502c-f4cd10019c36@lca.pw/ We very much want to catch these so turn this warning on so that CI is aware of it. Link: ClangBuiltLinux/linux#381 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: 0ranko0P <ranko0p@outlook.com>
29b00e6 would have been caught with Clang in its default configuration (and not by GCC due to a bug), as pointed out in this thread: https://lore.kernel.org/lkml/86649ee4-9794-77a3-502c-f4cd10019c36@lca.pw/
However,
-Wuninitialized
also disables-Wsometimes-uninitialized
so this was missed by both compilers :(I am going to test the following diff then send it along right away if there are no additional warnings:
Side note, looks like this might be a good time to tell Linus about the KernelCI work that is going on: https://lore.kernel.org/lkml/CAHk-=wggjLsi-1BmDHqWAJPzBvTD_-MQNo5qQ9WCuncnyWPROg@mail.gmail.com/
The text was updated successfully, but these errors were encountered: