[Crash-utility] Problem in command net -s

Karlsson, Jan Jan.Karlsson at sonyericsson.com
Thu Jan 26 11:49:44 UTC 2012


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.

Jan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20120126/227ad243/attachment.htm>


More information about the Crash-utility mailing list