All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-next:master 5266/5426] arch/x86/kernel/cpu/mcheck/mce.c:884:5: warning: 'order' may be used uninitialized in this function
@ 2015-12-10 15:05 kbuild test robot
  2015-12-10 16:02 ` Andrey Ryabinin
  0 siblings, 1 reply; 2+ messages in thread
From: kbuild test robot @ 2015-12-10 15:05 UTC (permalink / raw)
  To: Andrey Ryabinin; +Cc: kbuild-all, Andrew Morton, Linux Memory Management List

[-- Attachment #1: Type: text/plain, Size: 2962 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   8225f4e85cb03daea14661380745886ce01fd83a
commit: 0dd08f12cafd7868be55bc10ebcd4ea13880860b [5266/5426] UBSAN: run-time undefined behavior sanity checker
config: x86_64-randconfig-s5-12102221 (attached as .config)
reproduce:
        git checkout 0dd08f12cafd7868be55bc10ebcd4ea13880860b
        # save the attached .config to linux build tree
        make ARCH=x86_64 

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   arch/x86/kernel/cpu/mcheck/mce.c: In function 'do_machine_check':
>> arch/x86/kernel/cpu/mcheck/mce.c:884:5: warning: 'order' may be used uninitialized in this function [-Wmaybe-uninitialized]
     if (order == 1) {
        ^
   arch/x86/kernel/cpu/mcheck/mce.c:984:6: note: 'order' was declared here
     int order;
         ^

vim +/order +884 arch/x86/kernel/cpu/mcheck/mce.c

3c079792 Andi Kleen      2009-05-27  868   */
3c079792 Andi Kleen      2009-05-27  869  static int mce_end(int order)
3c079792 Andi Kleen      2009-05-27  870  {
3c079792 Andi Kleen      2009-05-27  871  	int ret = -1;
84c2559d Borislav Petkov 2012-10-15  872  	u64 timeout = (u64)mca_cfg.monarch_timeout * NSEC_PER_USEC;
3c079792 Andi Kleen      2009-05-27  873  
3c079792 Andi Kleen      2009-05-27  874  	if (!timeout)
3c079792 Andi Kleen      2009-05-27  875  		goto reset;
3c079792 Andi Kleen      2009-05-27  876  	if (order < 0)
3c079792 Andi Kleen      2009-05-27  877  		goto reset;
3c079792 Andi Kleen      2009-05-27  878  
3c079792 Andi Kleen      2009-05-27  879  	/*
3c079792 Andi Kleen      2009-05-27  880  	 * Allow others to run.
3c079792 Andi Kleen      2009-05-27  881  	 */
3c079792 Andi Kleen      2009-05-27  882  	atomic_inc(&mce_executing);
3c079792 Andi Kleen      2009-05-27  883  
3c079792 Andi Kleen      2009-05-27 @884  	if (order == 1) {
3c079792 Andi Kleen      2009-05-27  885  		/* CHECKME: Can this race with a parallel hotplug? */
3c079792 Andi Kleen      2009-05-27  886  		int cpus = num_online_cpus();
3c079792 Andi Kleen      2009-05-27  887  
3c079792 Andi Kleen      2009-05-27  888  		/*
3c079792 Andi Kleen      2009-05-27  889  		 * Monarch: Wait for everyone to go through their scanning
3c079792 Andi Kleen      2009-05-27  890  		 * loops.
3c079792 Andi Kleen      2009-05-27  891  		 */
3c079792 Andi Kleen      2009-05-27  892  		while (atomic_read(&mce_executing) <= cpus) {

:::::: The code at line 884 was first introduced by commit
:::::: 3c0797925f4ef9d55a32059d2af61a9c262e639d x86, mce: switch x86 machine check handler to Monarch election.

:::::: TO: Andi Kleen <andi@firstfloor.org>
:::::: CC: H. Peter Anvin <hpa@zytor.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 22655 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [linux-next:master 5266/5426] arch/x86/kernel/cpu/mcheck/mce.c:884:5: warning: 'order' may be used uninitialized in this function
  2015-12-10 15:05 [linux-next:master 5266/5426] arch/x86/kernel/cpu/mcheck/mce.c:884:5: warning: 'order' may be used uninitialized in this function kbuild test robot
@ 2015-12-10 16:02 ` Andrey Ryabinin
  0 siblings, 0 replies; 2+ messages in thread
From: Andrey Ryabinin @ 2015-12-10 16:02 UTC (permalink / raw)
  To: kbuild test robot; +Cc: kbuild-all, Andrew Morton, Linux Memory Management List



On 12/10/2015 06:05 PM, kbuild test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   8225f4e85cb03daea14661380745886ce01fd83a
> commit: 0dd08f12cafd7868be55bc10ebcd4ea13880860b [5266/5426] UBSAN: run-time undefined behavior sanity checker
> config: x86_64-randconfig-s5-12102221 (attached as .config)
> reproduce:
>         git checkout 0dd08f12cafd7868be55bc10ebcd4ea13880860b
>         # save the attached .config to linux build tree
>         make ARCH=x86_64 
> 
> Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
> http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings
> 

This is certainly a false positive. 
It seems that UBSAN could make gcc more stupid and increase number of maybe-uninitialized false-positives.


> All warnings (new ones prefixed by >>):
> 
>    arch/x86/kernel/cpu/mcheck/mce.c: In function 'do_machine_check':
>>> arch/x86/kernel/cpu/mcheck/mce.c:884:5: warning: 'order' may be used uninitialized in this function [-Wmaybe-uninitialized]
>      if (order == 1) {
>         ^
>    arch/x86/kernel/cpu/mcheck/mce.c:984:6: note: 'order' was declared here
>      int order;

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-12-10 16:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-10 15:05 [linux-next:master 5266/5426] arch/x86/kernel/cpu/mcheck/mce.c:884:5: warning: 'order' may be used uninitialized in this function kbuild test robot
2015-12-10 16:02 ` Andrey Ryabinin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.