[issue12181] SIGBUS error on OpenBSD (sparc64)

Charles-François Natali report at bugs.python.org
Thu May 26 19:47:43 CEST 2011


Charles-François Natali <neologix at free.fr> added the comment:

> ident and data are not pointers,

That's not the point.
struct kevent declaration should be the following:

struct kevent {
        uintptr_t ident;        /* identifier for this event */
        short     filter;       /* filter for event */
        u_short   flags;        /* action flags for kqueue */
        u_int     fflags;       /* filter flag value */
        intptr_t  data;         /* filter data value */
        void      *udata;       /* opaque user data identifier */
};

If this doesn't match, you'll unpack garbage when extracting members,
and since it's an unaligned access, you can even get a SIGBUS (looks
like sparc64 doesn't allow unaligned access).

> I suppose that T_UINT and T_INT should be used instead of T_UINTPTR_T and  T_INTPTR_T.

Yes, we could do that on OpenBSD, but that's definitely an OpenBSD bug.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12181>
_______________________________________


More information about the Python-bugs-list mailing list