6

I have some proprietary kernel module.
And suddenly my system crashed in kdb with such bug:

BUG: bad page state in process <kworker_name> pfn:37751
page:<page_address> count:-1 mapcount:0 mapping:00000000 index:0x0
...
page dumped because: nonzero _count

So how should one understand what exactly does it mean? Unfortunately I can't find any info in the Internet about this bug.
What does pfn:37751 and count:-1 mean? What conclusions can be drawn?
Sorry if obvious.

Marco Bonelli
  • 63,369
  • 21
  • 118
  • 128
budoattack
  • 379
  • 3
  • 11
  • 3
    **PFN** stands for *Page Frame Number*. Basically it's a page address in physical memory. – 0andriy Sep 01 '20 at 14:18
  • 1
    @0andriy thanks. Can `count:-1` indicate some double-free issue? – budoattack Sep 01 '20 at 14:19
  • I'm not an expert in Linux MM. Sorry. – 0andriy Sep 01 '20 at 14:19
  • 1
    To help debug the problem, try building the kernel with CONFIG_DEBUG_KERNEL and CONFIG_DEBUG_VM and maybe some other CONFIG_DEBUG_VM_* configuration options turned on. – Ian Abbott Sep 01 '20 at 15:13
  • I am facing a similar issue, I have allocated a buffer in kernel space and mapped to user space with remap_pfn_range(). On unmap(), I get this error. I have also observed this happens only when I allocate/map/unmap more than one page. Were you able to resolve this? – sham1810 Dec 05 '22 at 07:02

0 Answers0