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

Dave Anderson anderson at redhat.com
Wed Apr 11 15:01:55 UTC 2012



----- Original Message -----
> Sorry, I made some mistake.
> 
> At 2012-4-11 17:06, qiaonuohan wrote:
> >
> > what is struct nsproxy? Or is there any symbol referring to ipc_ns?
> 
> I want to know how does the kernel get struct ipc_ids. the previous and
> the hind kernel uses current->nsproxy->ipc_ns to get the pointer to
> struct ipc_namespace and then use a macro shm_ids to get struct ipc_ids.
> What about this kernel?

It does the same thing.  But in the failure case, it appears that the
task_struct.nsproxy pointer that you are using is NULL:

> >
> > (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()
> >>
> >
> > what is struct ipc_id? And what is entries in struct ipc_id or something
> > similar to it?
> 
> I mean struct ipc_ids, not ipc_id.

RHEL4/linux-2.6.9:

 crash> ipc_ids
 struct ipc_ids {
     int size;
     int in_use;
     int max_id;
     short unsigned int seq;
     short unsigned int seq_max;
     struct semaphore sem;
     struct ipc_id *entries;
 }
 SIZE: 56
 crash> 

Dave




More information about the Crash-utility mailing list