From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry OReilly Newsgroups: gmane.emacs.bugs Subject: bug#15405: 24.3; #[] freezes emacs Date: Wed, 18 Sep 2013 13:31:56 -0400 Message-ID: References: <8361tynp73.fsf@gnu.org> <834n9inoa0.fsf@gnu.org> <871u4mcf2h.fsf@rosalinde.fritz.box> <831u4mnlit.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c353ac5d609e04e6abd08b X-Trace: ger.gmane.org 1379525597 12830 80.91.229.3 (18 Sep 2013 17:33:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 18 Sep 2013 17:33:17 +0000 (UTC) To: Eli Zaretskii , Leo Liu , 15405@debbugs.gnu.org, stephen.berman@gmx.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Sep 18 19:33:19 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VMLcr-0006d5-21 for geb-bug-gnu-emacs@m.gmane.org; Wed, 18 Sep 2013 19:33:17 +0200 Original-Received: from localhost ([::1]:48264 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMLcq-0005jy-MQ for geb-bug-gnu-emacs@m.gmane.org; Wed, 18 Sep 2013 13:33:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40030) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMLci-0005fO-Fm for bug-gnu-emacs@gnu.org; Wed, 18 Sep 2013 13:33:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VMLcc-0000BZ-Dj for bug-gnu-emacs@gnu.org; Wed, 18 Sep 2013 13:33:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38807) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMLcc-0000BV-9W for bug-gnu-emacs@gnu.org; Wed, 18 Sep 2013 13:33:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VMLcc-0001vB-01 for bug-gnu-emacs@gnu.org; Wed, 18 Sep 2013 13:33:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Barry OReilly Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Sep 2013 17:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15405 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15405-submit@debbugs.gnu.org id=B15405.13795255257303 (code B ref 15405); Wed, 18 Sep 2013 17:33:01 +0000 Original-Received: (at 15405) by debbugs.gnu.org; 18 Sep 2013 17:32:05 +0000 Original-Received: from localhost ([127.0.0.1]:47099 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VMLbf-0001ti-UW for submit@debbugs.gnu.org; Wed, 18 Sep 2013 13:32:04 -0400 Original-Received: from mail-we0-f176.google.com ([74.125.82.176]:55892) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VMLbe-0001t6-8g for 15405@debbugs.gnu.org; Wed, 18 Sep 2013 13:32:03 -0400 Original-Received: by mail-we0-f176.google.com with SMTP id u56so6683679wes.7 for <15405@debbugs.gnu.org>; Wed, 18 Sep 2013 10:31:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=qgDa5tNAxo5X3WbQTdHKn7pFmx6CDOuUXPuRWFWfLgM=; b=SigNRzx6I/4rGhqFp+RPszUEmwjGxkPPPVGlZi+SUvWIzLReWDLl4DYA0Dhu/8sv5z z0I+PNSfA7ZzeKp1QDbqxKRFhWloSCyCWnCRRhS7/UGEcOax9ijLDnS2TI8H5rIBW0Wv VcSv2E2V+JiDqUnSEPdrjwzIKz0bhRncUgnZvCNq/1EH+kAfwnHAoaNsP9sUBtcagpqk zYzYOd8i7aAqOkNNiIkNmpOzIxDHxgIvb/h3P3+2I0XAdZ0ITi9vxsByi3pGp5488si9 N5GuIE/R+V2F5YwbCeGKTwB39nOISYtOTmm/YEk1xOr7DV4sb+7jm7Ag6PHFTrRs24Yx 0HhQ== X-Received: by 10.180.183.108 with SMTP id el12mr7916581wic.55.1379525516417; Wed, 18 Sep 2013 10:31:56 -0700 (PDT) Original-Received: by 10.194.234.234 with HTTP; Wed, 18 Sep 2013 10:31:56 -0700 (PDT) In-Reply-To: <831u4mnlit.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:78526 Archived-At: --001a11c353ac5d609e04e6abd08b Content-Type: text/plain; charset=ISO-8859-1 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. #0 0x00000031cfc0e7fd in raise () from /lib64/libpthread.so.0 #1 0x00000000004ced25 in terminate_due_to_signal (sig=11, backtrace_limit=40) at emacs.c:369 #2 0x00000000004e823e in handle_fatal_signal (sig=15650) at sysdep.c:1626 #3 0x00000000004e85f3 in deliver_thread_signal (sig=11) at sysdep.c:1600 #4 deliver_fatal_thread_signal (sig=11) at sysdep.c:1638 #5 #6 0x0000000000552715 in font_delete_unmatched (f=0x1102af0, spec=18316141) at lisp.h:1170 #7 font_list_entities (f=0x1102af0, spec=18316141) at font.c:2753 #8 0x0000000000556224 in font_find_for_lface (f=0x1102af0, attrs=0x7fffa07f03d0, spec=11832930, c=-1) at font.c:3212 #9 0x000000000055671b in font_load_for_lface (f=0xe81112, attrs=0xcd4400, spec=8413600) at font.c:3282 #10 0x000000000049fc62 in realize_x_face (cache=0xd654b0, attrs=0x7fffa07f03d0, former_face_id=) at xfaces.c:5526 #11 realize_face (cache=0xd654b0, attrs=0x7fffa07f03d0, former_face_id=) at xfaces.c:5419 #12 0x00000000004a0a41 in lookup_face (f=, attr=0x7fffa07f03d0) at xfaces.c:4408 #13 0x00000000004a1a91 in face_at_string_position (w=, string=, pos=, bufpos=0, region_beg=-1, region_end=-1, endptr=0x7fffa07f0508, base_face_id=MODE_LINE_INACTIVE_FACE_ID, mouse_p=0) at xfaces.c:6191 #14 0x0000000000444f45 in display_string (string=0xb503e8 "*scratch*", lisp_string=11861937, face_string=, face_string_pos=1, start=0, it=0x7fffa07f0750, field_width=12, precision=-8, max_x=, multibyte=0) at xdisp.c:22291 #15 0x000000000044582c in display_mode_element (it=0x7fffa07f0750, depth=4, field_width=0, precision=-8, elt=, props=11832930, risky=0) at xdisp.c:21044 #16 0x0000000000445e5c in display_mode_element (it=0x7fffa07f0750, depth=3, field_width=0, precision=-8, elt=, props=11832930, risky=0) at xdisp.c:21216 #17 0x0000000000445e5c in display_mode_element (it=0x7fffa07f0750, depth=1, field_width=0, precision=0, elt=, props=11832930, risky=0) at xdisp.c:21216 #18 0x0000000000446734 in display_mode_line (w=, face_id=MODE_LINE_INACTIVE_FACE_ID, format=15318150) at xdisp.c:20733 #19 0x0000000000446a10 in display_mode_lines (w=0x1177950) at xdisp.c:20678 #20 0x0000000000451ee4 in redisplay_window (window=18315605, just_this_one_p=0) at xdisp.c:16122 #21 0x0000000000455386 in redisplay_window_0 (window=15208722) at xdisp.c:13819 #22 0x000000000053f9e3 in internal_condition_case_1 (bfun=0x455360 , arg=18315605, handlers=12043382, hfun=0x425800 ) at eval.c:1376 #23 0x0000000000431a8d in redisplay_windows (window=13452288) at xdisp.c:13799 #24 0x0000000000431a54 in redisplay_windows (window=13452288) at xdisp.c:13793 #25 0x0000000000456191 in redisplay_internal () at xdisp.c:13410 #26 0x00000000004dc905 in read_char (commandflag=1, map=19881590, prev_event=11832930, used_mouse_menu=0x7fffa07f6baf, end_time=0x0) at keyboard.c:2553 #27 0x00000000004de0f1 in read_key_sequence (keybuf=0x7fffa07f6c10, bufsize=30, prompt=11832930, dont_downcase_last=false, can_return_switch_frame=true, fix_current_buffer=true) at keyboard.c:9066 #28 0x00000000004dfb07 in command_loop_1 () at keyboard.c:1436 #29 0x000000000053f88e in internal_condition_case (bfun=0x4df880 , handlers=11892674, hfun=0x4d6e70 ) at eval.c:1339 #30 0x00000000004d6ffa in command_loop_2 (ignore=) at keyboard.c:1163 #31 0x000000000053f74b in internal_catch (tag=, func=0x4d6fe0 , arg=11832930) at eval.c:1113 #32 0x00000000004d63c0 in command_loop () at keyboard.c:1142 #33 recursive_edit_1 () at keyboard.c:781 #34 0x00000000004d7ce6 in Frecursive_edit () at keyboard.c:845 #35 0x00000000004cf9fd in main (argc=, argv=0x7fffa07f71e8) at emacs.c:1570 --001a11c353ac5d609e04e6abd08b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
FWIW, only one M-: #[] is necessary in the reproduction re= cipe.

I used:

diff --git a/src/font.c b/src/font.c
index 6= 8db9f2..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)
=A0=A0 enum font_property_index prop;
=A0=A0 int i;
=A0
+=A0 bool = noninteractive_old =3D noninteractive;
+=A0 { struct timespec debug_ts; = char debug_dateStr[20]; { clock_gettime(CLOCK_REALTIME, &debug_ts); str= uct tm mytm; localtime_r(&debug_ts.tv_sec, &mytm); strftime(debug_d= ateStr, 20, "%Y-%m-%dT%H:%M:%S", &mytm); }
+=A0=A0=A0=A0=A0=A0 printf( "%s.%09ld|pid:%d|tid:%ld|%s|%d| DEBUG: vec= size=3D%ld\n", // TODO: debugging
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 debug_dateStr, debug_ts.tv_nsec,= getpid(), pthread_self(), __FILE__, __LINE__, ASIZE(vec) ); fflush(stdout)= ; }
+=A0 Fprin1(vec, Qnil);
+=A0 noninteractive =3D noninteractive_old;
= =A0=A0 for (val =3D Qnil, i =3D ASIZE (vec) - 1; i >=3D 0; i--)
=A0= =A0=A0=A0 {
=A0=A0=A0=A0=A0=A0 entity =3D AREF (vec, i);

Got:
= 2013-09-18T13:15:22.845944000|pid:15278|tid:2868504832|font.c|2625| DEBUG: = vec size=3D4
2013-09-18T13:15:22.847422000|pid:15278|tid:2868504832|font.c|2625| DEBUG: = vec size=3D4611686018628714496
Fatal error 11: Segmentation fault
Clearly the value of i was a 32 bit truncation of that larger value.

#0=A0 0x00000031cfc0e7fd in raise () from /lib64/libpthread.so.0
#1= =A0 0x00000000004ced25 in terminate_due_to_signal (sig=3D11, backtrace_limi= t=3D40) at emacs.c:369
#2=A0 0x00000000004e823e in handle_fatal_signal (= sig=3D15650) at sysdep.c:1626
#3=A0 0x00000000004e85f3 in deliver_thread_signal (sig=3D11) at sysdep.c:16= 00
#4=A0 deliver_fatal_thread_signal (sig=3D11) at sysdep.c:1638
#5= =A0 <signal handler called>
#6=A0 0x0000000000552715 in font_delet= e_unmatched (f=3D0x1102af0, spec=3D18316141) at lisp.h:1170
#7=A0 font_list_entities (f=3D0x1102af0, spec=3D18316141) at font.c:2753#8=A0 0x0000000000556224 in font_find_for_lface (f=3D0x1102af0, attrs=3D0x= 7fffa07f03d0, spec=3D11832930, c=3D-1) at font.c:3212
#9=A0 0x0000000000= 55671b in font_load_for_lface (f=3D0xe81112, attrs=3D0xcd4400, spec=3D84136= 00) at font.c:3282
#10 0x000000000049fc62 in realize_x_face (cache=3D0xd654b0, attrs=3D0x7fffa= 07f03d0, former_face_id=3D<value optimized out>) at xfaces.c:5526
= #11 realize_face (cache=3D0xd654b0, attrs=3D0x7fffa07f03d0, former_face_id= =3D<value optimized out>) at xfaces.c:5419
#12 0x00000000004a0a41 in lookup_face (f=3D<value optimized out>, att= r=3D0x7fffa07f03d0) at xfaces.c:4408
#13 0x00000000004a1a91 in face_at_s= tring_position (w=3D<value optimized out>, string=3D<value optimiz= ed out>, pos=3D<value optimized out>, bufpos=3D0, region_beg=3D-1,= region_end=3D-1, endptr=3D0x7fffa07f0508,
=A0=A0=A0 base_face_id=3DMODE_LINE_INACTIVE_FACE_ID, mouse_p=3D0) at xfaces= .c:6191
#14 0x0000000000444f45 in display_string (string=3D0xb503e8 &quo= t;*scratch*", lisp_string=3D11861937, face_string=3D<value optimize= d out>, face_string_pos=3D1, start=3D0, it=3D0x7fffa07f0750, field_width= =3D12, precision=3D-8,
=A0=A0=A0 max_x=3D<value optimized out>, multibyte=3D0) at xdisp.c:22= 291
#15 0x000000000044582c in display_mode_element (it=3D0x7fffa07f0750,= depth=3D4, field_width=3D0, precision=3D-8, elt=3D<value optimized out&= gt;, props=3D11832930, risky=3D0) at xdisp.c:21044
#16 0x0000000000445e5c in display_mode_element (it=3D0x7fffa07f0750, depth= =3D3, field_width=3D0, precision=3D-8, elt=3D<value optimized out>, p= rops=3D11832930, risky=3D0) at xdisp.c:21216
#17 0x0000000000445e5c in d= isplay_mode_element (it=3D0x7fffa07f0750, depth=3D1, field_width=3D0, preci= sion=3D0, elt=3D<value optimized out>, props=3D11832930, risky=3D0) a= t xdisp.c:21216
#18 0x0000000000446734 in display_mode_line (w=3D<value optimized out>= ;, face_id=3DMODE_LINE_INACTIVE_FACE_ID, format=3D15318150) at xdisp.c:2073= 3
#19 0x0000000000446a10 in display_mode_lines (w=3D0x1177950) at xdisp.= c:20678
#20 0x0000000000451ee4 in redisplay_window (window=3D18315605, just_this_on= e_p=3D0) at xdisp.c:16122
#21 0x0000000000455386 in redisplay_window_0 (= window=3D15208722) at xdisp.c:13819
#22 0x000000000053f9e3 in internal_c= ondition_case_1 (bfun=3D0x455360 <redisplay_window_0>, arg=3D18315605= , handlers=3D12043382, hfun=3D0x425800 <redisplay_window_error>) at e= val.c:1376
#23 0x0000000000431a8d in redisplay_windows (window=3D13452288) at xdisp.c:= 13799
#24 0x0000000000431a54 in redisplay_windows (window=3D13452288) at= xdisp.c:13793
#25 0x0000000000456191 in redisplay_internal () at xdisp.= c:13410
#26 0x00000000004dc905 in read_char (commandflag=3D1, map=3D19881590, prev_= event=3D11832930, used_mouse_menu=3D0x7fffa07f6baf, end_time=3D0x0) at keyb= oard.c:2553
#27 0x00000000004de0f1 in read_key_sequence (keybuf=3D0x7fff= a07f6c10, bufsize=3D30, prompt=3D11832930, dont_downcase_last=3Dfalse, can_= return_switch_frame=3Dtrue, fix_current_buffer=3Dtrue) at keyboard.c:9066 #28 0x00000000004dfb07 in command_loop_1 () at keyboard.c:1436
#29 0x000= 000000053f88e in internal_condition_case (bfun=3D0x4df880 <command_loop_= 1>, handlers=3D11892674, hfun=3D0x4d6e70 <cmd_error>) at eval.c:13= 39
#30 0x00000000004d6ffa in command_loop_2 (ignore=3D<value optimized out&= gt;) at keyboard.c:1163
#31 0x000000000053f74b in internal_catch (tag=3D= <value optimized out>, func=3D0x4d6fe0 <command_loop_2>, arg=3D= 11832930) at eval.c:1113
#32 0x00000000004d63c0 in command_loop () at keyboard.c:1142
#33 recursi= ve_edit_1 () at keyboard.c:781
#34 0x00000000004d7ce6 in Frecursive_edit= () at keyboard.c:845
#35 0x00000000004cf9fd in main (argc=3D<value o= ptimized out>, argv=3D0x7fffa07f71e8) at emacs.c:1570



--001a11c353ac5d609e04e6abd08b--