linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* BUG: Bad rss-counter state
@ 2012-04-08 11:39 Markus Trippelsdorf
  2012-04-09  5:58 ` Markus Trippelsdorf
  0 siblings, 1 reply; 7+ messages in thread
From: Markus Trippelsdorf @ 2012-04-08 11:39 UTC (permalink / raw)
  To: linux-mm; +Cc: linux-kernel, Konstantin Khlebnikov, Hugh Dickins

I've hit the following warning after I've tried to link Firofox's libxul
with "-flto -lto-partition=none" on my machine with 8GB memory. I've
killed the process after it used all the memory and 90% of my swap
space. Before the machine was rebooted I saw these messages:

Apr  8 13:11:08 x4 kernel: BUG: Bad rss-counter state mm:ffff88020813c380 idx:1 val:-1
Apr  8 13:11:08 x4 kernel: BUG: Bad rss-counter state mm:ffff88020813c380 idx:2 val:1
Apr  8 13:11:08 x4 kernel: BUG: Bad rss-counter state mm:ffff88021503bb80 idx:1 val:-1
Apr  8 13:11:08 x4 kernel: BUG: Bad rss-counter state mm:ffff8801fb643b80 idx:1 val:-1
Apr  8 13:11:08 x4 kernel: BUG: Bad rss-counter state mm:ffff8801fb643b80 idx:2 val:1
Apr  8 13:11:08 x4 kernel: BUG: Bad rss-counter state mm:ffff88021503bb80 idx:2 val:1
Apr  8 13:11:08 x4 kernel: BUG: Bad rss-counter state mm:ffff88020a4ff800 idx:1 val:-1
Apr  8 13:11:08 x4 kernel: BUG: Bad rss-counter state mm:ffff88020a4ff800 idx:2 val:1
Apr  8 13:11:08 x4 kernel: BUG: Bad rss-counter state mm:ffff88020813ce00 idx:1 val:-1
Apr  8 13:11:08 x4 kernel: BUG: Bad rss-counter state mm:ffff88020813ce00 idx:2 val:1
Apr  8 13:11:08 x4 kernel: BUG: Bad rss-counter state mm:ffff8801fadda680 idx:1 val:-1
Apr  8 13:11:08 x4 kernel: BUG: Bad rss-counter state mm:ffff8801fadda680 idx:2 val:1

These warnings were introduced by c3f0327f8e9d7. Wouldn't it make sense to hide
them under some debugging option? AFAICS they contain no information that could
be of any use to a casual user.

-- 
Markus

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

* Re: BUG: Bad rss-counter state
  2012-04-08 11:39 Markus Trippelsdorf
@ 2012-04-09  5:58 ` Markus Trippelsdorf
  0 siblings, 0 replies; 7+ messages in thread
From: Markus Trippelsdorf @ 2012-04-09  5:58 UTC (permalink / raw)
  To: linux-mm; +Cc: linux-kernel, Konstantin Khlebnikov, Hugh Dickins

On 2012.04.08 at 13:39 +0200, Markus Trippelsdorf wrote:
> I've hit the following warning after I've tried to link Firofox's libxul
> with "-flto -lto-partition=none" on my machine with 8GB memory. I've
> killed the process after it used all the memory and 90% of my swap
> space. Before the machine was rebooted I saw these messages:
> 
> Apr  8 13:11:08 x4 kernel: BUG: Bad rss-counter state mm:ffff88020813c380 idx:1 val:-1
> Apr  8 13:11:08 x4 kernel: BUG: Bad rss-counter state mm:ffff88020813c380 idx:2 val:1
> Apr  8 13:11:08 x4 kernel: BUG: Bad rss-counter state mm:ffff88021503bb80 idx:1 val:-1
> Apr  8 13:11:08 x4 kernel: BUG: Bad rss-counter state mm:ffff8801fb643b80 idx:1 val:-1
> Apr  8 13:11:08 x4 kernel: BUG: Bad rss-counter state mm:ffff8801fb643b80 idx:2 val:1
> Apr  8 13:11:08 x4 kernel: BUG: Bad rss-counter state mm:ffff88021503bb80 idx:2 val:1
> Apr  8 13:11:08 x4 kernel: BUG: Bad rss-counter state mm:ffff88020a4ff800 idx:1 val:-1
> Apr  8 13:11:08 x4 kernel: BUG: Bad rss-counter state mm:ffff88020a4ff800 idx:2 val:1
> Apr  8 13:11:08 x4 kernel: BUG: Bad rss-counter state mm:ffff88020813ce00 idx:1 val:-1
> Apr  8 13:11:08 x4 kernel: BUG: Bad rss-counter state mm:ffff88020813ce00 idx:2 val:1
> Apr  8 13:11:08 x4 kernel: BUG: Bad rss-counter state mm:ffff8801fadda680 idx:1 val:-1
> Apr  8 13:11:08 x4 kernel: BUG: Bad rss-counter state mm:ffff8801fadda680 idx:2 val:1

BTW, I'm not the only one that sees these messages. Here are two more
reports from Ubuntu beta testers:

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/963672
BUG: Bad rss-counter state mm:ffff88022107fb80 idx:1 val:-14
BUG: Bad rss-counter state mm:ffff88022107fb80 idx:2 val:14


https://bugs.launchpad.net/ubuntu/+source/linux/+bug/965709
BUG: Bad rss-counter state mm:c8fd9dc0 idx:1 val:-2
BUG: Bad rss-counter state mm:c8fd9dc0 idx:2 val:2
usb 5-1: USB disconnect, device number 2
usb 5-1: new low-speed USB device number 3 using uhci_hcd
input: Mega World Thrustmaster dual analog 3.2 as
/devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/input/input13
generic-usb 0003:044F:B315.0004: input,hidraw1: USB HID v1.10 Gamepad
[Mega World Thrustmaster dual analog 3.2] on usb-0000:00:1d.0-1/input0
BUG: Bad rss-counter state mm:c8fd9dc0 idx:1 val:-2
BUG: Bad rss-counter state mm:c8fd9dc0 idx:2 val:2
BUG: Bad rss-counter state mm:dea3cc40 idx:1 val:-1
BUG: Bad rss-counter state mm:dea3cc40 idx:2 val:1

The pattern seem to be:
... idx:1 val:-x
... idx:2 val:x
for x=1,2,14

-- 
Markus

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

* BUG: Bad rss-counter state
@ 2012-06-15 19:19 Ralf Hildebrandt
  0 siblings, 0 replies; 7+ messages in thread
From: Ralf Hildebrandt @ 2012-06-15 19:19 UTC (permalink / raw)
  To: linux-kernel

With 3.4.2, I got a few of those:

# fgrep -1 "BUG: Bad rss-counter state" kern.log
Jun 10 17:35:57 mail kernel: [436940.510027] BUG: Bad rss-counter state mm:f09c8700 idx:1 val:-2
Jun 10 17:35:57 mail kernel: [436940.510044] BUG: Bad rss-counter state mm:f09c8700 idx:2 val:2

Jun 14 08:52:09 mail kernel: [314161.698470] BUG: Bad rss-counter state mm:f052c700 idx:1 val:-4
Jun 14 08:52:09 mail kernel: [314161.698487] BUG: Bad rss-counter state mm:f052c700 idx:2 val:4

-- 
Ralf Hildebrandt                   Charite Universitätsmedizin Berlin
ralf.hildebrandt@charite.de        Campus Benjamin Franklin
http://www.charite.de              Hindenburgdamm 30, 12203 Berlin
Geschäftsbereich IT, Abt. Netzwerk fon: +49-30-450.570.155

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

* BUG: Bad rss-counter state
@ 2012-06-20 19:49 Nick Bowler
  2012-06-21  9:50 ` Michal Hocko
  0 siblings, 1 reply; 7+ messages in thread
From: Nick Bowler @ 2012-06-20 19:49 UTC (permalink / raw)
  To: linux-kernel

Hi folks,

I just noticed the following couple lines in my kernel log for Linux
3.4.2:

  Jun 20 14:57:54 emergent kernel: BUG: Bad rss-counter state mm:ffff88000ff1f400 idx:1 val:-2
  Jun 20 14:57:54 emergent kernel: BUG: Bad rss-counter state mm:ffff88000ff1f400 idx:2 val:2

I have no idea what these messages mean, nor what I was doing exactly
at 14:57:54 today, nor whether they've been fixed in newer kernels.
Regardless, they appear to be telling me that there's a kernel problem
since they contain the word "BUG", so I figured I had better report them
nonetheless.  Other than the fact that these messages were printed, the
system is operating normally.

This happened about a week after bootup, so it's probably not easy to
reproduce.

Let me know if you need any more info,
-- 
Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/)


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

* Re: BUG: Bad rss-counter state
  2012-06-20 19:49 BUG: Bad rss-counter state Nick Bowler
@ 2012-06-21  9:50 ` Michal Hocko
  2012-06-21 13:31   ` Nick Bowler
  0 siblings, 1 reply; 7+ messages in thread
From: Michal Hocko @ 2012-06-21  9:50 UTC (permalink / raw)
  To: Nick Bowler; +Cc: linux-kernel

On Wed 20-06-12 15:49:08, Nick Bowler wrote:
> Hi folks,
> 
> I just noticed the following couple lines in my kernel log for Linux
> 3.4.2:
> 
>   Jun 20 14:57:54 emergent kernel: BUG: Bad rss-counter state mm:ffff88000ff1f400 idx:1 val:-2
>   Jun 20 14:57:54 emergent kernel: BUG: Bad rss-counter state mm:ffff88000ff1f400 idx:2 val:2
> 
> I have no idea what these messages mean, nor what I was doing exactly
> at 14:57:54 today, nor whether they've been fixed in newer kernels.
> Regardless, they appear to be telling me that there's a kernel problem
> since they contain the word "BUG", so I figured I had better report them
> nonetheless.  Other than the fact that these messages were printed, the
> system is operating normally.

The issue is known and the fix can be found at
https://lkml.org/lkml/2012/6/9/47
 
> This happened about a week after bootup, so it's probably not easy to
> reproduce.
> 
> Let me know if you need any more info,
> -- 
> Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/)
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9    
Czech Republic

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

* Re: BUG: Bad rss-counter state
  2012-06-21  9:50 ` Michal Hocko
@ 2012-06-21 13:31   ` Nick Bowler
  0 siblings, 0 replies; 7+ messages in thread
From: Nick Bowler @ 2012-06-21 13:31 UTC (permalink / raw)
  To: Michal Hocko; +Cc: linux-kernel

On 2012-06-21 11:50 +0200, Michal Hocko wrote:
> On Wed 20-06-12 15:49:08, Nick Bowler wrote:
> > Hi folks,
> > 
> > I just noticed the following couple lines in my kernel log for Linux
> > 3.4.2:
> > 
> >   Jun 20 14:57:54 emergent kernel: BUG: Bad rss-counter state mm:ffff88000ff1f400 idx:1 val:-2
> >   Jun 20 14:57:54 emergent kernel: BUG: Bad rss-counter state mm:ffff88000ff1f400 idx:2 val:2
> > 
> > I have no idea what these messages mean, nor what I was doing exactly
> > at 14:57:54 today, nor whether they've been fixed in newer kernels.
> > Regardless, they appear to be telling me that there's a kernel problem
> > since they contain the word "BUG", so I figured I had better report them
> > nonetheless.  Other than the fact that these messages were printed, the
> > system is operating normally.
> 
> The issue is known and the fix can be found at
> https://lkml.org/lkml/2012/6/9/47

Ah, and it appears to have been merged by Linus yesterday.

Thanks,
-- 
Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/)


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

* BUG: Bad rss-counter state
@ 2024-03-16  4:48 cheung wall
  0 siblings, 0 replies; 7+ messages in thread
From: cheung wall @ 2024-03-16  4:48 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot
  Cc: Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
	Daniel Bristot de Oliveira, Valentin Schneider, linux-kernel

Hello,

when using Healer to fuzz the latest Linux Kernel, the following crash

was triggered on:


HEAD commit: e8f897f4afef0031fe618a8e94127a0934896aba  (tag: v6.8)

git tree: upstream

console output: https://pastebin.com/raw/KYUZrCEa

kernel config: https://pastebin.com/raw/Qa9fj2Ev

C reproducer: https://pastebin.com/raw/pW0J23UU

Syzlang reproducer: https://pastebin.com/raw/8bJrsXLY

If you fix this issue, please add the following tag to the commit:

Reported-by: Qiang Zhang <zzqq0103.hey@gmail.com>

----------------------------------------------------------

general protection fault, probably for non-canonical address
0xdffffc0000000000: 0000 [#6] PREEMPT SMP KASAN NOPTI
RIP: 0010:__wake_up_common+0x6f/0x1d0 kernel/sched/wait.c:85
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
Code: 00 00 48 8b 5b 08 4c 8d 6b e8 48 3b 1c 24 0f 84 07 01 00 00 e8
f2 ba 1d 00 48 89 da 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c
02 00 0f 85 2d 01 00 00 48 bd 00 00 00 00 00 fc ff df 48 8b
CPU: 2 PID: 137 Comm: systemd-udevd Tainted: G      D            6.8.0 #1
RSP: 0018:ffff88810409fb40 EFLAGS: 00010056
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014

RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff8268aa3e
RIP: 0010:__wake_up_common+0x6f/0x1d0 kernel/sched/wait.c:85
RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff888100c9c320
Code: 00 00 48 8b 5b 08 4c 8d 6b e8 48 3b 1c 24 0f 84 07 01 00 00 e8
f2 ba 1d 00 48 89 da 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c
02 00 0f 85 2d 01 00 00 48 bd 00 00 00 00 00 fc ff df 48 8b
RBP: ffff888100c9c320 R08: 0000000000000000 R09: ffffed1020813f63
RSP: 0018:ffff888103537b40 EFLAGS: 00010056
R10: 0000000000000001 R11: ffff88811b238a20 R12: 0000000000000001

RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff8268aa3e
R13: ffffffffffffffe8 R14: 0000000000000000 R15: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff888100c99320
FS:  0000000000000000(0000) GS:ffff88811af00000(0000) knlGS:0000000000000000
RBP: ffff888100c99320 R08: 0000000000000000 R09: ffffed10206a6f63
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
R10: 0000000000000001 R11: ffff88811b038a20 R12: 0000000000000001
CR2: 0000562ccdf55168 CR3: 00000000856aa006 CR4: 0000000000770ef0
R13: ffffffffffffffe8 R14: 0000000000000000 R15: 0000000000000000
PKRU: 55555554
FS:  0000000000000000(0000) GS:ffff88811b000000(0000) knlGS:0000000000000000
note: systemd-udevd[138] exited with irqs disabled
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
note: systemd-udevd[138] exited with preempt_count 1
CR2: 0000562ccdf55168 CR3: 0000000104a44004 CR4: 0000000000770ef0
Fixing recursive fault but reboot is needed!
PKRU: 55555554
Call Trace:
 <TASK>
 __wake_up_common_lock kernel/sched/wait.c:106 [inline]
 __wake_up+0x39/0x60 kernel/sched/wait.c:127
 netlink_release+0x86a/0x1610 net/netlink/af_netlink.c:785
 __sock_release+0xb3/0x270 net/socket.c:659
 sock_close+0x19/0x30 net/socket.c:1421
 __fput+0x265/0xb70 fs/file_table.c:376
 task_work_run+0x16d/0x250 kernel/task_work.c:180
 exit_task_work include/linux/task_work.h:38 [inline]
 do_exit+0xa2d/0x2670 kernel/exit.c:871
 do_group_exit+0xc8/0x280 kernel/exit.c:1020
 __do_sys_exit_group kernel/exit.c:1031 [inline]
 __se_sys_exit_group kernel/exit.c:1029 [inline]
 __x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1029
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xb3/0x1b0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x6f/0x77
RIP: 0033:0x7f15f7c24bd9
Code: Unable to access opcode bytes at 0x7f15f7c24baf.
RSP: 002b:00007ffdba06ac38 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f15f7c24bd9
RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000000
RBP: 0000562ccd6f6270 R08: fffffffffffffe00 R09: 0000000000000004
R10: 0000000000000018 R11: 0000000000000202 R12: 0000562ccdf68ec0
R13: 0000562ccdf74f20 R14: 00007ffdba06acb0 R15: 0000562ccdf69720
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:__wake_up_common+0x6f/0x1d0 kernel/sched/wait.c:85
Code: 00 00 48 8b 5b 08 4c 8d 6b e8 48 3b 1c 24 0f 84 07 01 00 00 e8
f2 ba 1d 00 48 89 da 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c
02 00 0f 85 2d 01 00 00 48 bd 00 00 00 00 00 fc ff df 48 8b
RSP: 0018:ffff88810409fb40 EFLAGS: 00010056
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff8268aa3e
RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff888100c9c320
RBP: ffff888100c9c320 R08: 0000000000000000 R09: ffffed1020813f63
R10: 0000000000000001 R11: ffff88811b238a20 R12: 0000000000000001
R13: ffffffffffffffe8 R14: 0000000000000000 R15: 0000000000000000
FS:  0000000000000000(0000) GS:ffff88811b000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000562ccdf55168 CR3: 0000000104a44004 CR4: 0000000000770ef0
PKRU: 55555554
note: systemd-udevd[137] exited with irqs disabled
note: systemd-udevd[137] exited with preempt_count 1
Fixing recursive fault but reboot is needed!
BUG: scheduling while atomic: systemd-udevd/137/0x00000000
Modules linked in:
CPU: 2 PID: 137 Comm: systemd-udevd Tainted: G      D            6.8.0 #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x72/0xa0 lib/dump_stack.c:106
 __schedule_bug+0xc1/0x100 kernel/sched/core.c:5943
 schedule_debug kernel/sched/core.c:5970 [inline]
 __schedule+0x1bf3/0x2460 kernel/sched/core.c:6620
 do_task_dead+0xa4/0xc0 kernel/sched/core.c:6743
 make_task_dead+0x378/0x3c0 kernel/exit.c:979
 rewind_stack_and_make_dead+0x17/0x20 arch/x86/entry/entry_64.S:1494
RIP: 0033:0x7f15f7c24bd9
Code: Unable to access opcode bytes at 0x7f15f7c24baf.
RSP: 002b:00007ffdba06ac38 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f15f7c24bd9
RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000000
RBP: 0000562ccd6f6270 R08: fffffffffffffe00 R09: 0000000000000004
R10: 0000000000000018 R11: 0000000000000202 R12: 0000562ccdf68ec0
R13: 0000562ccdf74f20 R14: 00007ffdba06acb0 R15: 0000562ccdf69720
 </TASK>
ata1: found unknown device (class 0)
program syz-executor124 is using a deprecated SCSI ioctl, please
convert it to SG_IO
ata1: found unknown device (class 0)
program syz-executor124 is using a deprecated SCSI ioctl, please
convert it to SG_IO
----------------
Code disassembly (best guess):
   0: 00 00                add    %al,(%rax)
   2: 48 8b 5b 08          mov    0x8(%rbx),%rbx
   6: 4c 8d 6b e8          lea    -0x18(%rbx),%r13
   a: 48 3b 1c 24          cmp    (%rsp),%rbx
   e: 0f 84 07 01 00 00    je     0x11b
  14: e8 f2 ba 1d 00        call   0x1dbb0b
  19: 48 89 da              mov    %rbx,%rdx
  1c: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
  23: fc ff df
  26: 48 c1 ea 03          shr    $0x3,%rdx
* 2a: 80 3c 02 00          cmpb   $0x0,(%rdx,%rax,1) <-- trapping instruction
  2e: 0f 85 2d 01 00 00    jne    0x161
  34: 48 bd 00 00 00 00 00 movabs $0xdffffc0000000000,%rbp
  3b: fc ff df
  3e: 48                    rex.W
  3f: 8b                    .byte 0x8b

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

end of thread, other threads:[~2024-03-16  4:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-20 19:49 BUG: Bad rss-counter state Nick Bowler
2012-06-21  9:50 ` Michal Hocko
2012-06-21 13:31   ` Nick Bowler
  -- strict thread matches above, loose matches on Subject: below --
2024-03-16  4:48 cheung wall
2012-06-15 19:19 Ralf Hildebrandt
2012-04-08 11:39 Markus Trippelsdorf
2012-04-09  5:58 ` Markus Trippelsdorf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).