GNU bug report logs - #20756
25.0.50; struct selection_input_event data might be corrupted by assignments as another structure type

Previous Next

Package: emacs;

Reported by: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>

Date: Sun, 7 Jun 2015 08:14:01 UTC

Severity: normal

Tags: fixed

Found in version 25.0.50

Done: Noam Postavsky <npostavs <at> users.sourceforge.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 17026 <at> debbugs.gnu.org, 13486 <at> debbugs.gnu.org, 20756 <at> debbugs.gnu.org
Subject: bug#20756: 25.0.50; struct selection_input_event data might be corrupted by assignments as another structure type
Date: Wed, 24 Jun 2015 09:56:25 +0900
>>>>> On Tue, 23 Jun 2015 16:44:26 -0700, Paul Eggert <eggert <at> cs.ucla.edu> said:

> Thanks for tracking down and diagnosing this bug.  I've installed a
> patch as commit 1552e6737317ea2c85e06600e178114c6b0f9fb2 in emacs
> master; can you please try it in your environment?

Thanks for looking into this.  But it doesn't build as it is in the
original environment: OS X 10.7, and the following version of llvm-gcc

  i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)

The error message is:

gcc -std=gnu99 -c -I/opt/local/include -Demacs  -I. -I../../../emacs/trunk/src -I../lib -I../../../emacs/trunk/lib   -D_REENTRANT -I/opt/local/include/gtk-3.0 -I/opt/local/include/at-spi2-atk/2.0 -I/opt/local/include/at-spi-2.0 -I/opt/local/include/dbus-1.0 -I/opt/local/lib/dbus-1.0/include -I/opt/local/include/gtk-3.0 -I/opt/local/include/gio-unix-2.0/ -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include -I/opt/local/include/pango-1.0 -I/opt/local/include/harfbuzz -I/opt/local/include/pango-1.0 -I/opt/local/include/atk-1.0 -I/opt/local/include/cairo -I/opt/local/include/pixman-1 -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include -I/opt/local/include/libpng16 -I/opt/local/include -I/opt/local/include/gdk-pixbuf-2.0 -I/opt/local/include/libpng16 -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include  -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include -I/opt/local/include/libpng16 -I/opt/local/include    -D_REENTRANT -I/opt/local/include/librsvg-2.0 -I/opt/local/include/gdk-pixbuf-2.0 -I/opt/local/include/libpng16 -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include -I/opt/local/include/pixman-1 -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include -I/opt/local/include/libpng16 -I/opt/local/include  -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/opt/local/include/ImageMagick-6  -I/opt/local/include/libpng16 -I/opt/local/include/libxml2  -I/opt/local/include/dbus-1.0 -I/opt/local/lib/dbus-1.0/include  -I/opt/local/include  -I/opt/local/include  -I/opt/local/include  -D_REENTRANT -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include  -DORBIT2=1 -D_REENTRANT -I/opt/local/include/gconf/2 -I/opt/local/include/orbit-2.0 -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include  -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include  -I/opt/local/include/freetype2 -I/opt/local/include -I/opt/local/include/libpng16  -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include -I/opt/local/include/libpng16    -MMD -MF deps/dispnew.d -MP -I/opt/local/include -I/opt/local/include/p11-kit-1 -I/opt/local/include  -D_REENTRANT -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include     -g3 -O2  ../../../emacs/trunk/src/dispnew.c
In file included from ../../../emacs/trunk/src/dispnew.c:33:
../../../emacs/trunk/src/keyboard.h: In function ‘kbd_buffer_store_event_hold’:
../../../emacs/trunk/src/keyboard.h:461: error: expected specifier-qualifier-list before ‘*’ token
../../../emacs/trunk/src/keyboard.h:461: error: ‘struct <anonymous>’ has no member named ‘__b’
../../../emacs/trunk/src/keyboard.h:461: error: expected specifier-qualifier-list before ‘*’ token
../../../emacs/trunk/src/keyboard.h:461: error: ‘struct <anonymous>’ has no member named ‘__b’
../../../emacs/trunk/src/keyboard.h:461: error: bit-field ‘_gl_verify_error_if_negative’ width not an integer constant
make: *** [dispnew.o] Error 1


The output of gcc -E for the corresponding part is:

kbd_buffer_store_event_hold (struct input_event *event,
        struct input_event *hold_quit)
{
  union buffered_input_event *ev = (union buffered_input_event *) event;
  extern int (*_gl_verify_function461 (void)) [(!!sizeof (struct { unsigned int _gl_verify_error_if_negative: (sizeof *event == sizeof *ev && __builtin_offsetof (struct { char __a; *event __b; }, __b) == __builtin_offsetof (struct { char __a; *ev __b; }, __b)) ? 1 : -1; }))];
  return kbd_buffer_store_buffered_event ((union buffered_input_event *) event,
       hold_quit);
}


If I comment out the line for the "verify" macro, the it successfully
builds and runs without crash.

				     YAMAMOTO Mitsuharu
				mituharu <at> math.s.chiba-u.ac.jp




This bug report was last modified 8 years and 360 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.