[Crash-utility] [PATCH] add a new command: ipcs

Dave Anderson anderson at redhat.com
Tue Apr 10 19:20:46 UTC 2012



----- Original Message -----
> Hello Dave,
> 
> I did some effort to change the patch. Now it can support all of the
> three facilitis. I also check the kernel from 2.6.18 and up to find the
> bugs and fix it. So please refer to the attachment.
> 
> --
> --
> Regards
> Qiao Nuohan

Hello Qiao,

First, I don't understand why you dropped the shmid_kernel address
display from the shared memory output?  I only requested that you drop
the *inode* address -- because it could be ascertained from the shmid_kernel
structure.  

In most crash commands, the relevant "head" data structure address
is displayed, along with a few other key values.  The data structure
addresses are important for kernel debugging -- with your output, 
statistics are dumped, but if the user actually needed to debug the
IPC facility, there would be no "starting point" kernel virtual address
to work from. 

That being the case, the shared memory output should show the 
"shmid_kernel" address, the semaphore output should show the 
"sem_array" address, and the message queue output should show the
"msg_queue" address.  They should be shown in the first column of
each display (similar to the SHMID_KERNEL you showed in your first
patch) and the output restricted to 80 columns.

Secondly, with respect to testing it against my sample set of kernels, 
these are the errors that I still see:

(a) On these kernel versions:

    2.6.9-89.ELxenU
    2.6.15-1.2054_FC5
    2.6.16.33-xen
    2.6.18-1.2714.el5xen
    2.6.18-36.el5xen
    2.6.18-58.el5xen
    2.6.18-152.el5xen
    2.6.31 uniprocessor kernel
  
    the command fails immediatedly with this error:
  
      ipcs: cannot resolve "hugetlbfs_file_operations"
  

(b) On *all* RHEL5 2.6.18-era kernels, the message queue display 
    always fails like this: 

    ------ Message Queues --------
    KEY        MSQID      UID        PERMS      USED-BYTES   MESSAGES
    ipcs: invalid structure member offset: kern_ipc_perm_id
          FILE: ipcs.c  LINE: 899  FUNCTION: get_msg_info()


(c) On this 2.6.36-0.16.rc3.git0.fc15 Fedora kernel, it shows:

    ------ Shared Memory Segments ------
    KEY        SHMID      UID        PERMS      BYTES      NATTCH     STATUS
    ipcs: invalid kernel virtual address: 10  type: "nsproxy.ipc_ns"


(d) On *all* RHEL4 2.6.9-era and SLES9 2.6.5-era kernels, the command fail like this:

    ------ Shared Memory Segments ------
    KEY        SHMID      UID        PERMS      BYTES      NATTCH     STATUS
    ipcs: invalid structure member offset: ipc_id_ary_p
          FILE: ipcs.c  LINE: 540  FUNCTION: ipc_search_array()
  
    or this:
  
    ------ Shared Memory Segments ------
    KEY        SHMID      UID        PERMS      BYTES      NATTCH     STATUS
    (none allocated)------ Semaphore Arrays --------
    KEY        SEMID      UID        PERMS      NSEMS
    ipcs: invalid structure member offset: ipc_id_ary_p
          FILE: ipcs.c  LINE: 540  FUNCTION: ipc_search_array()
  

It would be preferable if you could support all 2.6-era kernels, but if not,
the command should handle them more gracefully by pre-verifying the offsets
before using them, and if they are invalid, then use the option_not_supported()
routine.  

Thanks,
  Dave




More information about the Crash-utility mailing list