From unknown Sat Jun 21 17:33:50 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#9948 <9948@debbugs.gnu.org> To: bug#9948 <9948@debbugs.gnu.org> Subject: Status: valgrind warning: Conditional jump or move depends on uninitialised value(s) in redisplay_window Reply-To: bug#9948 <9948@debbugs.gnu.org> Date: Sun, 22 Jun 2025 00:33:50 +0000 retitle 9948 valgrind warning: Conditional jump or move depends on uninitia= lised value(s) in redisplay_window reassign 9948 emacs submitter 9948 Dan Nicolaescu severity 9948 minor tag 9948 unreproducible thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 03 17:57:40 2011 Received: (at submit) by debbugs.gnu.org; 3 Nov 2011 21:57:40 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RM5I3-0004bX-Bi for submit@debbugs.gnu.org; Thu, 03 Nov 2011 17:57:40 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RM5I1-0004bQ-E8 for submit@debbugs.gnu.org; Thu, 03 Nov 2011 17:57:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RM5FZ-0001bP-Ib for submit@debbugs.gnu.org; Thu, 03 Nov 2011 17:55:06 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, RP_MATCHES_RCVD autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:55807) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RM5FZ-0001bK-H6 for submit@debbugs.gnu.org; Thu, 03 Nov 2011 17:55:05 -0400 Received: from eggs.gnu.org ([140.186.70.92]:44647) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RM5FY-0001oL-ME for bug-gnu-emacs@gnu.org; Thu, 03 Nov 2011 17:55:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RM5FX-0001a4-Mn for bug-gnu-emacs@gnu.org; Thu, 03 Nov 2011 17:55:04 -0400 Received: from fencepost.gnu.org ([140.186.70.10]:53738) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RM5FX-0001Zw-Hg for bug-gnu-emacs@gnu.org; Thu, 03 Nov 2011 17:55:03 -0400 Received: from dann by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1RM5FX-0004bz-Bh for bug-gnu-emacs@gnu.org; Thu, 03 Nov 2011 17:55:03 -0400 From: Dan Nicolaescu To: bug-gnu-emacs@gnu.org Subject: valgrind warning: Conditional jump or move depends on uninitialised value(s) in redisplay_window Date: Thu, 03 Nov 2011 17:55:03 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -6.5 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.5 (------) valgrind gives this warning on emacs -Q, lucid toolkit, compiled -g -O0 ==7776== Conditional jump or move depends on uninitialised value(s) ==7776== at 0x44F58B: redisplay_window (xdisp.c:15575) ==7776== by 0x4496BF: redisplay_window_0 (xdisp.c:13573) ==7776== by 0x5D3DBF: internal_condition_case_1 (eval.c:1537) ==7776== by 0x449632: redisplay_windows (xdisp.c:13553) ==7776== by 0x44864F: redisplay_internal (xdisp.c:13130) ==7776== by 0x4463AF: redisplay (xdisp.c:12353) ==7776== by 0x53A8C6: read_char (keyboard.c:2443) ==7776== by 0x54895A: read_key_sequence (keyboard.c:9290) ==7776== by 0x5387ED: command_loop_1 (keyboard.c:1447) ==7776== by 0x5D3C46: internal_condition_case (eval.c:1499) ==7776== by 0x5380F7: command_loop_2 (keyboard.c:1158) ==7776== by 0x5D35D0: internal_catch (eval.c:1256) ==7776== The line in question is aggressive = scrolling_up ? BVAR (current_buffer, scroll_up_aggressively) : BVAR (current_buffer, scroll_down_aggressively); ^^^^^^^^^^^^^^^^^^ This one From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 03 18:21:51 2011 Received: (at 9948) by debbugs.gnu.org; 3 Nov 2011 22:21:51 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RM5fT-0005Ar-BN for submit@debbugs.gnu.org; Thu, 03 Nov 2011 18:21:51 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RM5fR-0005Ah-Cj for 9948@debbugs.gnu.org; Thu, 03 Nov 2011 18:21:50 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0LU300700V9OPS00@a-mtaout20.012.net.il> for 9948@debbugs.gnu.org; Fri, 04 Nov 2011 00:17:56 +0200 (IST) Received: from HOME-C4E4A596F7 ([84.228.70.69]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LU3007C5V9VM640@a-mtaout20.012.net.il>; Fri, 04 Nov 2011 00:17:56 +0200 (IST) Date: Fri, 04 Nov 2011 00:17:59 +0200 From: Eli Zaretskii Subject: Re: bug#9948: valgrind warning: Conditional jump or move depends on uninitialised value(s) in redisplay_window In-reply-to: X-012-Sender: halo1@inter.net.il To: Dan Nicolaescu Message-id: <83y5vwlujs.fsf@gnu.org> References: X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 9948 Cc: 9948@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.0 (--) > From: Dan Nicolaescu > Date: Thu, 03 Nov 2011 17:55:03 -0400 > > aggressive = > scrolling_up > ? BVAR (current_buffer, scroll_up_aggressively) > : BVAR (current_buffer, scroll_down_aggressively); > ^^^^^^^^^^^^^^^^^^ > This one How can this be uninitialized? This is a buffer-local value of a variable that is initialized to nil on buffer.c. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 03 19:33:31 2011 Received: (at 9948) by debbugs.gnu.org; 3 Nov 2011 23:33:31 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RM6mo-0006oe-BR for submit@debbugs.gnu.org; Thu, 03 Nov 2011 19:33:31 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RM6ml-0006oX-U8 for 9948@debbugs.gnu.org; Thu, 03 Nov 2011 19:33:28 -0400 Received: from dann by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1RM6kK-0001T5-0w; Thu, 03 Nov 2011 19:30:56 -0400 From: Dan Nicolaescu To: Eli Zaretskii Subject: Re: bug#9948: valgrind warning: Conditional jump or move depends on uninitialised value(s) in redisplay_window References: <83y5vwlujs.fsf@gnu.org> Date: Thu, 03 Nov 2011 19:30:55 -0400 In-Reply-To: <83y5vwlujs.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 04 Nov 2011 00:17:59 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.5 (------) X-Debbugs-Envelope-To: 9948 Cc: 9948@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.5 (------) Eli Zaretskii writes: >> From: Dan Nicolaescu >> Date: Thu, 03 Nov 2011 17:55:03 -0400 >> >> aggressive = >> scrolling_up >> ? BVAR (current_buffer, scroll_up_aggressively) >> : BVAR (current_buffer, scroll_down_aggressively); >> ^^^^^^^^^^^^^^^^^^ >> This one > > How can this be uninitialized? This is a buffer-local value of a > variable that is initialized to nil on buffer.c. The line might be incorrect, are all the variables in that expression initialized correctly? From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 04 05:07:20 2011 Received: (at 9948) by debbugs.gnu.org; 4 Nov 2011 09:07:20 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RMFk8-00036v-9R for submit@debbugs.gnu.org; Fri, 04 Nov 2011 05:07:20 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RMFk5-00036k-Ht for 9948@debbugs.gnu.org; Fri, 04 Nov 2011 05:07:19 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0LU400D00P781Q00@a-mtaout20.012.net.il> for 9948@debbugs.gnu.org; Fri, 04 Nov 2011 11:04:40 +0200 (IST) Received: from HOME-C4E4A596F7 ([84.228.70.69]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LU400CFXP7QY030@a-mtaout20.012.net.il>; Fri, 04 Nov 2011 11:04:39 +0200 (IST) Date: Fri, 04 Nov 2011 11:04:43 +0200 From: Eli Zaretskii Subject: Re: bug#9948: valgrind warning: Conditional jump or move depends on uninitialised value(s) in redisplay_window In-reply-to: X-012-Sender: halo1@inter.net.il To: Dan Nicolaescu Message-id: <83vcr0l0lw.fsf@gnu.org> References: <83y5vwlujs.fsf@gnu.org> X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 9948 Cc: 9948@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.0 (--) > From: Dan Nicolaescu > Cc: 9948@debbugs.gnu.org > Date: Thu, 03 Nov 2011 19:30:55 -0400 > > Eli Zaretskii writes: > > >> From: Dan Nicolaescu > >> Date: Thu, 03 Nov 2011 17:55:03 -0400 > >> > >> aggressive = > >> scrolling_up > >> ? BVAR (current_buffer, scroll_up_aggressively) > >> : BVAR (current_buffer, scroll_down_aggressively); > >> ^^^^^^^^^^^^^^^^^^ > >> This one > > > > How can this be uninitialized? This is a buffer-local value of a > > variable that is initialized to nil on buffer.c. > > The line might be incorrect, are all the variables in that expression > initialized correctly? I think so, yes. The only other variables are: . current_buffer -- a global variable that always has some value . scrolling_up -- computed in the line above this snippet. It depends on margin_pos, which is initialized at the beginning of the parent block. The BVAR macro doesn't reference any variables except its first argument. So I'm really puzzled about this one. Is there any way to ask valgrind for a more detailed report? From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 04 09:08:28 2011 Received: (at 9948) by debbugs.gnu.org; 4 Nov 2011 13:08:28 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RMJVU-0001Yz-6C for submit@debbugs.gnu.org; Fri, 04 Nov 2011 09:08:28 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RMJVS-0001Yt-5y for 9948@debbugs.gnu.org; Fri, 04 Nov 2011 09:08:26 -0400 Received: from dann by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1RMJSx-00013X-5H; Fri, 04 Nov 2011 09:05:51 -0400 From: Dan Nicolaescu To: Eli Zaretskii Subject: Re: bug#9948: valgrind warning: Conditional jump or move depends on uninitialised value(s) in redisplay_window References: <83y5vwlujs.fsf@gnu.org> <83vcr0l0lw.fsf@gnu.org> Date: Fri, 04 Nov 2011 09:05:51 -0400 In-Reply-To: <83vcr0l0lw.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 04 Nov 2011 11:04:43 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.5 (------) X-Debbugs-Envelope-To: 9948 Cc: 9948@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.5 (------) Eli Zaretskii writes: >> From: Dan Nicolaescu >> Cc: 9948@debbugs.gnu.org >> Date: Thu, 03 Nov 2011 19:30:55 -0400 >> >> Eli Zaretskii writes: >> >> >> From: Dan Nicolaescu >> >> Date: Thu, 03 Nov 2011 17:55:03 -0400 >> >> >> >> aggressive = >> >> scrolling_up >> >> ? BVAR (current_buffer, scroll_up_aggressively) >> >> : BVAR (current_buffer, scroll_down_aggressively); >> >> ^^^^^^^^^^^^^^^^^^ >> >> This one >> > >> > How can this be uninitialized? This is a buffer-local value of a >> > variable that is initialized to nil on buffer.c. >> >> The line might be incorrect, are all the variables in that expression >> initialized correctly? > > I think so, yes. The only other variables are: > > . current_buffer -- a global variable that always has some value > > . scrolling_up -- computed in the line above this snippet. It > depends on margin_pos, which is initialized at the beginning of > the parent block. > > The BVAR macro doesn't reference any variables except its first > argument. > > So I'm really puzzled about this one. Is there any way to ask > valgrind for a more detailed report? It looks like there's a --track-origins=yes that might help. Now just need to reproduce the same issue (which occurred after quite a bit of random editing/playing around, so it might not be easy...). From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 07 00:07:33 2011 Received: (at 9948) by debbugs.gnu.org; 7 Nov 2011 05:07:33 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RNHQj-0002GF-7K for submit@debbugs.gnu.org; Mon, 07 Nov 2011 00:07:33 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RNHQe-0002G4-P3 for 9948@debbugs.gnu.org; Mon, 07 Nov 2011 00:07:30 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 9195239E800A for <9948@debbugs.gnu.org>; Sun, 6 Nov 2011 21:04:37 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3SGj+7YstBVd for <9948@debbugs.gnu.org>; Sun, 6 Nov 2011 21:04:37 -0800 (PST) Received: from [192.168.1.10] (pool-71-189-109-235.lsanca.fios.verizon.net [71.189.109.235]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 1D90E39E8007 for <9948@debbugs.gnu.org>; Sun, 6 Nov 2011 21:04:37 -0800 (PST) Message-ID: <4EB766E8.5050908@cs.ucla.edu> Date: Sun, 06 Nov 2011 21:04:40 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: 9948@debbugs.gnu.org Subject: Re: valgrind warning: Conditional jump or move depends on uninitialised value(s) in redisplay_window Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.9 (--) X-Debbugs-Envelope-To: 9948 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.9 (--) --track-origins=yes should help, but in the meantime, valgrind's bug report doesn't necessarily mean that no code ever set scrolling_up. It could be that scrolling_up was set this way: scrolling_up = PT > margin_pos; but that margin_pos wasn't properly initialized. For example, suppose margin_pos was set this way: margin_pos = IT_CHARPOS (it1); This initialization would not be correct if IT_CHARPOS (it1) referenced an uninitialized variable. Unfortunately valgrind won't report any error in IT_CHARPOS (it1) until scrolling_up is used. That's because it does not report use of uninitialized storage: it reports only when conditional branches or syscalls or addresses depend on the contents of the uninitialized storage. It's too bad that valgrind works this way. It'd be more convenient if it reported use of uninitialized storage right away. But it'd be hard for valgrind to do better, without reporting lots of false positives for structures that contain holes, so it is what it is. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 07 01:03:45 2011 Received: (at 9948) by debbugs.gnu.org; 7 Nov 2011 06:03:45 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RNIJ6-0003Vf-Jk for submit@debbugs.gnu.org; Mon, 07 Nov 2011 01:03:45 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RNIJ3-0003VX-Ku for 9948@debbugs.gnu.org; Mon, 07 Nov 2011 01:03:43 -0500 Received: from eliz by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1RNIGI-0007Jl-UP; Mon, 07 Nov 2011 01:00:50 -0500 Date: Mon, 07 Nov 2011 01:00:50 -0500 Message-Id: From: Eli Zaretskii To: Paul Eggert In-reply-to: <4EB766E8.5050908@cs.ucla.edu> (message from Paul Eggert on Sun, 06 Nov 2011 21:04:40 -0800) Subject: Re: bug#9948: valgrind warning: Conditional jump or move depends on uninitialised value(s) in redisplay_window References: <4EB766E8.5050908@cs.ucla.edu> X-Spam-Score: -6.6 (------) X-Debbugs-Envelope-To: 9948 Cc: 9948@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) > Date: Sun, 06 Nov 2011 21:04:40 -0800 > From: Paul Eggert > > --track-origins=yes should help, but in the meantime, valgrind's > bug report doesn't necessarily mean that no code ever set scrolling_up. > > It could be that scrolling_up was set this way: > > scrolling_up = PT > margin_pos; > > but that margin_pos wasn't properly initialized. For example, suppose > margin_pos was set this way: > > margin_pos = IT_CHARPOS (it1); > > This initialization would not be correct if IT_CHARPOS (it1) referenced > an uninitialized variable. IT_CHARPOS is defined as follows: #define CHARPOS(POS) (POS).charpos #define IT_CHARPOS(IT) CHARPOS ((IT).current.pos) And margin_pos is computed as follows: EMACS_INT margin_pos = CHARPOS (startp); <<<<<<<<<<<<<< int scrolling_up; Lisp_Object aggressive; /* If there is a scroll margin at the top of the window, find its character position. */ if (margin /* Cannot call start_display if startp is not in the accessible region of the buffer. This can happen when we have just switched to a different buffer and/or changed its restriction. In that case, startp is initialized to the character position 1 (BEG) because we did not yet have chance to display the buffer even once. */ && BEGV <= CHARPOS (startp) && CHARPOS (startp) <= ZV) { struct it it1; void *it1data = NULL; SAVE_IT (it1, it, it1data); start_display (&it1, w, startp); move_it_vertically (&it1, margin); margin_pos = IT_CHARPOS (it1); <<<<<<<<<<<<<<<<<< RESTORE_IT (&it, &it, it1data); } scrolling_up = PT > margin_pos; aggressive = scrolling_up ? BVAR (current_buffer, scroll_up_aggressively) : BVAR (current_buffer, scroll_down_aggressively); Both `startp' and `it1' have a valid CHARPOS, the former by virtue of this (near the beginning of the function): SET_TEXT_POS_FROM_MARKER (startp, w->start); and the latter by virtue of the start_display call above, which initializes `it1's character position to `startp'. Again, I don't see how any of this could involve an uninitialized variable. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 07 01:11:45 2011 Received: (at 9948) by debbugs.gnu.org; 7 Nov 2011 06:11:45 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RNIQr-0003ik-0P for submit@debbugs.gnu.org; Mon, 07 Nov 2011 01:11:45 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RNIQo-0003id-I0 for 9948@debbugs.gnu.org; Mon, 07 Nov 2011 01:11:43 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 2A79B39E800D; Sun, 6 Nov 2011 22:08:52 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QUnFlN753KWk; Sun, 6 Nov 2011 22:08:51 -0800 (PST) Received: from [192.168.1.10] (pool-71-189-109-235.lsanca.fios.verizon.net [71.189.109.235]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 7895339E8007; Sun, 6 Nov 2011 22:08:51 -0800 (PST) Message-ID: <4EB775F6.40405@cs.ucla.edu> Date: Sun, 06 Nov 2011 22:08:54 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#9948: valgrind warning: Conditional jump or move depends on uninitialised value(s) in redisplay_window References: <4EB766E8.5050908@cs.ucla.edu> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.9 (--) X-Debbugs-Envelope-To: 9948 Cc: 9948@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.9 (--) On 11/06/11 22:00, Eli Zaretskii wrote: > Again, I don't see how any of this could involve an uninitialized > variable. I don't either, but the analysis you gave is not complete. For example: SET_TEXT_POS_FROM_MARKER (startp, w->start); does not set startp to a valid charpos if w->start points to uninitialized data. A problem with valgrind is that this sort of analysis can be very painful to do, if one wants to do it completely. I found this out the hard way when trying to apply valgrind to Emacs's garbage collector.... From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 07 01:33:44 2011 Received: (at 9948) by debbugs.gnu.org; 7 Nov 2011 06:33:44 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RNIm7-0004Ec-Mx for submit@debbugs.gnu.org; Mon, 07 Nov 2011 01:33:43 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RNIm5-0004ES-5C for 9948@debbugs.gnu.org; Mon, 07 Nov 2011 01:33:42 -0500 Received: from eliz by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1RNIjK-000056-8q; Mon, 07 Nov 2011 01:30:50 -0500 Date: Mon, 07 Nov 2011 01:30:50 -0500 Message-Id: From: Eli Zaretskii To: Paul Eggert In-reply-to: <4EB775F6.40405@cs.ucla.edu> (message from Paul Eggert on Sun, 06 Nov 2011 22:08:54 -0800) Subject: Re: bug#9948: valgrind warning: Conditional jump or move depends on uninitialised value(s) in redisplay_window References: <4EB766E8.5050908@cs.ucla.edu> <4EB775F6.40405@cs.ucla.edu> X-Spam-Score: -6.6 (------) X-Debbugs-Envelope-To: 9948 Cc: 9948@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) > Date: Sun, 06 Nov 2011 22:08:54 -0800 > From: Paul Eggert > CC: 9948@debbugs.gnu.org > > SET_TEXT_POS_FROM_MARKER (startp, w->start); > > does not set startp to a valid charpos if w->start > points to uninitialized data. w->startp is the window-start of the window represented by `w'. It is a very important player in displaying the window. If that is uninitialized, we have a much larger catastrophe on our hands than some obscure local variable that _could_ be uninitialized ;-) IOW, if w->startp does not have a valid value, Emacs will crash pronto. From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 10 23:49:49 2016 Received: (at 9948) by debbugs.gnu.org; 11 Jul 2016 03:49:49 +0000 Received: from localhost ([127.0.0.1]:45833 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bMSE9-0000qa-BO for submit@debbugs.gnu.org; Sun, 10 Jul 2016 23:49:49 -0400 Received: from mail-io0-f170.google.com ([209.85.223.170]:34182) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bMSE7-0000q9-75; Sun, 10 Jul 2016 23:49:47 -0400 Received: by mail-io0-f170.google.com with SMTP id q83so26376452iod.1; Sun, 10 Jul 2016 20:49:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=xU2ixfBQ7uRzCZ57pLc9CJV6ofPApprkoffKmG+kr7c=; b=nUAj4Xu4+0fB+HJQW2H1gbauzq8+cmWEmnqujkPf+gOtmmwvs1twOWfSFKlfFgjrUN L9ksGDwJanmXvShsYiTAy/b9+SVGy22gI1XMxW8LkwF01DtPr1jsoWjxy1FBqa4Nk8r0 J8zEg1kv/iepJ3P7UA0IYiOCaROriQd6h2PYCJYfCAqfP7B+bd4tBgjOqgkfP23ex2Nx QMvOBvl75rPaRke7JUWcB52YGt0K2tim9THcQoIthu6tstmYb2nCnu0QsdVBDDn+MSrY FmhCOBMB6Mtr6GB9gcR4TbTLOYgj5ISyEVR553UwNDD+4pDpL1z35UtZ7GUZoMBWk1m2 99Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=xU2ixfBQ7uRzCZ57pLc9CJV6ofPApprkoffKmG+kr7c=; b=I5SxLjy+tB8tjOgimCr5hQtMT35+Jc6bP21/IvdySGHSawdHWBNAz7/IGoPiNJyRDe vCsFgd9yUASw2t/ontryZG0uJHSzmwXxA6287CKTtzYpEBgmkVxrH3eItYnUzmSLuTdi WnTVi1tR1qCvSGbTOrHc/47gfQzIvyOXH2LHLAn24l9cvSpBwrJntvRQH8EOSnQg4CwQ gpQOSN4xX16V38OJeRf8ZyMXfpb1f6RV8K18nK4aQqDQYZxszZulvtWhh0erFNPuSgQb fhYJBjeXs+V6NaV/+gDJD2QPG32Ryc2pitGmRwlmHAjnw2gzM3ga8XPZonuE9/qIQegB s3Gw== X-Gm-Message-State: ALyK8tIjLMiWBOxYBv1v7ujBRR9IZF8lB+uZxMS5gNkYsklno1PVju1a+EtM3si5ntmKVA== X-Received: by 10.107.13.82 with SMTP id 79mr20317529ion.97.1468208981644; Sun, 10 Jul 2016 20:49:41 -0700 (PDT) Received: from zony (206-188-64-44.cpe.distributel.net. [206.188.64.44]) by smtp.googlemail.com with ESMTPSA id e201sm44462itc.21.2016.07.10.20.49.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Jul 2016 20:49:41 -0700 (PDT) From: npostavs@users.sourceforge.net To: Dan Nicolaescu Subject: Re: bug#9948: valgrind warning: Conditional jump or move depends on uninitialised value(s) in redisplay_window References: <83y5vwlujs.fsf@gnu.org> <83vcr0l0lw.fsf@gnu.org> Date: Sun, 10 Jul 2016 23:49:39 -0400 In-Reply-To: (Dan Nicolaescu's message of "Fri, 04 Nov 2011 09:05:51 -0400") Message-ID: <87twfwg7fw.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 9948 Cc: 9948@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) tags 9948 unreproducible close 9948 quit Dan Nicolaescu writes: > It looks like there's a --track-origins=yes that might help. > Now just need to reproduce the same issue (which occurred after quite a > bit of random editing/playing around, so it might not be easy...). I guess it was never reproduced. From unknown Sat Jun 21 17:33:50 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 08 Aug 2016 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator