Debugging memory allocation crash

contemplating zombie contemplatingzombie at gmail.com
Wed Dec 28 23:27:32 EST 2011


Hi,

I have written a kernel module that does frequent memory allocs,
reallocs and deallocs. The code randomly crashes at one of the two
memory allocation parts - either in krealloc() or in
kmem_cache_alloc_notrace (called by kmalloc()). However, when I
analyzed both the crash points instructions using gdb, they both
turned out to be at the same location in slab_alloc(). I have tried to
debug by carefully inspecting the trace dump and my code. However, I
am not able identify the problem. All that I get in the trace dump is
"general protection fault: 0000 [#1] SMP". There is one more of this
message and then the machine just hangs and I have to reboot it (I
think any 3 successive general protection faults requires a reboot).

Is there some way that I can debug this problem?

-ctmzb



More information about the Kernelnewbies mailing list