dwarves.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Brain fart alert
@ 2012-07-21 18:22 Nicolas
       [not found] ` <CACHCVZ6oDyFwGbC4EwF_wsR9tCkoych5N6buLhRRLcyaL6iifw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 20+ messages in thread
From: Nicolas @ 2012-07-21 18:22 UTC (permalink / raw)
  To: dwarves-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 687 bytes --]

Hello,

I tried using pahole, but I get a brain fart alert with the file
attached (which is an extract from stdio.h). I'm running dwarves 1.10,
libdw1 0.152 and g++ 4.6.1, on i386.

Here is what I get:

$ g++ -Wall -g -c brainfart.cpp -o brainfart.o && pahole brainfart.o
class ios_base {
	enum _Ios_Openmodeconst    in;                   /*     0     4 */
	typedef enum _Ios_Fmtflags fmtflags;


	/* size: 1, cachelines: 1, members: 1 */
	/* padding: 65533 */
	/* last cacheline: 1 bytes */

	/* BRAIN FART ALERT! 1 != 4 + 0(holes), diff = -3 */

};

Moreover, on amd64, pahole segfaults if I do the same (with dwarves
1.10, libdw1 0.152, g++ 4.6.3).

Any ideas?

Thanks a lot,
Nicolas

[-- Attachment #2: brainfart.cpp --]
[-- Type: text/x-c++src, Size: 289 bytes --]

namespace std
{
  enum _Ios_Fmtflags
    {
      a = 1,
    };
  enum _Ios_Openmode
    {
      _S_in = 1L << 3,
    };
  class ios_base
  {
  public:
    typedef _Ios_Fmtflags fmtflags;
    static const _Ios_Openmode in = _S_in;
  };
  void setiosflags(ios_base::fmtflags __mask)  {  }
}

^ permalink raw reply	[flat|nested] 20+ messages in thread
* Brain fart alert
@ 2015-11-11 18:26 David Sterba
       [not found] ` <20151111182618.GF6445-AlSwsSmVLrQ@public.gmane.org>
  0 siblings, 1 reply; 20+ messages in thread
From: David Sterba @ 2015-11-11 18:26 UTC (permalink / raw)
  To: dwarves-u79uwXL29TY76Z2rM5mHXA

Hi,

with current git version 1.10 (79536f4f9587703c7136d2654824630689880f5c):

struct btrfs_path {
        struct extent_buffer *     nodes[8];             /*     0    64 */
        /* --- cacheline 1 boundary (64 bytes) --- */
        int                        slots[8];             /*    64    32 */
        int                        locks[8];             /*    96    32 */
        /* --- cacheline 2 boundary (128 bytes) --- */
        u8                         reada;                /*   128     1 */
        u8                         lowest_level;         /*   129     1 */

        /* Bitfield combined with previous fields */

        unsigned int               search_for_split:1;   /*   128:15  4 */
        unsigned int               keep_locks:1;         /*   128:14  4 */
        unsigned int               skip_locking:1;       /*   128:13  4 */
        unsigned int               leave_spinning:1;     /*   128:12  4 */
        unsigned int               search_commit_root:1; /*   128:11  4 */
        unsigned int               need_commit_sem:1;    /*   128:10  4 */
        unsigned int               skip_release_on_error:1; /*   128: 9  4 */

        /* size: 136, cachelines: 3, members: 12 */
        /* padding: 4 */
        /* bit_padding: 25 bits */
        /* last cacheline: 8 bytes */

        /* BRAIN FART ALERT! 136 != 136 + 0(holes), diff = 0 */

};

Looks like it's the bitfield combining.

$ gcc --version
gcc (SUSE Linux) 4.5.1 20101208 [gcc-4_5-branch revision 167585]

binutils-2.23.2

Let me know if you need more information.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe dwarves" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2015-11-11 22:48 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-21 18:22 Brain fart alert Nicolas
     [not found] ` <CACHCVZ6oDyFwGbC4EwF_wsR9tCkoych5N6buLhRRLcyaL6iifw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-08-15 17:56   ` Arnaldo Carvalho de Melo
     [not found]     ` <20120815175647.GK2370-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2012-08-16 19:52       ` Arnaldo Carvalho de Melo
     [not found]         ` <20120816195224.GC10277-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2012-08-19 22:16           ` Mark Wielaard
2012-08-20 13:45         ` Dodji Seketeli
     [not found]           ` <m3obm5fzhs.fsf-fIDRvF7C5exg9hUCZPvPmw@public.gmane.org>
2012-08-20 17:35             ` Arnaldo Carvalho de Melo
2012-08-20 18:02   ` Arnaldo Carvalho de Melo
     [not found]     ` <20120820180216.GE3046-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2012-08-20 18:28       ` Arnaldo Carvalho de Melo
2012-08-30 16:35       ` Nicolas
     [not found]         ` <CACHCVZ5EJadxOTJ0T4phSfAcm1FK7wfeDTp9QcSa1V1JCpa8SA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-09-03 12:22           ` Mark Wielaard
     [not found]             ` <1346674948.3090.40.camel-OO0OHOuVXW89n/EXqpbZ8ns8WZQLr0HW@public.gmane.org>
2012-09-24 22:19               ` Nicolas
     [not found]                 ` <5060DC56.4080609-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-02-26  1:50                   ` Nicolas
     [not found]                     ` <CACHCVZ6uvDW1CpyxXio3P17EL6bE=FKGDNm11RNZTceR-dWLjg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-26 10:56                       ` Mark Wielaard
     [not found]                         ` <1361876163.4930.4.camel-Et2QWsRS+g7yukXOleVwRPp4M6BF03vq@public.gmane.org>
2013-03-20 13:37                           ` Arnaldo Carvalho de Melo
2015-11-11 18:26 David Sterba
     [not found] ` <20151111182618.GF6445-AlSwsSmVLrQ@public.gmane.org>
2015-11-11 20:11   ` Arnaldo Carvalho de Melo
     [not found]     ` <20151111201151.GA6712-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2015-11-11 21:05       ` David Sterba
     [not found]         ` <20151111210519.GG6445-AlSwsSmVLrQ@public.gmane.org>
2015-11-11 22:13           ` Arnaldo Carvalho de Melo
     [not found]             ` <20151111221340.GB12579-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2015-11-11 22:17               ` Arnaldo Carvalho de Melo
     [not found]                 ` <20151111221747.GC12579-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2015-11-11 22:48                   ` Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).