GNU bug report logs - #15898
Emacs aborts in buf_charpos_to_bytepos

Previous Next

Package: emacs;

Reported by: Barry OReilly <gundaetiapo <at> gmail.com>

Date: Thu, 14 Nov 2013 21:52:02 UTC

Severity: normal

Tags: moreinfo

Merged with 15841, 15893, 15901, 15930, 15931, 15948, 15952

Found in version 24.3.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 15898 in the body.
You can then email your comments to 15898 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#15898; Package emacs. (Thu, 14 Nov 2013 21:52:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Barry OReilly <gundaetiapo <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 14 Nov 2013 21:52:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Barry OReilly <gundaetiapo <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Emacs aborts in buf_charpos_to_bytepos
Date: Thu, 14 Nov 2013 16:50:37 -0500
[Message part 1 (text/plain, inline)]
I updated my Emacs to the latest trunk, built bootstrap, and
approximately an hour later it core dumped.

Program terminated with signal 6, Aborted.
#0  0x00000031cfc0e7fd in raise () from /lib64/libpthread.so.0
(gdb) bt
#0  0x00000031cfc0e7fd in raise () from /lib64/libpthread.so.0
#1  0x0000000000503875 in terminate_due_to_signal (sig=6,
backtrace_limit=2147483647) at emacs.c:377
#2  0x0000000000569274 in die (msg=<value optimized out>, file=<value
optimized out>, line=<value optimized out>) at alloc.c:6726
#3  0x0000000000537a77 in buf_charpos_to_bytepos (b=0x180761e0,
charpos=26969) at marker.c:145
#4  0x0000000000554190 in find_newline (start=26969, start_byte=26918,
end=26939, end_byte=<value optimized out>, count=1,
shortage=0x7fffdaac9598, bytepos=0x0, allow_quit=true) at search.c:701
#5  0x000000000055531e in find_before_next_newline (from=16655, to=6,
cnt=128, bytepos=0x0) at search.c:902
#6  0x000000000057fbb4 in Fline_end_position (n=<value optimized out>) at
editfns.c:812
#7  0x000000000054aafe in Fend_of_line (n=16655) at cmds.c:199
#8  0x00000000005c70a2 in exec_byte_code (bytestr=16655, vector=16655,
maxdepth=6, args_template=12849010, nargs=0, args=0x7f) at bytecode.c:1751
#9  0x0000000000589f2c in funcall_lambda (fun=357705693, nargs=0,
arg_vector=0x7fffdaac9770) at eval.c:3039
#10 0x000000000058a1ec in Ffuncall (nargs=1, args=<value optimized out>) at
eval.c:2866
#11 0x00000000005c6400 in exec_byte_code (bytestr=16655, vector=16655,
maxdepth=6, args_template=12849010, nargs=0, args=0x20) at bytecode.c:919
#12 0x0000000000589f2c in funcall_lambda (fun=358448597, nargs=0,
arg_vector=0x7fffdaac9900) at eval.c:3039
#13 0x000000000058a1ec in Ffuncall (nargs=1, args=<value optimized out>) at
eval.c:2866
#14 0x00000000005c6400 in exec_byte_code (bytestr=16655, vector=16655,
maxdepth=6, args_template=12849010, nargs=0, args=0x20) at bytecode.c:919
#15 0x0000000000589f2c in funcall_lambda (fun=359169677, nargs=3,
arg_vector=0x7fffdaac9ab0) at eval.c:3039
#16 0x000000000058a1ec in Ffuncall (nargs=4, args=<value optimized out>) at
eval.c:2866
#17 0x00000000005c6400 in exec_byte_code (bytestr=16655, vector=16655,
maxdepth=6, args_template=12849010, nargs=0, args=0x23) at bytecode.c:919
#18 0x0000000000589f2c in funcall_lambda (fun=359170213, nargs=1,
arg_vector=0x7fffdaac9c48) at eval.c:3039
#19 0x000000000058a1ec in Ffuncall (nargs=2, args=<value optimized out>) at
eval.c:2866
#20 0x000000000058a85a in call1 (fn=<value optimized out>, arg1=<value
optimized out>) at eval.c:2604
#21 0x0000000000591ebe in mapcar1 (leni=2, vals=0x0, fn=359170213, seq=-1)
at fns.c:2294
#22 0x0000000000592007 in Fmapc (function=359170213, sequence=358355174) at
fns.c:2383
#23 0x000000000058a60f in Ffuncall (nargs=3, args=<value optimized out>) at
eval.c:2808
#24 0x00000000005c6400 in exec_byte_code (bytestr=16655, vector=16655,
maxdepth=6, args_template=12849010, nargs=0, args=0x22) at bytecode.c:919
#25 0x0000000000589f2c in funcall_lambda (fun=359170581, nargs=3,
arg_vector=0x7fffdaac9f28) at eval.c:3039
#26 0x000000000058a1ec in Ffuncall (nargs=4, args=<value optimized out>) at
eval.c:2866
#27 0x000000000058a8f9 in funcall_nil (nargs=16655, args=0x410f) at
eval.c:2356
#28 0x00000000005879d0 in run_hook_with_args (nargs=4, args=0x7fffdaac9f20,
funcall=0x58a8f0 <funcall_nil>) at eval.c:2541
#29 0x0000000000533918 in signal_after_change (charpos=26603, lendel=31,
lenins=0) at insdel.c:2069
#30 0x00000000005367f6 in del_range_byte (from_byte=<value optimized out>,
to_byte=<value optimized out>, prepare=false) at insdel.c:1632
#31 0x00000000005441eb in Finsert_file_contents (filename=<value optimized
out>, visit=12849058, beg=12849010, end=12849010, replace=12849058) at
fileio.c:4019
#32 0x000000000058a6cf in Ffuncall (nargs=6, args=<value optimized out>) at
eval.c:2821
#33 0x00000000005c6400 in exec_byte_code (bytestr=16655, vector=16655,
maxdepth=6, args_template=2056, nargs=2, args=0x25) at bytecode.c:919
#34 0x000000000058a1ec in Ffuncall (nargs=3, args=<value optimized out>) at
eval.c:2866
#35 0x00000000005c6400 in exec_byte_code (bytestr=16655, vector=16655,
maxdepth=6, args_template=2056, nargs=2, args=0x22) at bytecode.c:919
#36 0x000000000058a1ec in Ffuncall (nargs=3, args=<value optimized out>) at
eval.c:2866
#37 0x00000000005c6400 in exec_byte_code (bytestr=16655, vector=16655,
maxdepth=6, args_template=3072, nargs=3, args=0x22) at bytecode.c:919
#38 0x000000000058a1ec in Ffuncall (nargs=4, args=<value optimized out>) at
eval.c:2866
#39 0x00000000005c6400 in exec_byte_code (bytestr=16655, vector=16655,
maxdepth=6, args_template=12849010, nargs=0, args=0x23) at bytecode.c:919
#40 0x0000000000589f2c in funcall_lambda (fun=18789701, nargs=0,
arg_vector=0x7fffdaadaaf0) at eval.c:3039
#41 0x000000000058a1ec in Ffuncall (nargs=1, args=<value optimized out>) at
eval.c:2866
#42 0x00000000005c6400 in exec_byte_code (bytestr=16655, vector=16655,
maxdepth=6, args_template=12849010, nargs=0, args=0x20) at bytecode.c:919
#43 0x0000000000589f2c in funcall_lambda (fun=18789925, nargs=0,
arg_vector=0x7fffdaadad48) at eval.c:3039
#44 0x000000000058a1ec in Ffuncall (nargs=1, args=<value optimized out>) at
eval.c:2866
#45 0x000000000058ac43 in Fapply (nargs=2, args=0x7fffdaadad40) at
eval.c:2287
#46 0x000000000058a46c in Ffuncall (nargs=3, args=<value optimized out>) at
eval.c:2786
#47 0x00000000005c6400 in exec_byte_code (bytestr=16655, vector=16655,
maxdepth=6, args_template=12849010, nargs=0, args=0x22) at bytecode.c:919
#48 0x0000000000589879 in eval_sub (form=<value optimized out>) at
eval.c:2181
#49 0x000000000058cdca in internal_lisp_condition_case (var=16915058,
bodyform=10187926, handlers=<value optimized out>) at eval.c:1313
#50 0x00000000005c7f0d in exec_byte_code (bytestr=16655, vector=16655,
maxdepth=6, args_template=12849010, nargs=0, args=0x8f) at bytecode.c:1169
#51 0x0000000000589f2c in funcall_lambda (fun=10187613, nargs=1,
arg_vector=0x7fffdaadb118) at eval.c:3039
#52 0x000000000058a1ec in Ffuncall (nargs=2, args=<value optimized out>) at
eval.c:2866
#53 0x000000000058a85a in call1 (fn=<value optimized out>, arg1=<value
optimized out>) at eval.c:2604
#54 0x000000000050b7df in timer_check_2 () at keyboard.c:4508
#55 timer_check () at keyboard.c:4575
#56 0x000000000050babc in readable_events (flags=1) at keyboard.c:3442
#57 0x000000000050c718 in get_input_pending (flags=1) at keyboard.c:6745
#58 0x000000000050c7af in detect_input_pending_run_timers (do_display=true)
at keyboard.c:9870
#59 0x00000000005ce232 in wait_reading_process_output (time_limit=<value
optimized out>, nsecs=0, read_kbd=-1, do_display=true,
wait_for_cell=12849010, wait_proc=0x0, just_wait_proc=0) at process.c:4679
#60 0x0000000000510e3c in kbd_buffer_get_event (end_time=0x0,
local_getcjmp=0x7fffdaadbac0, prev_event=12849010,
used_mouse_menu=0x7fffdaadbd3f) at keyboard.c:3900
#61 read_event_from_main_queue (end_time=0x0, local_getcjmp=0x7fffdaadbac0,
prev_event=12849010, used_mouse_menu=0x7fffdaadbd3f) at keyboard.c:2241
#62 read_decoded_event_from_main_queue (end_time=0x0,
local_getcjmp=0x7fffdaadbac0, prev_event=12849010,
used_mouse_menu=0x7fffdaadbd3f) at keyboard.c:2306
#63 0x00000000005159e1 in read_char (commandflag=1, map=404497478,
prev_event=12849010, used_mouse_menu=0x7fffdaadbd3f, end_time=0x0) at
keyboard.c:2890
#64 0x0000000000516ce5 in read_key_sequence (keybuf=0x7fffdaadbdb0,
bufsize=30, prompt=12849010, dont_downcase_last=false,
can_return_switch_frame=true, fix_current_buffer=true,
prevent_redisplay=false)
    at keyboard.c:9065
#65 0x000000000051912e in command_loop_1 () at keyboard.c:1444
#66 0x000000000058807a in internal_condition_case (bfun=0x518e10
<command_loop_1>, handlers=12900034, hfun=0x50f550 <cmd_error>) at
eval.c:1344
---Type <return> to continue, or q <return> to quit---
#67 0x000000000050d9ea in command_loop_2 (ignore=<value optimized out>) at
keyboard.c:1169
#68 0x0000000000587f58 in internal_catch (tag=12895970, func=0x50d9d0
<command_loop_2>, arg=12849010) at eval.c:1108
#69 0x000000000050d8f0 in command_loop () at keyboard.c:1148
#70 recursive_edit_1 () at keyboard.c:776
#71 0x000000000050ea17 in Frecursive_edit () at keyboard.c:840
#72 0x0000000000504dfd in main (argc=<value optimized out>,
argv=0x7fffdaadc128) at emacs.c:1594
(gdb)
(gdb) f 3
#3  0x0000000000537a77 in buf_charpos_to_bytepos (b=0x180761e0,
charpos=26969) at marker.c:145
145       eassert (BUF_BEG (b) <= charpos && charpos <= BUF_Z (b));
(gdb) p BUF_BEG(b)
$1 = 1
(gdb) p charpos
$2 = 26969
(gdb) p BUF_Z(b)
$3 = 26939
(gdb)

Specifically, I updated from:

commit a5088c77a2520d2f81b6ea842e04c229b96adf7e
Author: Xue Fuqiao <xfq.free <at> gmail.com>
Date:   Fri Oct 18 22:27:44 2013 +0800

    Another index for line height.

To:

commit daa505e5f4ef7d6a6aab6fb5f64faa1a75ee4d10
Author: Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>
Date:   Thu Nov 14 19:43:49 2013 +0200

    Fix bug #15892 with link failures of the Cygwin w32 build.

     src/keyboard.c (make_ctrl_char) [HAVE_NTGUI]: Now externally visible
     for Cygwin w32 build.
     src/xdisp.c (erase_phys_cursor) [HAVE_NTGUI]: Now externally visible
     for Cygwin w32 build.

OS is RHEL 5.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15898; Package emacs. (Fri, 15 Nov 2013 07:40:02 GMT) Full text and rfc822 format available.

Message #8 received at 15898 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Barry OReilly <gundaetiapo <at> gmail.com>
Cc: 15898 <at> debbugs.gnu.org
Subject: Re: bug#15898: Emacs aborts in buf_charpos_to_bytepos
Date: Fri, 15 Nov 2013 09:39:06 +0200
> Date: Thu, 14 Nov 2013 16:50:37 -0500
> From: Barry OReilly <gundaetiapo <at> gmail.com>
> 
> I updated my Emacs to the latest trunk, built bootstrap, and
> approximately an hour later it core dumped.
> 
> Program terminated with signal 6, Aborted.
> #0  0x00000031cfc0e7fd in raise () from /lib64/libpthread.so.0
> (gdb) bt
> #0  0x00000031cfc0e7fd in raise () from /lib64/libpthread.so.0
> #1  0x0000000000503875 in terminate_due_to_signal (sig=6,
> backtrace_limit=2147483647) at emacs.c:377
> #2  0x0000000000569274 in die (msg=<value optimized out>, file=<value
> optimized out>, line=<value optimized out>) at alloc.c:6726
> #3  0x0000000000537a77 in buf_charpos_to_bytepos (b=0x180761e0,
> charpos=26969) at marker.c:145
> #4  0x0000000000554190 in find_newline (start=26969, start_byte=26918,
> end=26939, end_byte=<value optimized out>, count=1,
> shortage=0x7fffdaac9598, bytepos=0x0, allow_quit=true) at search.c:701
> #5  0x000000000055531e in find_before_next_newline (from=16655, to=6,
> cnt=128, bytepos=0x0) at search.c:902
> #6  0x000000000057fbb4 in Fline_end_position (n=<value optimized out>) at
> editfns.c:812

This looks like another duplicate of 15841, but that would imply that
your previous update was before revno 115033, which was committed
quite some time ago.  Can you tell if that was indeed so?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15898; Package emacs. (Fri, 15 Nov 2013 15:26:02 GMT) Full text and rfc822 format available.

Message #11 received at 15898 <at> debbugs.gnu.org (full text, mbox):

From: Barry OReilly <gundaetiapo <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 15898 <at> debbugs.gnu.org
Subject: Re: bug#15898: Emacs aborts in buf_charpos_to_bytepos
Date: Fri, 15 Nov 2013 10:25:16 -0500
[Message part 1 (text/plain, inline)]
> This looks like another duplicate of 15841, but that would imply
> that your previous update was before revno 115033, which was
> committed quite some time ago. Can you tell if that was indeed so?

That's correct, I updated from before revno 115033 to after it.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15898; Package emacs. (Fri, 15 Nov 2013 16:40:02 GMT) Full text and rfc822 format available.

Message #14 received at 15898 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Barry OReilly <gundaetiapo <at> gmail.com>
Cc: 15898 <at> debbugs.gnu.org, control <at> debbugs.gnu.org
Subject: Re: bug#15898: Emacs aborts in buf_charpos_to_bytepos
Date: Fri, 15 Nov 2013 18:39:18 +0200
merge 15898 15841
thanks

> Date: Fri, 15 Nov 2013 10:25:16 -0500
> From: Barry OReilly <gundaetiapo <at> gmail.com>
> Cc: 15898 <at> debbugs.gnu.org
> 
> > This looks like another duplicate of 15841, but that would imply
> > that your previous update was before revno 115033, which was
> > committed quite some time ago. Can you tell if that was indeed so?
> 
> That's correct, I updated from before revno 115033 to after it.

Thanks.  In that case, perhaps you, too, could try the patch I
suggested there just a few minutes ago.




Merged 15841 15893 15898. Request was from Eli Zaretskii <eliz <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 15 Nov 2013 16:40:04 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15898; Package emacs. (Fri, 15 Nov 2013 16:58:02 GMT) Full text and rfc822 format available.

Message #19 received at 15898 <at> debbugs.gnu.org (full text, mbox):

From: Barry OReilly <gundaetiapo <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 15898 <at> debbugs.gnu.org
Subject: Re: bug#15898: Emacs aborts in buf_charpos_to_bytepos
Date: Fri, 15 Nov 2013 11:57:25 -0500
[Message part 1 (text/plain, inline)]
Not having applied your patch yet, I reproduced the core dump in GDB and
got a Lisp backtrace:

"line-end-position" (0xfffe9cc0)
"back-to-indentation" (0xfffe9de0)
"c-beginning-of-macro" (0xfffe9f70)
"c-extend-font-lock-region-for-macros" (0xfffea110)
"c-neutralize-syntax-in-and-mark-CPP" (0xfffea2c0)
0x1c01cb0 PVEC_COMPILED
"mapc" (0xfffea540)
"c-after-change" (0xfffea738)
"insert-file-contents" (0xffffad40)
"revert-buffer-insert-file-contents--default-function" (0xffffaec0)
"revert-buffer--default" (0xffffb028)
"revert-buffer" (0xffffb160)
"auto-revert-handler" (0xffffb300)
"auto-revert-buffers" (0xffffb558)
"apply" (0xffffb550)
"byte-code" (0xffffb660)
"timer-event-handler" (0xffffb928)

I'll apply your patch now.
[Message part 2 (text/html, inline)]

Merged 15841 15893 15898 15901. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 16 Nov 2013 19:13:02 GMT) Full text and rfc822 format available.

Forcibly Merged 15841 15893 15898 15901 15930 15931. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 20 Nov 2013 18:35:01 GMT) Full text and rfc822 format available.

Forcibly Merged 15841 15893 15898 15901 15930 15931 15948. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 21 Nov 2013 21:32:02 GMT) Full text and rfc822 format available.

Forcibly Merged 15841 15893 15898 15901 15930 15931 15948 15952. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 22 Nov 2013 07:12:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 27 Dec 2013 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 172 days ago.

Previous Next


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