Skip to contentSkip to conversation

2.6.28-rc6: hpet: object is on stack, but not annotated

DISCUSSION Applied Alexander Beregalov 5 participants 9 messages Nov 24, 2008 – Jan 12, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi

It is X86_64, SMP
It appears during boot process.

CONFIG_HPET_TIMER=y CONFIG_HPET_EMULATE_RTC=y
CONFIG_HPET=y
CONFIG_HPET_MMAP=y
CONFIG_DEBUG_OBJECTS=y
# CONFIG_DEBUG_OBJECTS_SELFTEST is not set CONFIG_DEBUG_OBJECTS_FREE=y CONFIG_DEBUG_OBJECTS_TIMERS=y

hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0
hpet0: 3 comparators, 64-bit 14.318180 MHz counter
ODEBUG: object is on stack, but not annotated

------------[ cut here ]------------
WARNING: at lib/debugobjects.c:251 __debug_object_init+0x2a4/0x352()
Modules linked in:
Pid: 1, comm: swapper Not tainted 2.6.28-rc6-00007-ged31348 #5
Call Trace:
 [<ffffffff8023661b>] warn_on_slowpath+0x58/0x7d
 [<ffffffff804de4b6>] ? printk+0x67/0x69
 [<ffffffff8037fd54>] ? __debug_object_init+0x185/0x352
 [<ffffffff8037fe73>] __debug_object_init+0x2a4/0x352
 [<ffffffff8037ff4e>] debug_object_init+0x14/0x16
 [<ffffffff8023f681>] init_timer+0x18/0x5b
 [<ffffffff80220739>] hpet_cpuhp_notify+0x93/0x105
 [<ffffffff80220872>] ? hpet_work+0x0/0x206
 [<ffffffff803d0301>] ? hpet_alloc+0x32d/0x389
 [<ffffffff80256db2>] ? trace_hardirqs_on_caller+0x10d/0x138
 [<ffffffff80256dea>] ? trace_hardirqs_on+0xd/0xf
 [<ffffffff806c45b7>] ? hpet_late_init+0x0/0x19e
 [<ffffffff806c45b7>] ? hpet_late_init+0x0/0x19e
 [<ffffffff806c4721>] hpet_late_init+0x16a/0x19e
 [<ffffffff806c27a9>] ? print_all_ICs+0x0/0x540
 [<ffffffff80209058>] _stext+0x58/0x138
 [<ffffffff804e0ecb>] ? _spin_unlock+0x4a/0x57
 [<ffffffff802db669>] ? proc_register+0x17f/0x193
 [<ffffffff802db7a5>] ? create_proc_entry+0x7e/0x94
 [<ffffffff80267d15>] ? register_irq_proc+0xb0/0xcc
 [<ffffffff802d0000>] ? elf_core_dump+0x662/0xc71
 [<ffffffff806b9625>] kernel_init+0x125/0x179
 [<ffffffff804e087f>] ? trace_hardirqs_on_thunk+0x3a/0x3f
 [<ffffffff8020c849>] child_rip+0xa/0x11
 [<ffffffff8020bd38>] ? restore_args+0x0/0x30
 [<ffffffff806b9500>] ? kernel_init+0x0/0x179
 [<ffffffff8020c83f>] ? child_rip+0x0/0x11
---[ end trace 4eaa2a86a8e2da22 ]---

Switched to high resolution mode on CPU 0 Switched to high resolution mode on CPU 3 Switched to high resolution mode on CPU 2 Switched to high resolution mode on CPU 1

#1 lore raw

2008/11/24 Alexander Beregalov <[email protected]>:

Quoted 5 lines

hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0
hpet0: 3 comparators, 64-bit 14.318180 MHz counter
ODEBUG: object is on stack, but not annotated

------------[ cut here ]------------
WARNING: at lib/debugobjects.c:251 __debug_object_init+0x2a4/0x352()

Bisected down to 26afe5f2fbf06ea0765aaa316640c4dd472310c0 (x86: HPET_MSI Initialise per-cpu HPET timers)

Revert helps

#2 lore raw
Quoted 11 lines · Alexander Beregalov

2008/11/24 Alexander Beregalov <[email protected]>:

Quoted 5 lines

hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0
hpet0: 3 comparators, 64-bit 14.318180 MHz counter
ODEBUG: object is on stack, but not annotated

------------[ cut here ]------------
WARNING: at lib/debugobjects.c:251 __debug_object_init+0x2a4/0x352()

Bisected down to 26afe5f2fbf06ea0765aaa316640c4dd472310c0 (x86: HPET_MSI Initialise per-cpu HPET timers)

Revert helps

That's just a warning about a missing annotation. The commit is fine.

Thanks,

tglx

#3 lore raw
Quoted 9 lines · Thomas Gleixner
Quoted 7 lines · Alexander Beregalov

2008/11/24 Alexander Beregalov <[email protected]>:

Quoted 5 lines

hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0
hpet0: 3 comparators, 64-bit 14.318180 MHz counter
ODEBUG: object is on stack, but not annotated

------------[ cut here ]------------
WARNING: at lib/debugobjects.c:251 __debug_object_init+0x2a4/0x352()
Quoted 6 lines
Quoted 4 lines

Bisected down to 26afe5f2fbf06ea0765aaa316640c4dd472310c0 (x86: HPET_MSI Initialise per-cpu HPET timers)

Revert helps

That's just a warning about a missing annotation. The commit is fine.

You must be using very different metric of what "fine" means than rest of the world.

(No, introducing WARN_ON()s is not fine; it spams kerneloops.org at least...)

Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#4 lore raw

2008/12/4 Pavel Machek <[email protected]>:

Quoted 13 lines · Thomas Gleixner
Quoted 12 lines · Alexander Beregalov
Quoted 11 lines

2008/11/24 Alexander Beregalov <[email protected]>:

Quoted 5 lines

hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0
hpet0: 3 comparators, 64-bit 14.318180 MHz counter
ODEBUG: object is on stack, but not annotated

------------[ cut here ]------------
WARNING: at lib/debugobjects.c:251 __debug_object_init+0x2a4/0x352()

Bisected down to 26afe5f2fbf06ea0765aaa316640c4dd472310c0 (x86: HPET_MSI Initialise per-cpu HPET timers)

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

Revert helps

That's just a warning about a missing annotation. The commit is fine.

You must be using very different metric of what "fine" means than rest of the world.

(No, introducing WARN_ON()s is not fine; it spams kerneloops.org at least...)

The warning is still here on 2.6.29-rc1.
It taints the kernel.

#5 lore raw
Quoted 18 lines · Alexander Beregalov

2008/12/4 Pavel Machek <[email protected]>:

Quoted 17 lines · Thomas Gleixner
Quoted 15 lines · Alexander Beregalov
Quoted 8 lines

2008/11/24 Alexander Beregalov <[email protected]>:

Quoted 5 lines

hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0
hpet0: 3 comparators, 64-bit 14.318180 MHz counter
ODEBUG: object is on stack, but not annotated

------------[ cut here ]------------
WARNING: at lib/debugobjects.c:251 __debug_object_init+0x2a4/0x352()
Quoted 4 lines

Bisected down to 26afe5f2fbf06ea0765aaa316640c4dd472310c0 (x86: HPET_MSI Initialise per-cpu HPET timers)

Revert helps

That's just a warning about a missing annotation. The commit is fine.

Quoted 7 lines
Quoted 4 lines

You must be using very different metric of what "fine" means than rest of the world.

(No, introducing WARN_ON()s is not fine; it spams kerneloops.org at least...)

The warning is still here on 2.6.29-rc1.
It taints the kernel.

Does this fix it?

---
 arch/x86/kernel/hpet.c    |    2 +-
 include/linux/workqueue.h |    6 ++++++
 2 files changed, 7 insertions(+), 1 deletions(-)
arch/x86/kernel/hpet.c +1 -1
index cd759ad..bb2e0f0 100644
@@ -628,7 +628,7 @@ static int hpet_cpuhp_notify(struct notifier_block *n,
 
 	switch (action & 0xf) {
 	case CPU_ONLINE:
-		INIT_DELAYED_WORK(&work.work, hpet_work);
+		INIT_DELAYED_WORK_ON_STACK(&work.work, hpet_work);
 		init_completion(&work.complete);
 		/* FIXME: add schedule_work_on() */
 		schedule_delayed_work_on(cpu, &work.work, 0);
include/linux/workqueue.h +6 -0
index b362911..47151c8 100644
@@ -118,6 +118,12 @@ struct execute_work {
 		init_timer(&(_work)->timer);			\
 	} while (0)
 
+#define INIT_DELAYED_WORK_ON_STACK(_work, _func)		\
+	do {							\
+		INIT_WORK(&(_work)->work, (_func));		\
+		init_timer_on_stack(&(_work)->timer);		\
+	} while (0)
+
 #define INIT_DELAYED_WORK_DEFERRABLE(_work, _func)			\
 	do {							\
 		INIT_WORK(&(_work)->work, (_func));		\
Applied
#6 lore raw
Quoted 6 lines · Peter Zijlstra
Quoted 4 lines
Quoted 2 lines

(No, introducing WARN_ON()s is not fine; it spams kerneloops.org at least...)

The warning is still here on 2.6.29-rc1. It taints the kernel.

Does this fix it?

i've applied it to tip/timers/urgent and will send it to Linus if it passes Alexander's testing too. Below is the prettified commit.

Thanks guys,

Ingo
-------------->
From b1f1006971b6f8d330c6e8ecf240f51c9eb67f4d Mon Sep 17 00:00:00 2001
From: Peter Zijlstra <[email protected]>
Date: Mon, 12 Jan 2009 12:52:23 +0100
Subject: [PATCH] locking, hpet: annotate false positive warning

Alexander Beregalov reported that this warning is caused by the HPET code:

Quoted 8 lines

hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0
hpet0: 3 comparators, 64-bit 14.318180 MHz counter
ODEBUG: object is on stack, but not annotated

------------[ cut here ]------------
WARNING: at lib/debugobjects.c:251 __debug_object_init+0x2a4/0x352()

Bisected down to 26afe5f2fbf06ea0765aaa316640c4dd472310c0 (x86: HPET_MSI Initialise per-cpu HPET timers)

The commit is fine - but the on-stack workqueue entry needs annotation.

---
 arch/x86/kernel/hpet.c    |    2 +-
 include/linux/workqueue.h |    6 ++++++
 2 files changed, 7 insertions(+), 1 deletions(-)
arch/x86/kernel/hpet.c +1 -1
index cd759ad..bb2e0f0 100644
@@ -628,7 +628,7 @@ static int hpet_cpuhp_notify(struct notifier_block *n,
 
 	switch (action & 0xf) {
 	case CPU_ONLINE:
-		INIT_DELAYED_WORK(&work.work, hpet_work);
+		INIT_DELAYED_WORK_ON_STACK(&work.work, hpet_work);
 		init_completion(&work.complete);
 		/* FIXME: add schedule_work_on() */
 		schedule_delayed_work_on(cpu, &work.work, 0);
include/linux/workqueue.h +6 -0
index b362911..47151c8 100644
@@ -118,6 +118,12 @@ struct execute_work {
 		init_timer(&(_work)->timer);			\
 	} while (0)
 
+#define INIT_DELAYED_WORK_ON_STACK(_work, _func)		\
+	do {							\
+		INIT_WORK(&(_work)->work, (_func));		\
+		init_timer_on_stack(&(_work)->timer);		\
+	} while (0)
+
 #define INIT_DELAYED_WORK_DEFERRABLE(_work, _func)			\
 	do {							\
 		INIT_WORK(&(_work)->work, (_func));		\
#7 lore raw

2009/1/12 Ingo Molnar <[email protected]>:

Quoted 9 lines · Peter Zijlstra
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

(No, introducing WARN_ON()s is not fine; it spams kerneloops.org at least...)

The warning is still here on 2.6.29-rc1. It taints the kernel.

Does this fix it?

Yes, it does. Thanks Peter.

Quoted 3 lines

i've applied it to tip/timers/urgent and will send it to Linus if it passes Alexander's testing too. Below is the prettified commit.

Yes, please.

Quoted 62 lines

Thanks guys,

Ingo
-------------->
From b1f1006971b6f8d330c6e8ecf240f51c9eb67f4d Mon Sep 17 00:00:00 2001
From: Peter Zijlstra <[email protected]>
Date: Mon, 12 Jan 2009 12:52:23 +0100
Subject: [PATCH] locking, hpet: annotate false positive warning

Alexander Beregalov reported that this warning is caused by the HPET code:

Quoted 8 lines

hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0
hpet0: 3 comparators, 64-bit 14.318180 MHz counter
ODEBUG: object is on stack, but not annotated

------------[ cut here ]------------
WARNING: at lib/debugobjects.c:251 __debug_object_init+0x2a4/0x352()

Bisected down to 26afe5f2fbf06ea0765aaa316640c4dd472310c0 (x86: HPET_MSI Initialise per-cpu HPET timers)

The commit is fine - but the on-stack workqueue entry needs annotation.

---
 arch/x86/kernel/hpet.c    |    2 +-
 include/linux/workqueue.h |    6 ++++++
 2 files changed, 7 insertions(+), 1 deletions(-)
arch/x86/kernel/hpet.c +1 -1
index cd759ad..bb2e0f0 100644
@@ -628,7 +628,7 @@ static int hpet_cpuhp_notify(struct notifier_block *n,
 
       switch (action & 0xf) {
       case CPU_ONLINE:
-               INIT_DELAYED_WORK(&work.work, hpet_work);
+               INIT_DELAYED_WORK_ON_STACK(&work.work, hpet_work);
               init_completion(&work.complete);
               /* FIXME: add schedule_work_on() */
               schedule_delayed_work_on(cpu, &work.work, 0);
include/linux/workqueue.h +6 -0
index b362911..47151c8 100644
@@ -118,6 +118,12 @@ struct execute_work {
               init_timer(&(_work)->timer);                    \
       } while (0)
 
+#define INIT_DELAYED_WORK_ON_STACK(_work, _func)               \
+       do {                                                    \
+               INIT_WORK(&(_work)->work, (_func));             \
+               init_timer_on_stack(&(_work)->timer);           \
+       } while (0)
+
 #define INIT_DELAYED_WORK_DEFERRABLE(_work, _func)                     \
       do {                                                    \
               INIT_WORK(&(_work)->work, (_func));             \
#8 lore raw
Quoted 11 lines · Alexander Beregalov

2009/1/12 Ingo Molnar <[email protected]>:

Quoted 9 lines · Peter Zijlstra
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

(No, introducing WARN_ON()s is not fine; it spams kerneloops.org at least...)

The warning is still here on 2.6.29-rc1. It taints the kernel.

Does this fix it?

Yes, it does. Thanks Peter.

thanks - added your Tested-by tag to the commit too.

Ingo