Re: kmalloc and other memory allocation failures.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Something looks really bad. Can you send us your full, buildable,
source code ?

I've produced a very trimmed down module that exhibits the same symptoms (works fine under 2..6.13, blows up on 2.6.20 and 2.6.22). I'm becoming more convinced it has something to do with the MMU and or how the memory is allocated throughout the system (something set wrong in the kernel .config)

Source:

/* Kernel includes */
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/mm.h>

MODULE_LICENSE("GPL");

#include <linux/kernel.h>
#include <asm/string.h>
#include <linux/errno.h>
#include <linux/fs.h>
#include <asm/io.h>
#include <asm/uaccess.h>

static int sysmon_init(void)
{

  void *memBuf;

  if((void *)NULL == (memBuf = kmalloc(4096, GFP_KERNEL)))
    printk (KERN_ERR "cannot malloc\n");

  return 0;
}

static void sysmon_exit()
{
}


module_init (sysmon_init);
module_exit (sysmon_exit);



The Errors upon loading:

BUG: unable to handle kernel paging request at virtual address 00006b80
printing eip:
c015369c
*pde = 00000000
Oops: 0000 [#1]
PREEMPT
Modules linked in: systest
CPU:    0
EIP:    0060:[<c015369c>]    Not tainted VLI
EFLAGS: 00010006   (2.6.22.1 #4)
EIP is at kmem_cache_alloc+0x21/0x56
eax: 00000000   ebx: 00000282   ecx: 00000000   edx: 00006b74
esi: d0015000   edi: d0015015   ebp: ffffffff   esp: cf6eef68
ds: 007b   es: 007b   fs: 0000  gs: 0000  ss: 0068
Process insmod (pid: 479, ti=cf6ee000 task=ce41f080 task.ti=cf6ee000)
Stack: 00000000 00000000 d0015460 b7f2ae58 b7f4988c cf6eef9c d0015015 c0444270 000000d0 b7f4988c cf6ee000 c01220ce ffffffff cf6ee000 c01331f6 b7f30000 b7f30000 b7f30000 b7f2ae58 c0103cbe b7f30000 0000356a 0804a008 b7f2ae58
Call Trace:
[<d0015015>] sysmon_init+0x15/0x34 [systest]
[<c01220ce>] blocking_notifier_call_chain+0x17/0x1a
[<c01331f6>] sys_init_module+0x89/0x133
[<c0103cbe>] syscall_call+0x7/0xb
=======================
Code: 89 f0 83 c4 0c 5b 5e 5f 5d c3 55 57 56 53 51 51 89 c6 89 d5 8b 7c 24 18 9c 5b fa e8 9f 7a 09 00 8b 94 86 a8 00 00 00 85 d2 74 07 <8b> 42 0c 85 c0 75 17 89 54 24 04 83 c9 ff 89 ea 89 f0 89 3c 24
EIP: [<c015369c>] kmem_cache_alloc+0x21/0x56 SS:ESP 0068:cf6eef68

Sincerly,

Thomas

[1] http://lxr.free-electrons.com/source/include/asm-i386/string.h#043
--
Thomas Petazzoni - thomas.petazzoni@xxxxxxxx
http://{thomas,sos,kos}.enix.org - http://www.toulibre.org
http://www.{livret,agenda}dulibre.org

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux