From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#22873: Can we support multiple Cursors? Date: Mon, 14 Mar 2016 20:49:17 +0200 Message-ID: <837fh4dhea.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1457981511 15738 80.91.229.3 (14 Mar 2016 18:51:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Mar 2016 18:51:51 +0000 (UTC) Cc: jwiegley@gmail.com, mbork@mbork.pl, 22873@debbugs.gnu.org, rms@gnu.org To: Keith David Bershatsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 14 19:51:36 2016 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 1afXaZ-00079S-Ml for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Mar 2016 19:51:35 +0100 Original-Received: from localhost ([::1]:43444 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afXaZ-00069n-3J for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Mar 2016 14:51:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51400) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afXa6-0005S3-HU for bug-gnu-emacs@gnu.org; Mon, 14 Mar 2016 14:51:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1afXa2-0005Pc-4S for bug-gnu-emacs@gnu.org; Mon, 14 Mar 2016 14:51:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51062) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afXa2-0005PY-1b for bug-gnu-emacs@gnu.org; Mon, 14 Mar 2016 14:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1afXa1-0000ow-TZ for bug-gnu-emacs@gnu.org; Mon, 14 Mar 2016 14:51:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 14 Mar 2016 18:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22873-submit@debbugs.gnu.org id=B22873.14579814193085 (code B ref 22873); Mon, 14 Mar 2016 18:51:01 +0000 Original-Received: (at 22873) by debbugs.gnu.org; 14 Mar 2016 18:50:19 +0000 Original-Received: from localhost ([127.0.0.1]:48187 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1afXZK-0000nh-Vo for submit@debbugs.gnu.org; Mon, 14 Mar 2016 14:50:19 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60210) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1afXZK-0000nQ-41 for 22873@debbugs.gnu.org; Mon, 14 Mar 2016 14:50:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1afXZA-0005Hf-L5 for 22873@debbugs.gnu.org; Mon, 14 Mar 2016 14:50:12 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37003) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afXYw-0005CO-De; Mon, 14 Mar 2016 14:49:54 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2801 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1afXYn-0002nH-Vb; Mon, 14 Mar 2016 14:49:46 -0400 In-reply-to: (message from Keith David Bershatsky on Mon, 14 Mar 2016 11:35:18 -0700) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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:114903 Archived-At: > Date: Mon, 14 Mar 2016 11:35:18 -0700 > From: Keith David Bershatsky > Cc: 22873@debbugs.gnu.org,John Wiegley ,Marcin Borkowski ,Richard Stallman > > I reached a roadblock on Emacs for Windows and I haven't the slightest idea why my cached list of multiple cursors is being converted into a value `` sporadically when holding down the arrow key and moving the active cursor repetitively through plain text in a fundamental-mode buffer. Emacs crashes in that circumstance. The cache is a Lisp_Object pointer defined in `window.h` named mc_cache (aka `w->mc_cache`). The value of `w->mc_cache` is: > > '(( > (3 hbar [1.0 0.0 0.0]) > (4 bar [0.0 1.0 0.0]) > (5 box [0.0 0.0 1.0]) > (6 hollow [0.8 0.4 0.2]) > (7 (hbar 3) [1.0 0.0 1.0]) > (8 (bar 3) [0.0 1.0 1.0])) > ( > ((3 hbar [1.0 0.0 0.0]) (22 20 2 0)) > ((4 bar [0.0 1.0 0.0]) (33 20 3 0)) > ((5 box [0.0 0.0 1.0]) (44 20 4 0)) > ((6 hollow [0.8 0.4 0.2]) (55 20 5 0)) > ((7 (hbar 3) [1.0 0.0 1.0]) (66 20 6 0)) > ((8 (bar 3) [0.0 1.0 1.0]) (77 20 7 0)) > )) > > The "for" loop looks like this and Emacs crashes when reading the line containing "cursor_spec_list = XCAR (XCAR (vlist))". `cursor_spec_list` and `vlist` are both Lisp_Object: > > for (vlist = XCAR (XCDR (w->mc_cache)); > CONSP (vlist); > vlist = XCDR (vlist)) > { > cursor_spec_list = XCAR (XCAR (vlist)); > *** You maintain a Lisp object in a window object, but did you make sure it's declared before the place in 'struct window' where we have this comment: /* No Lisp data may follow below this point without changing mark_object in alloc.c. The member current_matrix must be the first non-Lisp member. */ If mc_cache is beyond this point, chances are it's being GC'ed behind your back.