1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Kernel Dumping & Debugging it

Discussion in 'FreeBSD Development' started by Nikhil123, Nov 9, 2011.

  1. Nikhil123

    Nikhil123 New Member

    Messages:
    5
    Likes Received:
    0
    Hello,

    OS: FreeBSD

    Kernel has some problem and I have used DB debbuger and it halts there when I panic(reboot) I get a message
    Code:
    Cannot Dump. Device not defined or unavailable
    I need a way to get the dump of kernel for debugging the problem. Here is a reference to how to do it: http://www.freebsd.org/doc/en/books/developers-handbook/kerneldebug.html. But I am not getting exactly what has to be done.

    Can anyone help me with set of commands and tell me clearly what has to be done?

    --
    Thanks & Regards
    Nikhil Kathare
     
  2. SirDice

    SirDice Moderator Staff Member Moderator

    Messages:
    17,365
    Likes Received:
    0
  3. Dies_Irae

    Dies_Irae New Member

    Messages:
    93
    Likes Received:
    0
    To obtain a kernel dump you have to add these lines to your /etc/rc.conf:
    Code:
    dumpdev="AUTO"
    dumpdir="/var/crash"
    
    From dumpon(8):
    From savecore(8):
    In practice:

    The dumpon(8) utility saves a dump of the memory in the dumpdev device (usually a swap device - if "AUTO" the system use the first configured swap device)

    The savecore(8) utility extracts the image of your (previously) running kernel from dumpdev and saves the image in dumpdir.

    You don't have to run these programs by hand. When your kernel panics, on next reboot they are automatically executed.

    Next, you should follow the instructions in the Developers Handbook.
     
  4. Nikhil123

    Nikhil123 New Member

    Messages:
    5
    Likes Received:
    0
    I have done all as you said earlier also and now also tried it once again, but I am not getting the kernel dump. After panic it is displaying message
    Code:
    Cannot dump. Device not defined or Unavailable
    As you said
    <if "AUTO" the system use the first configured swap device>
    Then where do I find this swap device? Or how shall I create this device?

    My fstab details are as below:

    Code:
    #Device      MountPoint    Fstype  Options    Dump   Pass#
    /dev/da0s1b  none          swap    sw         0       0
    /dev/da0s1a  /             ufs     rw         1       1
    /dev/acd0    /cdrom        cd9660   ro,noauto 0       0
    
    --
    Thanks & Regards
     
  5. Dies_Irae

    Dies_Irae New Member

    Messages:
    93
    Likes Received:
    0
    It's in your /etc/fstab:

    So /dev/da0s1b is your swap device and if you have added these lines to your /etc/rc.conf:

    Code:
    dumpdev="AUTO"
    dumpdir="/var/crash"
    
    when your kernel panics you should found a file named vmcore.# (where "#" is a number starting from 0) in the /var/crash/ directory.

    [OT]You should properly format your posts: link[/OT]
     
  6. Nikhil123

    Nikhil123 New Member

    Messages:
    5
    Likes Received:
    0
    Hello Dies,

    Thanks for reply, I have done all these steps even then I am not able to get the kernel dump. When booting it restarts continuosly and at last i get messages like:
    Code:
    Cannot Dump. Device not defined or unavailable
    I rebooted through old kernel and made all the changes like you had told me but the same problem persists, and the new kernel will be booting automatically continuously and lastly it gives message like
    Code:
    Cannot Dump. Device not defined or unavailable
    What should be done for that?

    --
    Thanks & Regards
     
  7. Dies_Irae

    Dies_Irae New Member

    Messages:
    93
    Likes Received:
    0
    Are you sure your dump device (swap) is big enough?

    From dumpon(8):

     
  8. Nikhil123

    Nikhil123 New Member

    Messages:
    5
    Likes Received:
    0
    Hi Dies,

    Physical memory : Are you talking about size of physical data or the total physical memory size?

    If the actual physical memory your talking then its not fair to create a swap memory greater then the physical memory.Even then tell me how to check size of physical memory and swap and increase size of swap.

    If no then my swap is large enough to hold the data on physical memory.

    --
    Regards