kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: morfeas3000@gmail.com (NorthPole)
To: kernelnewbies@lists.kernelnewbies.org
Subject: geting weird semi-random panic on kmalloc
Date: Fri, 22 Jun 2012 03:50:49 +0300	[thread overview]
Message-ID: <CA+wR77rXxHwJ7dH_MHVg-p+mZhG7vGAyZA8sdePstv4333d9Dg@mail.gmail.com> (raw)

Hello everyone

I'm making my first steps in the linux kernel developpement by trying to
add some functionality in a kernel module
I have a problem that I cant seem to grasp and would greatly appreciate any
help.

I have this piece of code: http://pastebin.com/igP7255S
which is called by this:

for(i=0;i<250;i++)
registerTvlv(i,0x01,1,&batadv_ogm_packet->gw_flags,bat_priv,batadv_ogm_packet);


This is supposed to add 250 distinct tlvs in the list
batadv_ogm_packet->gw_flags is used both above and bellow the invocation
and the module doesnt crash
the same stands for these two bat_priv and batadv_ogm_packet

when I run the kernel code on an open-wrt build for x86 which is run
virtualized under a standard qemu running on debian squeeze produces this
output
http://pastebin.com/tY3Vkzvw
(in short it prints everything as its supposed to do for a random number of
iterations between 3 and 24 and the the kernel oops happens)

But i cant understand why the problem seems to happen at the kmalloc line
(havent figured how to use gdb for open wrt kernel debugging yet so i'm
relying on  printk for debugging)


the qemu instance loads with these setings

screen qemu\
-no-acpi -m 128M \
-net vde,sock=num1.ctl,port=1 -net nic,macaddr=fe:fe:00:00:01:01 \
-net nic -net tap,ifname=tapwrt1,script=no,downscript=no \
-nographic \
num1.image

Thank you for your time and answers

Spyros
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120622/995f127e/attachment.html 

             reply	other threads:[~2012-06-22  0:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-22  0:50 NorthPole [this message]
2012-06-22 11:55 ` geting weird semi-random panic on kmalloc Jonathan Neuschäfer
2012-06-22 12:06   ` NorthPole
2012-06-22 16:18 ` Mulyadi Santosa
2012-06-22 16:27   ` NorthPole
2012-06-22 16:49     ` Mulyadi Santosa
2012-06-25 23:22       ` NorthPole
2012-06-26  4:31         ` Mulyadi Santosa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+wR77rXxHwJ7dH_MHVg-p+mZhG7vGAyZA8sdePstv4333d9Dg@mail.gmail.com \
    --to=morfeas3000@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).