[Crash-utility] Problem in command net -s

Dave Anderson anderson at redhat.com
Thu Jan 26 13:47:22 UTC 2012



----- Original Message -----
> 
> 
> 
> 
> Hi Dave
> 
> I found a problem with the net -s command. It concerns line 1451 in net.c
> 
> struct_socket = inode - SIZE(socket);
> 
> As I understand it we have the type
> 
> struct socket_alloc {
>    struct socket socket;
>    struct inode vfs_inode;
> }
> 
> and we have the address of the second field and want the address of
> the first. The calculation, using the size of the socket struct,
> used in net.c require that the second field is aligned directly
> after the first field. This is unfortunately not true in cases I
> have seen. By changing the line 1451 to:
>
> struct_socket = inode - MEMBER_OFFSET("socket_alloc", "vfs_inode");
> 
> things work better.
> 
> Is this something you would like to change in Crash? I assume you
> will move the offset calculation to somewhere else so it is only
> performed once.

Probably so...  

Although I'm curious -- what kernel version do you see this on?  
It works as expected on RHEL5, RHEL6 and a Fedora 16 3.1.7-based
kernel.  What do you see when you do this:

  crash> socket_alloc -o
  struct socket_alloc {
      [0] struct socket socket;
     [48] struct inode vfs_inode; 
  }
  SIZE: 616
  crash> socket
  struct socket {
      socket_state state;
      short int type;
      long unsigned int flags;
      struct socket_wq *wq;
      struct file *file;
      struct sock *sk;
      const struct proto_ops *ops;
  }
  SIZE: 48
  crash>

And just for the changelog description, what havoc does it wreak?

Thanks,
  Dave 

 
> Jan
> 
> 
> --
> Crash-utility mailing list
> Crash-utility at redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility
> 




More information about the Crash-utility mailing list