Subject: Re: bug#15405: 24.3; #[] freezes emacs

From: Eli Zaretskii <[email-masked]>
Date: Wed, 18 Sep 2013 22:26:47 +0300

> Date: Wed, 18 Sep 2013 13:31:56 -0400
> From: Barry OReilly <[email-masked]>
> 
> FWIW, only one M-: #[] is necessary in the reproduction recipe.
> 
> I used:
> 
> diff --git a/src/font.c b/src/font.c
> index 68db9f2..0f2d24f 100644
> --- a/src/font.c
> +++ b/src/font.c
> @@ -2619,6 +2619,12 @@ font_delete_unmatched (Lisp_Object vec, Lisp_Object
> spec, int size)
>    enum font_property_index prop;
>    int i;
> 
> +  bool noninteractive_old = noninteractive;
> +  { struct timespec debug_ts; char debug_dateStr[20]; {
> clock_gettime(CLOCK_REALTIME, &debug_ts); struct tm mytm;
> localtime_r(&debug_ts.tv_sec, &mytm); strftime(debug_dateStr, 20,
> "%Y-%m-%dT%H:%M:%S", &mytm); }
> +       printf( "%s.%09ld|pid:%d|tid:%ld|%s|%d| DEBUG: vec size=%ld\n", //
> TODO: debugging
> +                         debug_dateStr, debug_ts.tv_nsec, getpid(),
> pthread_self(), __FILE__, __LINE__, ASIZE(vec) ); fflush(stdout); }
> +  Fprin1(vec, Qnil);
> +  noninteractive = noninteractive_old;
>    for (val = Qnil, i = ASIZE (vec) - 1; i >= 0; i--)
>      {
>        entity = AREF (vec, i);
> 
> Got:
> 2013-09-18T13:15:22.845944000|pid:15278|tid:2868504832|font.c|2625| DEBUG:
> vec size=4
> 2013-09-18T13:15:22.847422000|pid:15278|tid:2868504832|font.c|2625| DEBUG:
> vec size=4611686018628714496
> Fatal error 11: Segmentation fault
> 
> Clearly the value of i was a 32 bit truncation of that larger value.

The next step is to put a hardware watchpoint on that vector, and see
who thrashes it.