From unknown Fri Aug 15 16:19:54 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#9990 <9990@debbugs.gnu.org> To: bug#9990 <9990@debbugs.gnu.org> Subject: Status: valgrind warning in add_row_entry Reply-To: bug#9990 <9990@debbugs.gnu.org> Date: Fri, 15 Aug 2025 23:19:54 +0000 retitle 9990 valgrind warning in add_row_entry reassign 9990 emacs submitter 9990 Dan Nicolaescu severity 9990 normal tag 9990 moreinfo thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 08 09:30:29 2011 Received: (at submit) by debbugs.gnu.org; 8 Nov 2011 14:30:29 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RNmh2-0002LI-77 for submit@debbugs.gnu.org; Tue, 08 Nov 2011 09:30:29 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RNmgx-0002L8-Ir for submit@debbugs.gnu.org; Tue, 08 Nov 2011 09:30:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RNmdx-0004JT-Hp for submit@debbugs.gnu.org; Tue, 08 Nov 2011 09:27:25 -0500 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]:55159) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNmdx-0004JP-FK for submit@debbugs.gnu.org; Tue, 08 Nov 2011 09:27:17 -0500 Received: from eggs.gnu.org ([140.186.70.92]:40954) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNmdw-0006NJ-KH for bug-gnu-emacs@gnu.org; Tue, 08 Nov 2011 09:27:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RNmdn-0004IO-63 for bug-gnu-emacs@gnu.org; Tue, 08 Nov 2011 09:27:16 -0500 Received: from fencepost.gnu.org ([140.186.70.10]:56506) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNmdn-0004ID-2Z for bug-gnu-emacs@gnu.org; Tue, 08 Nov 2011 09:27:07 -0500 Received: from dann by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1RNmdm-0003al-Hf for bug-gnu-emacs@gnu.org; Tue, 08 Nov 2011 09:27:06 -0500 From: Dan Nicolaescu To: bug-gnu-emacs@gnu.org Subject: valgrind warning in add_row_entry Date: Tue, 08 Nov 2011 09:27:06 -0500 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.6 (------) 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.6 (------) valgrind ./temacs -Q gets this warning: ==7487== Use of uninitialised value of size 8 ==7487== at 0x4140F4: update_window (dispnew.c:4212) ==7487== by 0x414F32: update_window_tree (dispnew.c:3326) ==7487== by 0x414F0E: update_window_tree (dispnew.c:3324) ==7487== by 0x4181FD: update_frame (dispnew.c:3253) ==7487== by 0x443EDB: redisplay_internal (xdisp.c:13175) ==7487== by 0x4F6F47: read_char (keyboard.c:2443) ==7487== by 0x4F9406: read_key_sequence.constprop.14 (keyboard.c:9290) ==7487== by 0x4FB0D4: command_loop_1 (keyboard.c:1447) ==7487== by 0x560015: internal_condition_case (eval.c:1499) ==7487== by 0x4EE4AD: command_loop_2 (keyboard.c:1158) ==7487== by 0x55FEF7: internal_catch (eval.c:1256) ==7487== by 0x4EFA36: recursive_edit_1 (keyboard.c:1137) ==7487== ==7487== ==7487== ---- Attach to debugger ? --- [Return/N/n/Y/y/C/c] ---- Y The line in question is: 4212 entry = row_table[i]; (gdb) p i $1 = 0x157 (gdb) p row_table[i] $2 = (struct row_entry *) 0x0 (gdb) p row_table_size $3 = 0x193 Is it possible for the contents of row_table to be uninitialized? Is this warning a false positive? From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 08 12:24:56 2011 Received: (at 9990) by debbugs.gnu.org; 8 Nov 2011 17:24:56 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RNpPr-0000Pu-F2 for submit@debbugs.gnu.org; Tue, 08 Nov 2011 12:24:55 -0500 Received: from mtaout22.012.net.il ([80.179.55.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RNpPn-0000PW-GV for 9990@debbugs.gnu.org; Tue, 08 Nov 2011 12:24:53 -0500 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0LUC00500QIZZM00@a-mtaout22.012.net.il> for 9990@debbugs.gnu.org; Tue, 08 Nov 2011 19:19:09 +0200 (IST) Received: from HOME-C4E4A596F7 ([84.228.42.212]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LUC0039AQRVJST0@a-mtaout22.012.net.il>; Tue, 08 Nov 2011 19:19:09 +0200 (IST) Date: Tue, 08 Nov 2011 19:17:07 +0200 From: Eli Zaretskii Subject: Re: bug#9990: valgrind warning in add_row_entry In-reply-to: X-012-Sender: halo1@inter.net.il To: Dan Nicolaescu Message-id: <83k47ailf0.fsf@gnu.org> References: X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 9990 Cc: 9990@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: Tue, 08 Nov 2011 09:27:06 -0500 > > > valgrind ./temacs -Q gets this warning: > > ==7487== Use of uninitialised value of size 8 > ==7487== at 0x4140F4: update_window (dispnew.c:4212) > ==7487== by 0x414F32: update_window_tree (dispnew.c:3326) > ==7487== by 0x414F0E: update_window_tree (dispnew.c:3324) > ==7487== by 0x4181FD: update_frame (dispnew.c:3253) > ==7487== by 0x443EDB: redisplay_internal (xdisp.c:13175) > ==7487== by 0x4F6F47: read_char (keyboard.c:2443) > ==7487== by 0x4F9406: read_key_sequence.constprop.14 (keyboard.c:9290) > ==7487== by 0x4FB0D4: command_loop_1 (keyboard.c:1447) > ==7487== by 0x560015: internal_condition_case (eval.c:1499) > ==7487== by 0x4EE4AD: command_loop_2 (keyboard.c:1158) > ==7487== by 0x55FEF7: internal_catch (eval.c:1256) > ==7487== by 0x4EFA36: recursive_edit_1 (keyboard.c:1137) > ==7487== > ==7487== > ==7487== ---- Attach to debugger ? --- [Return/N/n/Y/y/C/c] ---- Y > > The line in question is: > > 4212 entry = row_table[i]; > > > (gdb) p i > $1 = 0x157 > (gdb) p row_table[i] > $2 = (struct row_entry *) 0x0 > (gdb) p row_table_size > $3 = 0x193 > > Is it possible for the contents of row_table to be uninitialized? Is this warning a false positive? row_table and row_table_size are static variables. So at least in temacs they should be initialized to zero, by this code in scrolling_window: n = desired_matrix->nrows; n += current_matrix->nrows; if (row_table_size < 3 * n) { ptrdiff_t size = next_almost_prime (3 * n); row_table = xnrealloc (row_table, size, sizeof *row_table); row_table_size = size; memset (row_table, 0, size * sizeof *row_table); } Because row_table_size is initially zero, the first call to scrolling_window will allocate row_table[] and zero it out. The only call to add_row_entry, the function where line 4212 belongs, is in the same scrolling_window, a few lines _below_ the above fragment that allocates and zeroes out row_table[]. So I don't see how row_table[i] could be uninitialized for any i that is less than row_table_size. Does valgrind know that row_table_size is initially zero because it is static? The other possibility I see is that one or both of w->current_matrix->nrows and w->desired_matrix->nrows are uninitialized. But I think if that were so, Emacs would crash and burn trying to display such a window. Yet another possibility is that the argument ROW passed to add_row_entry is not initialized. Then row->hash is a random value and i inside add_row_entry is also a random value. Can you look at these two loops inside scrolling_window: /* Add rows from the current and desired matrix to the hash table row_hash_table to be able to find equal ones quickly. */ for (i = first_old; i < last_old; ++i) { if (MATRIX_ROW (current_matrix, i)->enabled_p) { entry = add_row_entry (MATRIX_ROW (current_matrix, i)); old_lines[i] = entry; ++entry->old_uses; } else old_lines[i] = NULL; } for (i = first_new; i < last_new; ++i) { xassert (MATRIX_ROW_ENABLED_P (desired_matrix, i)); entry = add_row_entry (MATRIX_ROW (desired_matrix, i)); ++entry->new_uses; entry->new_line_number = i; new_lines[i] = entry; } and see what are the values of first_old, last_old, first_new, and last_new here, and whether the corresponding glyph rows look reasonable, including their hash values? Or maybe just look at the row passed to add_row_entry. You can display a given glyph_row structure with the pgrowx command in GDB (but it won't show the hash value, only how the row will look on the screen). Another command is prowx. From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 08 13:44:33 2011 Received: (at 9990) by debbugs.gnu.org; 8 Nov 2011 18:44: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 1RNqev-0002KJ-4d for submit@debbugs.gnu.org; Tue, 08 Nov 2011 13:44:33 -0500 Received: from mail-out.m-online.net ([212.18.0.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RNqet-0002KC-AU for 9990@debbugs.gnu.org; Tue, 08 Nov 2011 13:44:32 -0500 Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 2ADA7188B5A0; Tue, 8 Nov 2011 19:46:09 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.8.164]) by mail.m-online.net (Postfix) with ESMTP id 1671A1C00054; Tue, 8 Nov 2011 19:44:30 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.180]) by localhost (dynscan1.mail.m-online.net [192.168.8.164]) (amavisd-new, port 10024) with ESMTP id VHw2st0HBaj0; Tue, 8 Nov 2011 19:44:28 +0100 (CET) Received: from igel.home (ppp-88-217-115-129.dynamic.mnet-online.de [88.217.115.129]) by mail.mnet-online.de (Postfix) with ESMTP; Tue, 8 Nov 2011 19:44:28 +0100 (CET) Received: by igel.home (Postfix, from userid 501) id 5BFBFCA29C; Tue, 8 Nov 2011 19:44:28 +0100 (CET) From: Andreas Schwab To: Eli Zaretskii Subject: Re: bug#9990: valgrind warning in add_row_entry References: <83k47ailf0.fsf@gnu.org> X-Yow: Uh-oh!! I'm having TOO MUCH FUN!! Date: Tue, 08 Nov 2011 19:44:28 +0100 In-Reply-To: <83k47ailf0.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 08 Nov 2011 19:17:07 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 9990 Cc: Dan Nicolaescu , 9990@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.6 (--) Eli Zaretskii writes: > Does valgrind know that row_table_size is initially zero because it is > static? valgrind does not know anything about variables, only about memory locations. It operates at the machine language level. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 08 15:38:47 2011 Received: (at 9990) by debbugs.gnu.org; 8 Nov 2011 20:38:47 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RNsRT-0005nQ-7r for submit@debbugs.gnu.org; Tue, 08 Nov 2011 15:38:47 -0500 Received: from mtaout20.012.net.il ([80.179.55.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RNsRR-0005nB-0F for 9990@debbugs.gnu.org; Tue, 08 Nov 2011 15:38:46 -0500 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0LUC00A00ZWVQH00@a-mtaout20.012.net.il> for 9990@debbugs.gnu.org; Tue, 08 Nov 2011 22:37:55 +0200 (IST) Received: from HOME-C4E4A596F7 ([84.228.42.212]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LUC0072SZZ6Z711@a-mtaout20.012.net.il>; Tue, 08 Nov 2011 22:37:55 +0200 (IST) Date: Tue, 08 Nov 2011 22:35:54 +0200 From: Eli Zaretskii Subject: Re: bug#9990: valgrind warning in add_row_entry In-reply-to: X-012-Sender: halo1@inter.net.il To: Andreas Schwab Message-id: <83ty6egxn9.fsf@gnu.org> References: <83k47ailf0.fsf@gnu.org> X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 9990 Cc: dann@gnu.org, 9990@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: Andreas Schwab > Cc: Dan Nicolaescu , 9990@debbugs.gnu.org > Date: Tue, 08 Nov 2011 19:44:28 +0100 > > Eli Zaretskii writes: > > > Does valgrind know that row_table_size is initially zero because it is > > static? > > valgrind does not know anything about variables, only about memory > locations. It operates at the machine language level. Does that mean valgrind can potentially flag as uninitialized every static variable that isn't explicitly initialized at run time? Because AFAIK static variables are initialized by the linker (is that right?). From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 11 00:56:36 2011 Received: (at 9990) by debbugs.gnu.org; 11 Nov 2011 05:56:36 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ROk6O-0000Az-HO for submit@debbugs.gnu.org; Fri, 11 Nov 2011 00:56:36 -0500 Received: from fencepost.gnu.org ([140.186.70.10] ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ROk6L-0000Ap-OI for 9990@debbugs.gnu.org; Fri, 11 Nov 2011 00:56:34 -0500 Received: from dann by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1ROk66-0004ba-CL; Fri, 11 Nov 2011 00:56:18 -0500 From: Dan Nicolaescu To: Eli Zaretskii Subject: Re: bug#9990: valgrind warning in add_row_entry References: <83k47ailf0.fsf@gnu.org> Date: Fri, 11 Nov 2011 00:56:18 -0500 In-Reply-To: <83k47ailf0.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 08 Nov 2011 19:17:07 +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.6 (------) X-Debbugs-Envelope-To: 9990 Cc: 9990@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.6 (------) Eli Zaretskii writes: >> From: Dan Nicolaescu >> Date: Tue, 08 Nov 2011 09:27:06 -0500 >> >> >> valgrind ./temacs -Q gets this warning: >> >> ==7487== Use of uninitialised value of size 8 >> ==7487== at 0x4140F4: update_window (dispnew.c:4212) >> ==7487== by 0x414F32: update_window_tree (dispnew.c:3326) >> ==7487== by 0x414F0E: update_window_tree (dispnew.c:3324) >> ==7487== by 0x4181FD: update_frame (dispnew.c:3253) >> ==7487== by 0x443EDB: redisplay_internal (xdisp.c:13175) >> ==7487== by 0x4F6F47: read_char (keyboard.c:2443) >> ==7487== by 0x4F9406: read_key_sequence.constprop.14 (keyboard.c:9290) >> ==7487== by 0x4FB0D4: command_loop_1 (keyboard.c:1447) >> ==7487== by 0x560015: internal_condition_case (eval.c:1499) >> ==7487== by 0x4EE4AD: command_loop_2 (keyboard.c:1158) >> ==7487== by 0x55FEF7: internal_catch (eval.c:1256) >> ==7487== by 0x4EFA36: recursive_edit_1 (keyboard.c:1137) >> ==7487== >> ==7487== >> ==7487== ---- Attach to debugger ? --- [Return/N/n/Y/y/C/c] ---- Y >> >> The line in question is: >> >> 4212 entry = row_table[i]; >> >> >> (gdb) p i >> $1 = 0x157 >> (gdb) p row_table[i] >> $2 = (struct row_entry *) 0x0 >> (gdb) p row_table_size >> $3 = 0x193 >> >> Is it possible for the contents of row_table to be uninitialized? Is this warning a false positive? > > row_table and row_table_size are static variables. So at least in > temacs they should be initialized to zero, by this code in > scrolling_window: > > n = desired_matrix->nrows; > n += current_matrix->nrows; > if (row_table_size < 3 * n) > { > ptrdiff_t size = next_almost_prime (3 * n); > row_table = xnrealloc (row_table, size, sizeof *row_table); > row_table_size = size; > memset (row_table, 0, size * sizeof *row_table); > } > > Because row_table_size is initially zero, the first call to > scrolling_window will allocate row_table[] and zero it out. > > The only call to add_row_entry, the function where line 4212 belongs, > is in the same scrolling_window, a few lines _below_ the above > fragment that allocates and zeroes out row_table[]. > > So I don't see how row_table[i] could be uninitialized for any i that > is less than row_table_size. > > Does valgrind know that row_table_size is initially zero because it is > static? I think it should. I got another (maybe) similar one. For this one I had the option that shows the location of uninitialized variable. This happened after doing C-h H. ==4752== Conditional jump or move depends on uninitialised value(s) ==4752== at 0x4137ED: update_window (dispnew.c:1276) ==4752== by 0x414F02: update_window_tree (dispnew.c:3326) ==4752== by 0x4181CD: update_frame (dispnew.c:3253) ==4752== by 0x440E7B: redisplay_internal (xdisp.c:13175) ==4752== by 0x4F0A87: read_char (keyboard.c:2443) ==4752== by 0x4F2F46: read_key_sequence.constprop.14 (keyboard.c:9290) ==4752== by 0x4F4C14: command_loop_1 (keyboard.c:1447) ==4752== by 0x559B55: internal_condition_case (eval.c:1499) ==4752== by 0x4E7FED: command_loop_2 (keyboard.c:1158) ==4752== by 0x559A37: internal_catch (eval.c:1256) ==4752== by 0x4E94EE: recursive_edit_1 (keyboard.c:1123) ==4752== by 0x515CFB: read_minibuf (minibuf.c:677) ==4752== Uninitialised value was created by a heap allocation ==4752== at 0x4A0649D: malloc (vg_replace_malloc.c:236) ==4752== by 0x5407CF: xrealloc (alloc.c:742) ==4752== by 0x411001: adjust_glyph_matrix (dispnew.c:580) ==4752== by 0x41148C: allocate_matrices_for_window_redisplay (dispnew.c:1838) ==4752== by 0x4119DC: adjust_frame_glyphs (dispnew.c:2167) ==4752== by 0x416BC9: adjust_glyphs (dispnew.c:1860) ==4752== by 0x4686A7: Fdelete_other_windows_internal (window.c:2809) ==4752== by 0x55B9FB: Ffuncall (eval.c:2977) ==4752== by 0x593BE5: exec_byte_code (bytecode.c:785) ==4752== by 0x55AE2A: eval_sub (eval.c:2328) ==4752== by 0x559A37: internal_catch (eval.c:1256) ==4752== by 0x594567: exec_byte_code (bytecode.c:966) ==4752== > and see what are the values of first_old, last_old, first_new, and > last_new here, and whether the corresponding glyph rows look > reasonable, including their hash values? Or maybe just look at the > row passed to add_row_entry. You can display a given glyph_row > structure with the pgrowx command in GDB (but it won't show the hash > value, only how the row will look on the screen). Another command is > prowx. I will do this when it happens again. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 11 10:33:21 2011 Received: (at 9990) by debbugs.gnu.org; 11 Nov 2011 15:33:22 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ROt6X-0005km-JZ for submit@debbugs.gnu.org; Fri, 11 Nov 2011 10:33:21 -0500 Received: from mtaout22.012.net.il ([80.179.55.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ROt6U-0005kZ-96 for 9990@debbugs.gnu.org; Fri, 11 Nov 2011 10:33:19 -0500 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0LUI005005RJSU00@a-mtaout22.012.net.il> for 9990@debbugs.gnu.org; Fri, 11 Nov 2011 17:32:55 +0200 (IST) Received: from HOME-C4E4A596F7 ([77.126.231.130]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LUI005WI5UUJC60@a-mtaout22.012.net.il>; Fri, 11 Nov 2011 17:32:55 +0200 (IST) Date: Fri, 11 Nov 2011 17:30:58 +0200 From: Eli Zaretskii Subject: Re: bug#9990: valgrind warning in add_row_entry In-reply-to: X-012-Sender: halo1@inter.net.il To: Dan Nicolaescu Message-id: <83zkg2fzgt.fsf@gnu.org> References: <83k47ailf0.fsf@gnu.org> X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 9990 Cc: 9990@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.1 (--) > From: Dan Nicolaescu > Cc: 9990@debbugs.gnu.org > Date: Fri, 11 Nov 2011 00:56:18 -0500 > > I got another (maybe) similar one. For this one I had the option that > shows the location of uninitialized variable. This happened after doing C-h H. Is this reproducible? If so, can you tell how to reproduce it? > ==4752== Conditional jump or move depends on uninitialised value(s) > ==4752== at 0x4137ED: update_window (dispnew.c:1276) > ==4752== by 0x414F02: update_window_tree (dispnew.c:3326) > ==4752== by 0x4181CD: update_frame (dispnew.c:3253) > ==4752== by 0x440E7B: redisplay_internal (xdisp.c:13175) > ==4752== by 0x4F0A87: read_char (keyboard.c:2443) > ==4752== by 0x4F2F46: read_key_sequence.constprop.14 (keyboard.c:9290) > ==4752== by 0x4F4C14: command_loop_1 (keyboard.c:1447) > ==4752== by 0x559B55: internal_condition_case (eval.c:1499) > ==4752== by 0x4E7FED: command_loop_2 (keyboard.c:1158) > ==4752== by 0x559A37: internal_catch (eval.c:1256) > ==4752== by 0x4E94EE: recursive_edit_1 (keyboard.c:1123) > ==4752== by 0x515CFB: read_minibuf (minibuf.c:677) > ==4752== Uninitialised value was created by a heap allocation > ==4752== at 0x4A0649D: malloc (vg_replace_malloc.c:236) > ==4752== by 0x5407CF: xrealloc (alloc.c:742) > ==4752== by 0x411001: adjust_glyph_matrix (dispnew.c:580) > ==4752== by 0x41148C: allocate_matrices_for_window_redisplay (dispnew.c:1838) > ==4752== by 0x4119DC: adjust_frame_glyphs (dispnew.c:2167) > ==4752== by 0x416BC9: adjust_glyphs (dispnew.c:1860) > ==4752== by 0x4686A7: Fdelete_other_windows_internal (window.c:2809) > ==4752== by 0x55B9FB: Ffuncall (eval.c:2977) > ==4752== by 0x593BE5: exec_byte_code (bytecode.c:785) > ==4752== by 0x55AE2A: eval_sub (eval.c:2328) > ==4752== by 0x559A37: internal_catch (eval.c:1256) > ==4752== by 0x594567: exec_byte_code (bytecode.c:966) It seems to tell that some glyph row(s) whose glyphs are reallocated here: while (row < end) { row->glyphs[LEFT_MARGIN_AREA] = xnrealloc (row->glyphs[LEFT_MARGIN_AREA], <<<<<<<<<<< dim.width, sizeof (struct glyph)); don't have their hash values initialized, and so this comparison within row_equal_p: if (a == b) return 1; else if (a->hash != b->hash) <<<<<<<<<<<<<<<<<<<<< return 0; else { uses uninitialized value. The strange thing is, the above xnrealloc is not supposed to affect the row's hash value in any way, it just reallocates its glyphs. So I cannot make heads or tails out of this. And the hash value is initialized to zero for additional glyph rows added to a glyph matrix, in this fragment: /* Enlarge MATRIX->rows if necessary. New rows are cleared. */ if (matrix->rows_allocated < dim.height) { int old_alloc = matrix->rows_allocated; new_rows = dim.height - matrix->rows_allocated; matrix->rows = xpalloc (matrix->rows, &matrix->rows_allocated, new_rows, INT_MAX, sizeof *matrix->rows); memset (matrix->rows + old_alloc, 0, (matrix->rows_allocated - old_alloc) * sizeof *matrix->rows); } The call to `memset' should zero out all the fields of each glyph_row that were just added to enlarge the matrix. However, I spotted something strange related to the call to row_equal_p, here: /* Skip over rows equal at the bottom. */ i = last_new; j = last_old; while (i - 1 > first_new && j - 1 > first_old && MATRIX_ROW (current_matrix, i - 1)->enabled_p && (MATRIX_ROW (current_matrix, i - 1)->y == MATRIX_ROW (desired_matrix, j - 1)->y) && !MATRIX_ROW (desired_matrix, j - 1)->redraw_fringe_bitmaps_p && row_equal_p (MATRIX_ROW (desired_matrix, i - 1), MATRIX_ROW (current_matrix, j - 1), 1)) --i, --j; Some of these conditions use incorrect indices to access the glyph matrices: `i' should be used for the current matrix and `j' for the desired matrix. Some of these conditions use `i' and `j' correctly, some don't. So it's possible, for example, that the test of the enabled_p flag produces incorrect results, and we then proceed calling row_equal_p on a row which is not enabled and whose hash was not computed by redisplay. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 11 11:03:13 2011 Received: (at 9990) by debbugs.gnu.org; 11 Nov 2011 16:03:13 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ROtZR-0006Rn-28 for submit@debbugs.gnu.org; Fri, 11 Nov 2011 11:03:13 -0500 Received: from mtaout20.012.net.il ([80.179.55.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ROtZO-0006Rb-KI for 9990@debbugs.gnu.org; Fri, 11 Nov 2011 11:03:12 -0500 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0LUI008006Z7DS00@a-mtaout20.012.net.il> for 9990@debbugs.gnu.org; Fri, 11 Nov 2011 18:01:23 +0200 (IST) Received: from HOME-C4E4A596F7 ([77.126.231.130]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LUI007M1766R790@a-mtaout20.012.net.il>; Fri, 11 Nov 2011 18:01:19 +0200 (IST) Date: Fri, 11 Nov 2011 17:59:22 +0200 From: Eli Zaretskii Subject: Re: bug#9990: valgrind warning in add_row_entry In-reply-to: <83zkg2fzgt.fsf@gnu.org> X-012-Sender: halo1@inter.net.il To: dann@gnu.org Message-id: <83vcqqfy5h.fsf@gnu.org> References: <83k47ailf0.fsf@gnu.org> <83zkg2fzgt.fsf@gnu.org> X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 9990 Cc: 9990@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.1 (--) > Date: Fri, 11 Nov 2011 17:30:58 +0200 > From: Eli Zaretskii > Cc: 9990@debbugs.gnu.org > > However, I spotted something strange related to the call to > row_equal_p, here: > > /* Skip over rows equal at the bottom. */ > i = last_new; > j = last_old; > while (i - 1 > first_new > && j - 1 > first_old > && MATRIX_ROW (current_matrix, i - 1)->enabled_p > && (MATRIX_ROW (current_matrix, i - 1)->y > == MATRIX_ROW (desired_matrix, j - 1)->y) > && !MATRIX_ROW (desired_matrix, j - 1)->redraw_fringe_bitmaps_p > && row_equal_p (MATRIX_ROW (desired_matrix, i - 1), > MATRIX_ROW (current_matrix, j - 1), 1)) > --i, --j; > > Some of these conditions use incorrect indices to access the glyph > matrices: `i' should be used for the current matrix and `j' for the > desired matrix. Some of these conditions use `i' and `j' correctly, > some don't. Below is a patch I intend to install, if no one finds any thinko in it. Dan, can you try this and see if it resolves the valgrind complaints (assuming you can reproduce them)? === modified file 'src/dispnew.c' --- src/dispnew.c 2011-10-08 10:58:50 +0000 +++ src/dispnew.c 2011-11-11 15:53:27 +0000 @@ -4334,10 +4334,10 @@ scrolling_window (struct window *w, int j = last_old; while (i - 1 > first_new && j - 1 > first_old - && MATRIX_ROW (current_matrix, i - 1)->enabled_p - && (MATRIX_ROW (current_matrix, i - 1)->y - == MATRIX_ROW (desired_matrix, j - 1)->y) - && !MATRIX_ROW (desired_matrix, j - 1)->redraw_fringe_bitmaps_p + && MATRIX_ROW (current_matrix, j - 1)->enabled_p + && (MATRIX_ROW (current_matrix, j - 1)->y + == MATRIX_ROW (desired_matrix, i - 1)->y) + && !MATRIX_ROW (desired_matrix, i - 1)->redraw_fringe_bitmaps_p && row_equal_p (MATRIX_ROW (desired_matrix, i - 1), MATRIX_ROW (current_matrix, j - 1), 1)) --i, --j; From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 11 15:17:55 2011 Received: (at 9990) by debbugs.gnu.org; 11 Nov 2011 20:17:55 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ROxXu-00067p-V3 for submit@debbugs.gnu.org; Fri, 11 Nov 2011 15:17:55 -0500 Received: from fencepost.gnu.org ([140.186.70.10] ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ROxXs-00067i-Fi for 9990@debbugs.gnu.org; Fri, 11 Nov 2011 15:17:53 -0500 Received: from dann by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1ROxXa-0004mz-5Y; Fri, 11 Nov 2011 15:17:34 -0500 From: Dan Nicolaescu To: Eli Zaretskii Subject: Re: bug#9990: valgrind warning in add_row_entry References: <83k47ailf0.fsf@gnu.org> <83zkg2fzgt.fsf@gnu.org> Date: Fri, 11 Nov 2011 15:17:34 -0500 In-Reply-To: <83zkg2fzgt.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 11 Nov 2011 17:30:58 +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.6 (------) X-Debbugs-Envelope-To: 9990 Cc: 9990@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.6 (------) Eli Zaretskii writes: >> From: Dan Nicolaescu >> Cc: 9990@debbugs.gnu.org >> Date: Fri, 11 Nov 2011 00:56:18 -0500 >> >> I got another (maybe) similar one. For this one I had the option that >> shows the location of uninitialized variable. This happened after doing C-h H. > > Is this reproducible? If so, can you tell how to reproduce it? valgrind ./temacs -Q C-h H From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 11 15:20:39 2011 Received: (at 9990) by debbugs.gnu.org; 11 Nov 2011 20:20:39 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ROxaZ-0006Bj-Ly for submit@debbugs.gnu.org; Fri, 11 Nov 2011 15:20:39 -0500 Received: from fencepost.gnu.org ([140.186.70.10] ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ROxaY-0006Bd-Dg for 9990@debbugs.gnu.org; Fri, 11 Nov 2011 15:20:38 -0500 Received: from dann by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1ROxaF-0004z6-V5; Fri, 11 Nov 2011 15:20:19 -0500 From: Dan Nicolaescu To: Eli Zaretskii Subject: Re: bug#9990: valgrind warning in add_row_entry References: <83k47ailf0.fsf@gnu.org> <83zkg2fzgt.fsf@gnu.org> <83vcqqfy5h.fsf@gnu.org> Date: Fri, 11 Nov 2011 15:20:19 -0500 In-Reply-To: <83vcqqfy5h.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 11 Nov 2011 17:59:22 +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.6 (------) X-Debbugs-Envelope-To: 9990 Cc: 9990@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.6 (------) Eli Zaretskii writes: >> Date: Fri, 11 Nov 2011 17:30:58 +0200 >> From: Eli Zaretskii >> Cc: 9990@debbugs.gnu.org >> >> However, I spotted something strange related to the call to >> row_equal_p, here: >> >> /* Skip over rows equal at the bottom. */ >> i = last_new; >> j = last_old; >> while (i - 1 > first_new >> && j - 1 > first_old >> && MATRIX_ROW (current_matrix, i - 1)->enabled_p >> && (MATRIX_ROW (current_matrix, i - 1)->y >> == MATRIX_ROW (desired_matrix, j - 1)->y) >> && !MATRIX_ROW (desired_matrix, j - 1)->redraw_fringe_bitmaps_p >> && row_equal_p (MATRIX_ROW (desired_matrix, i - 1), >> MATRIX_ROW (current_matrix, j - 1), 1)) >> --i, --j; >> >> Some of these conditions use incorrect indices to access the glyph >> matrices: `i' should be used for the current matrix and `j' for the >> desired matrix. Some of these conditions use `i' and `j' correctly, >> some don't. > > Below is a patch I intend to install, if no one finds any thinko in > it. Dan, can you try this and see if it resolves the valgrind > complaints (assuming you can reproduce them)? > > === modified file 'src/dispnew.c' > --- src/dispnew.c 2011-10-08 10:58:50 +0000 > +++ src/dispnew.c 2011-11-11 15:53:27 +0000 > @@ -4334,10 +4334,10 @@ scrolling_window (struct window *w, int > j = last_old; > while (i - 1 > first_new > && j - 1 > first_old > - && MATRIX_ROW (current_matrix, i - 1)->enabled_p > - && (MATRIX_ROW (current_matrix, i - 1)->y > - == MATRIX_ROW (desired_matrix, j - 1)->y) > - && !MATRIX_ROW (desired_matrix, j - 1)->redraw_fringe_bitmaps_p > + && MATRIX_ROW (current_matrix, j - 1)->enabled_p > + && (MATRIX_ROW (current_matrix, j - 1)->y > + == MATRIX_ROW (desired_matrix, i - 1)->y) > + && !MATRIX_ROW (desired_matrix, i - 1)->redraw_fringe_bitmaps_p > && row_equal_p (MATRIX_ROW (desired_matrix, i - 1), > MATRIX_ROW (current_matrix, j - 1), 1)) > --i, --j; I haven't seen the one in row_equal_p anymore (but that one was not easy to reproduce), the ones in update_window still show up. From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 12 07:07:01 2011 Received: (at 9990) by debbugs.gnu.org; 12 Nov 2011 12:07:01 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RPCMO-0002MN-0h for submit@debbugs.gnu.org; Sat, 12 Nov 2011 07:07:00 -0500 Received: from mtaout22.012.net.il ([80.179.55.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RPCMK-0002Ln-IK for 9990@debbugs.gnu.org; Sat, 12 Nov 2011 07:06:58 -0500 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0LUJ00G00Q18P300@a-mtaout22.012.net.il> for 9990@debbugs.gnu.org; Sat, 12 Nov 2011 14:06:17 +0200 (IST) Received: from HOME-C4E4A596F7 ([84.229.66.14]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LUJ00G1UQYESA00@a-mtaout22.012.net.il>; Sat, 12 Nov 2011 14:06:17 +0200 (IST) Date: Sat, 12 Nov 2011 14:04:18 +0200 From: Eli Zaretskii Subject: Re: bug#9990: valgrind warning in add_row_entry In-reply-to: X-012-Sender: halo1@inter.net.il To: Dan Nicolaescu Message-id: <83k475fsxp.fsf@gnu.org> References: <83k47ailf0.fsf@gnu.org> <83zkg2fzgt.fsf@gnu.org> <83vcqqfy5h.fsf@gnu.org> X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 9990 Cc: 9990@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: 9990@debbugs.gnu.org > Date: Fri, 11 Nov 2011 15:20:19 -0500 > > I haven't seen the one in row_equal_p anymore (but that one was not easy > to reproduce), the ones in update_window still show up. I added a function that verifies the hash value of glyph rows before it is used in row_equal_p, and also in adjust_glyph_matrix, where the offending reallocation takes place. I cannot trigger the xasserts that use this function when I use "C-h H". Can you? If the hash values are always correct where they are used, I guess that excludes the possibility that we use an uninitialized value, right? From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 15 11:59:34 2011 Received: (at 9990) by debbugs.gnu.org; 15 Nov 2011 16:59:34 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RQMM9-0002o9-Gk for submit@debbugs.gnu.org; Tue, 15 Nov 2011 11:59:33 -0500 Received: from fencepost.gnu.org ([140.186.70.10] ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RQMM6-0002ns-S0 for 9990@debbugs.gnu.org; Tue, 15 Nov 2011 11:59:31 -0500 Received: from dann by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1RQMLS-0007lc-4H; Tue, 15 Nov 2011 11:58:50 -0500 From: Dan Nicolaescu To: Eli Zaretskii Subject: Re: bug#9990: valgrind warning in add_row_entry References: <83k47ailf0.fsf@gnu.org> <83zkg2fzgt.fsf@gnu.org> <83vcqqfy5h.fsf@gnu.org> <83k475fsxp.fsf@gnu.org> Date: Tue, 15 Nov 2011 11:58:50 -0500 In-Reply-To: <83k475fsxp.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 12 Nov 2011 14:04:18 +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.6 (------) X-Debbugs-Envelope-To: 9990 Cc: 9990@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.6 (------) Eli Zaretskii writes: >> From: Dan Nicolaescu >> Cc: 9990@debbugs.gnu.org >> Date: Fri, 11 Nov 2011 15:20:19 -0500 >> >> I haven't seen the one in row_equal_p anymore (but that one was not easy >> to reproduce), the ones in update_window still show up. > > I added a function that verifies the hash value of glyph rows before > it is used in row_equal_p, and also in adjust_glyph_matrix, where the > offending reallocation takes place. I cannot trigger the xasserts > that use this function when I use "C-h H". Can you? No, I cannot. > If the hash values are always correct where they are used, I guess > that excludes the possibility that we use an uninitialized value, > right? I even added an xassert (verify_row_hash (row)) in add_row_entry, and it does not trigger. Strange... From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 15 12:22:42 2011 Received: (at 9990) by debbugs.gnu.org; 15 Nov 2011 17:22:42 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RQMiX-0004QR-2A for submit@debbugs.gnu.org; Tue, 15 Nov 2011 12:22:41 -0500 Received: from fencepost.gnu.org ([140.186.70.10] ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RQMiT-0004Q8-Uz for 9990@debbugs.gnu.org; Tue, 15 Nov 2011 12:22:39 -0500 Received: from dann by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1RQMho-0001mf-Pl; Tue, 15 Nov 2011 12:21:56 -0500 From: Dan Nicolaescu To: Eli Zaretskii Subject: Re: bug#9990: valgrind warning in add_row_entry References: <83k47ailf0.fsf@gnu.org> <83zkg2fzgt.fsf@gnu.org> <83vcqqfy5h.fsf@gnu.org> <83k475fsxp.fsf@gnu.org> Date: Tue, 15 Nov 2011 12:21:56 -0500 In-Reply-To: <83k475fsxp.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 12 Nov 2011 14:04:18 +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.6 (------) X-Debbugs-Envelope-To: 9990 Cc: 9990@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.6 (------) Eli Zaretskii writes: >> From: Dan Nicolaescu >> Cc: 9990@debbugs.gnu.org >> Date: Fri, 11 Nov 2011 15:20:19 -0500 >> >> I haven't seen the one in row_equal_p anymore (but that one was not easy >> to reproduce), the ones in update_window still show up. > > I added a function that verifies the hash value of glyph rows before > it is used in row_equal_p, and also in adjust_glyph_matrix, where the > offending reallocation takes place. I cannot trigger the xasserts > that use this function when I use "C-h H". Can you? BTW, why is the hash only using 28 bits instead of the full 32? Won't it get a bit more precision if using 32? From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 15 12:47:45 2011 Received: (at 9990) by debbugs.gnu.org; 15 Nov 2011 17:47: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 1RQN6m-0006Al-Hr for submit@debbugs.gnu.org; Tue, 15 Nov 2011 12:47:44 -0500 Received: from mtaout22.012.net.il ([80.179.55.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RQN6j-0006A9-C8 for 9990@debbugs.gnu.org; Tue, 15 Nov 2011 12:47:42 -0500 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0LUP00L00QL2Z200@a-mtaout22.012.net.il> for 9990@debbugs.gnu.org; Tue, 15 Nov 2011 19:46:39 +0200 (IST) Received: from HOME-C4E4A596F7 ([77.124.184.15]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LUP00LHVQPQNG40@a-mtaout22.012.net.il>; Tue, 15 Nov 2011 19:46:38 +0200 (IST) Date: Tue, 15 Nov 2011 19:44:45 +0200 From: Eli Zaretskii Subject: Re: bug#9990: valgrind warning in add_row_entry In-reply-to: X-012-Sender: halo1@inter.net.il To: Dan Nicolaescu Message-id: <83bosde0vm.fsf@gnu.org> References: <83k47ailf0.fsf@gnu.org> <83zkg2fzgt.fsf@gnu.org> <83vcqqfy5h.fsf@gnu.org> <83k475fsxp.fsf@gnu.org> X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 9990 Cc: 9990@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.1 (--) > From: Dan Nicolaescu > Cc: 9990@debbugs.gnu.org > Date: Tue, 15 Nov 2011 11:58:50 -0500 > > > I added a function that verifies the hash value of glyph rows before > > it is used in row_equal_p, and also in adjust_glyph_matrix, where the > > offending reallocation takes place. I cannot trigger the xasserts > > that use this function when I use "C-h H". Can you? > > No, I cannot. > > > If the hash values are always correct where they are used, I guess > > that excludes the possibility that we use an uninitialized value, > > right? > > I even added an xassert (verify_row_hash (row)) in add_row_entry, and > it does not trigger. Strange... I have a feeling I didn't interpret the valgrind diagnostics correctly. But I don't see any alternative interpretation that would make sense. From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 15 12:52:35 2011 Received: (at 9990) by debbugs.gnu.org; 15 Nov 2011 17:52:35 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RQNBS-0006Vb-Q2 for submit@debbugs.gnu.org; Tue, 15 Nov 2011 12:52:35 -0500 Received: from mtaout20.012.net.il ([80.179.55.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RQNBL-0006Ui-Ny for 9990@debbugs.gnu.org; Tue, 15 Nov 2011 12:52:33 -0500 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0LUP00M00QRC8D00@a-mtaout20.012.net.il> for 9990@debbugs.gnu.org; Tue, 15 Nov 2011 19:51:41 +0200 (IST) Received: from HOME-C4E4A596F7 ([77.124.184.15]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LUP00HA6QY3C0I1@a-mtaout20.012.net.il>; Tue, 15 Nov 2011 19:51:39 +0200 (IST) Date: Tue, 15 Nov 2011 19:49:46 +0200 From: Eli Zaretskii Subject: Re: bug#9990: valgrind warning in add_row_entry In-reply-to: X-012-Sender: halo1@inter.net.il To: Dan Nicolaescu , Richard Stallman Message-id: <83aa7xe0n9.fsf@gnu.org> References: <83k47ailf0.fsf@gnu.org> <83zkg2fzgt.fsf@gnu.org> <83vcqqfy5h.fsf@gnu.org> <83k475fsxp.fsf@gnu.org> X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 9990 Cc: 9990@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.1 (--) > From: Dan Nicolaescu > Cc: 9990@debbugs.gnu.org > Date: Tue, 15 Nov 2011 12:21:56 -0500 > > BTW, why is the hash only using 28 bits instead of the full 32? Won't > it get a bit more precision if using 32? I don't know. I suspect this is simply history inherited from a similar (but not identical -- why?) code in line_hash_code, which also uses 28 bits. Richard, do you remember by chance why only 28 bits are used? From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 18 07:47:35 2011 Received: (at 9990) by debbugs.gnu.org; 18 Nov 2011 12:47:35 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RRNqx-0002dh-KT for submit@debbugs.gnu.org; Fri, 18 Nov 2011 07:47:35 -0500 Received: from mtaout21.012.net.il ([80.179.55.169]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RRNqu-0002dZ-TV for 9990@debbugs.gnu.org; Fri, 18 Nov 2011 07:47:34 -0500 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0LUU00800WSP6400@a-mtaout21.012.net.il> for 9990@debbugs.gnu.org; Fri, 18 Nov 2011 14:46:20 +0200 (IST) Received: from HOME-C4E4A596F7 ([77.127.237.133]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LUU007S5WT7YH60@a-mtaout21.012.net.il>; Fri, 18 Nov 2011 14:46:20 +0200 (IST) Date: Fri, 18 Nov 2011 14:44:30 +0200 From: Eli Zaretskii Subject: Re: bug#9990: valgrind warning in add_row_entry In-reply-to: X-012-Sender: halo1@inter.net.il To: Dan Nicolaescu Message-id: <83zkftbnwx.fsf@gnu.org> References: <83k47ailf0.fsf@gnu.org> <83zkg2fzgt.fsf@gnu.org> <83vcqqfy5h.fsf@gnu.org> <83k475fsxp.fsf@gnu.org> X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 9990 Cc: 9990@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: 9990@debbugs.gnu.org > Date: Tue, 15 Nov 2011 11:58:50 -0500 > > > If the hash values are always correct where they are used, I guess > > that excludes the possibility that we use an uninitialized value, > > right? > > I even added an xassert (verify_row_hash (row)) in add_row_entry, and > it does not trigger. Strange... I added such an assert to the trunk. I also fixed a couple of functions that were destroying the validity of hash codes while manipulating glyph rows. Could you please see if valgrind still complains about add_row_entry with the current trunk? From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 18 14:41:38 2011 Received: (at 9990) by debbugs.gnu.org; 18 Nov 2011 19:41:38 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RRUJe-0003rY-84 for submit@debbugs.gnu.org; Fri, 18 Nov 2011 14:41:38 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RRUJY-0003rO-TL for 9990@debbugs.gnu.org; Fri, 18 Nov 2011 14:41:35 -0500 Received: from dann by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1RRUIc-0003sh-A3; Fri, 18 Nov 2011 14:40:34 -0500 From: Dan Nicolaescu To: Eli Zaretskii Subject: Re: bug#9990: valgrind warning in add_row_entry References: <83k47ailf0.fsf@gnu.org> <83zkg2fzgt.fsf@gnu.org> <83vcqqfy5h.fsf@gnu.org> <83k475fsxp.fsf@gnu.org> <83zkftbnwx.fsf@gnu.org> Date: Fri, 18 Nov 2011 14:40:34 -0500 In-Reply-To: <83zkftbnwx.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 18 Nov 2011 14:44:30 +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.6 (------) X-Debbugs-Envelope-To: 9990 Cc: 9990@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.6 (------) Eli Zaretskii writes: >> From: Dan Nicolaescu >> Cc: 9990@debbugs.gnu.org >> Date: Tue, 15 Nov 2011 11:58:50 -0500 >> >> > If the hash values are always correct where they are used, I guess >> > that excludes the possibility that we use an uninitialized value, >> > right? >> >> I even added an xassert (verify_row_hash (row)) in add_row_entry, and >> it does not trigger. Strange... > > I added such an assert to the trunk. I also fixed a couple of > functions that were destroying the validity of hash codes while > manipulating glyph rows. > > Could you please see if valgrind still complains about add_row_entry > with the current trunk? Unfortunately it still complains in: ==11270== at 0x41314F: adjust_glyph_matrix (dispnew.c:612) ==11270== by 0x4135FC: allocate_matrices_for_window_redisplay (dispnew.c:1869) ==11270== by 0x413B8A: adjust_frame_glyphs (dispnew.c:2199) ==11270== by 0x417137: adjust_glyphs (dispnew.c:1897) ==11270== by 0x44243E: redisplay_internal (xdisp.c:12715) ==11270== by 0x4F6CE2: command_loop_1 (keyboard.c:1589) ==11270== by 0x55BB45: internal_condition_case (eval.c:1499) ==11270== by 0x4E9EAD: command_loop_2 (keyboard.c:1158) ==11270== by 0x55BA27: internal_catch (eval.c:1256) ==11270== by 0x4EB436: recursive_edit_1 (keyboard.c:1137) ==11270== by 0x4EB76B: Frecursive_edit (keyboard.c:821) ==11270== by 0x40E62C: main (emacs.c:1707) ==11270== by 0x415762: update_window (dispnew.c:4244) ==11270== by 0x4166C2: update_window_tree (dispnew.c:3360) ==11270== by 0x418617: update_frame (dispnew.c:3287) ==11270== by 0x44207B: redisplay_internal (xdisp.c:13175) ==11270== by 0x4F6CE2: command_loop_1 (keyboard.c:1589) ==11270== by 0x55BB45: internal_condition_case (eval.c:1499) ==11270== by 0x4E9EAD: command_loop_2 (keyboard.c:1158) ==11270== by 0x55BA27: internal_catch (eval.c:1256) ==11270== by 0x4EB436: recursive_edit_1 (keyboard.c:1137) [line numbers in dispnew.c might be off by a few lines, I have some debugging printfs inserted there] From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 18 16:12:38 2011 Received: (at 9990) by debbugs.gnu.org; 18 Nov 2011 21:12:38 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RRVji-0006CM-CK for submit@debbugs.gnu.org; Fri, 18 Nov 2011 16:12:38 -0500 Received: from mtaout22.012.net.il ([80.179.55.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RRVjg-0006CE-Ty for 9990@debbugs.gnu.org; Fri, 18 Nov 2011 16:12:37 -0500 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0LUV00100JYP8R00@a-mtaout22.012.net.il> for 9990@debbugs.gnu.org; Fri, 18 Nov 2011 23:10:29 +0200 (IST) Received: from HOME-C4E4A596F7 ([77.127.237.133]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LUV001OTK5G6Y30@a-mtaout22.012.net.il>; Fri, 18 Nov 2011 23:10:29 +0200 (IST) Date: Fri, 18 Nov 2011 23:08:39 +0200 From: Eli Zaretskii Subject: Re: bug#9990: valgrind warning in add_row_entry In-reply-to: X-012-Sender: halo1@inter.net.il To: Dan Nicolaescu Message-id: <83wraxb0ko.fsf@gnu.org> References: <83k47ailf0.fsf@gnu.org> <83zkg2fzgt.fsf@gnu.org> <83vcqqfy5h.fsf@gnu.org> <83k475fsxp.fsf@gnu.org> <83zkftbnwx.fsf@gnu.org> X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 9990 Cc: 9990@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: 9990@debbugs.gnu.org > Date: Fri, 18 Nov 2011 14:40:34 -0500 > > > I added such an assert to the trunk. I also fixed a couple of > > functions that were destroying the validity of hash codes while > > manipulating glyph rows. > > > > Could you please see if valgrind still complains about add_row_entry > > with the current trunk? > > Unfortunately it still complains in: > > ==11270== at 0x41314F: adjust_glyph_matrix (dispnew.c:612) What does this line say in your sources? Anyway, seems like a different thing, as there's no add_row_entry near line 612. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 18 16:44:15 2011 Received: (at 9990) by debbugs.gnu.org; 18 Nov 2011 21:44:15 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RRWEI-0007gF-UY for submit@debbugs.gnu.org; Fri, 18 Nov 2011 16:44:15 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RRWEE-0007g5-1y for 9990@debbugs.gnu.org; Fri, 18 Nov 2011 16:44:11 -0500 Received: from dann by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1RRWDH-00048c-3K; Fri, 18 Nov 2011 16:43:11 -0500 From: Dan Nicolaescu To: Eli Zaretskii Subject: Re: bug#9990: valgrind warning in add_row_entry References: <83k47ailf0.fsf@gnu.org> <83zkg2fzgt.fsf@gnu.org> <83vcqqfy5h.fsf@gnu.org> <83k475fsxp.fsf@gnu.org> <83zkftbnwx.fsf@gnu.org> <83wraxb0ko.fsf@gnu.org> Date: Fri, 18 Nov 2011 16:43:11 -0500 In-Reply-To: <83wraxb0ko.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 18 Nov 2011 23:08:39 +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.6 (------) X-Debbugs-Envelope-To: 9990 Cc: 9990@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.6 (------) Eli Zaretskii writes: >> From: Dan Nicolaescu >> Cc: 9990@debbugs.gnu.org >> Date: Fri, 18 Nov 2011 14:40:34 -0500 >> >> > I added such an assert to the trunk. I also fixed a couple of >> > functions that were destroying the validity of hash codes while >> > manipulating glyph rows. >> > >> > Could you please see if valgrind still complains about add_row_entry >> > with the current trunk? >> >> Unfortunately it still complains in: >> >> ==11270== at 0x41314F: adjust_glyph_matrix (dispnew.c:612) > > What does this line say in your sources? > xassert (!row->enabled_p || verify_row_hash (row)); > Anyway, seems like a different thing, as there's no add_row_entry near > line 612. And for the other complaint: ==11270== by 0x415762: update_window (dispnew.c:4244) is: ptrdiff_t i = row->hash % row_table_size; From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 19 03:31:13 2011 Received: (at 9990) by debbugs.gnu.org; 19 Nov 2011 08:31:13 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RRgKO-0005XA-8r for submit@debbugs.gnu.org; Sat, 19 Nov 2011 03:31:12 -0500 Received: from mtaout22.012.net.il ([80.179.55.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RRgKL-0005Wv-8g for 9990@debbugs.gnu.org; Sat, 19 Nov 2011 03:31:10 -0500 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0LUW00600F1QH000@a-mtaout22.012.net.il> for 9990@debbugs.gnu.org; Sat, 19 Nov 2011 10:30:02 +0200 (IST) Received: from HOME-C4E4A596F7 ([77.127.237.133]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LUW005UZFLZY0B0@a-mtaout22.012.net.il>; Sat, 19 Nov 2011 10:30:00 +0200 (IST) Date: Sat, 19 Nov 2011 10:28:11 +0200 From: Eli Zaretskii Subject: Re: bug#9990: valgrind warning in add_row_entry In-reply-to: X-012-Sender: halo1@inter.net.il To: Dan Nicolaescu Message-id: <83sjlkbjok.fsf@gnu.org> References: <83k47ailf0.fsf@gnu.org> <83zkg2fzgt.fsf@gnu.org> <83vcqqfy5h.fsf@gnu.org> <83k475fsxp.fsf@gnu.org> <83zkftbnwx.fsf@gnu.org> <83wraxb0ko.fsf@gnu.org> X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 9990 Cc: 9990@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: 9990@debbugs.gnu.org > Date: Fri, 18 Nov 2011 16:43:11 -0500 > > >> Unfortunately it still complains in: > >> > >> ==11270== at 0x41314F: adjust_glyph_matrix (dispnew.c:612) > > > > What does this line say in your sources? > > > > xassert (!row->enabled_p || verify_row_hash (row)); So it complains about `row' itself, or maybe about the enabled_p field, is that right? > And for the other complaint: > ==11270== by 0x415762: update_window (dispnew.c:4244) > > is: > ptrdiff_t i = row->hash % row_table_size; Yes, that was the original one, triggered by "C-h H". But maybe it is complaining about `row' itself, even here, not about the hash code? I will take another look. From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 20 16:31:44 2011 Received: (at 9990) by debbugs.gnu.org; 20 Nov 2011 21:31: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 1RSEzI-0006Bk-BJ for submit@debbugs.gnu.org; Sun, 20 Nov 2011 16:31:44 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RSEzG-0006Bd-Ov for 9990@debbugs.gnu.org; Sun, 20 Nov 2011 16:31:43 -0500 Received: from dann by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1RSEy8-0003h5-0o; Sun, 20 Nov 2011 16:30:32 -0500 From: Dan Nicolaescu To: Eli Zaretskii Subject: Re: bug#9990: valgrind warning in add_row_entry References: <83k47ailf0.fsf@gnu.org> <83zkg2fzgt.fsf@gnu.org> <83vcqqfy5h.fsf@gnu.org> <83k475fsxp.fsf@gnu.org> <83zkftbnwx.fsf@gnu.org> <83wraxb0ko.fsf@gnu.org> <83sjlkbjok.fsf@gnu.org> Date: Sun, 20 Nov 2011 16:30:31 -0500 In-Reply-To: <83sjlkbjok.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 19 Nov 2011 10:28:11 +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.6 (------) X-Debbugs-Envelope-To: 9990 Cc: 9990@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.6 (------) Eli Zaretskii writes: >> From: Dan Nicolaescu >> Cc: 9990@debbugs.gnu.org >> Date: Fri, 18 Nov 2011 16:43:11 -0500 >> >> >> Unfortunately it still complains in: >> >> >> >> ==11270== at 0x41314F: adjust_glyph_matrix (dispnew.c:612) >> > >> > What does this line say in your sources? >> > >> >> xassert (!row->enabled_p || verify_row_hash (row)); > > So it complains about `row' itself, or maybe about the enabled_p > field, is that right? It's either row, row->enabled_p or row->hash. (In case the warning is valid...) From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 17 18:34:38 2020 Received: (at 9990) by debbugs.gnu.org; 17 Aug 2020 22:34:38 +0000 Received: from localhost ([127.0.0.1]:33381 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k7ni9-0004aj-NQ for submit@debbugs.gnu.org; Mon, 17 Aug 2020 18:34:38 -0400 Received: from mail-yb1-f173.google.com ([209.85.219.173]:40689) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k7ni8-0004aI-7r for 9990@debbugs.gnu.org; Mon, 17 Aug 2020 18:34:36 -0400 Received: by mail-yb1-f173.google.com with SMTP id q3so10276048ybp.7 for <9990@debbugs.gnu.org>; Mon, 17 Aug 2020 15:34:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:user-agent :mime-version:date:message-id:subject:to:cc; bh=/yTJgitzTjxgna72lOlJdtbu+d8/Bch2YhUbqgEW8Oo=; b=AciKIKXHlidAVen1NLu/XlDV5d7eux6/uzXDf6zMSX9khxXvndBBuOlWJ0Cl6YptoY CYxezQ3L/UtNb76EF6cPcAQG31wvDAd9jREUkNz7WWoeRLPY23m7QJInGRmf7rLJdFuB 8WzDwX8eucVZloQXXoGExtw95lcCYjt1eXy2Z8UdDeQHapbu1fRkqmlVkostkovl7cZk pBN0UjDnM3Q9noOm9YM5coPU2Wmu0j5j2dCqy+Hd4UyQEHFaaNxRG5kpwuVI0Ljcvsoi KBXzZPJ4Tj4VuMs9OMRZ/WS8jJcuufkyVYAYHxFLf+RZ4hVy4HRs9S3RgaV+QyNOtGPl 4ZHA== X-Gm-Message-State: AOAM530LjqdaHOVtxz+3xifFgpcG+jWC5NA9bUmSYZe2r3y5vrZrRxTV rCdTYS0WjlCAhKN0ysbIyJazlQ02inA7ruJgYLwStq2r3IE= X-Google-Smtp-Source: ABdhPJxfKR6+yi1pqm69d2ktDKdL2WQ7gDi6mwX9GHfLQQ5VbMnce1lO3bpSI52elWt3GfJc0hs6ho7FbWdG8MUNDoo= X-Received: by 2002:a25:4609:: with SMTP id t9mr22586620yba.231.1597703670785; Mon, 17 Aug 2020 15:34:30 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 17 Aug 2020 22:34:30 +0000 From: Stefan Kangas In-Reply-To: (Dan Nicolaescu's message of "Tue, 08 Nov 2011 09:27:06 -0500") References: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Date: Mon, 17 Aug 2020 22:34:30 +0000 Message-ID: Subject: Re: bug#9990: valgrind warning in add_row_entry To: Dan Nicolaescu Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 9990 Cc: 9990@debbugs.gnu.org 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.5 (/) Dan Nicolaescu writes: > valgrind ./temacs -Q gets this warning: > > ==7487== Use of uninitialised value of size 8 > ==7487== at 0x4140F4: update_window (dispnew.c:4212) > ==7487== by 0x414F32: update_window_tree (dispnew.c:3326) > ==7487== by 0x414F0E: update_window_tree (dispnew.c:3324) > ==7487== by 0x4181FD: update_frame (dispnew.c:3253) > ==7487== by 0x443EDB: redisplay_internal (xdisp.c:13175) > ==7487== by 0x4F6F47: read_char (keyboard.c:2443) > ==7487== by 0x4F9406: read_key_sequence.constprop.14 (keyboard.c:9290) > ==7487== by 0x4FB0D4: command_loop_1 (keyboard.c:1447) > ==7487== by 0x560015: internal_condition_case (eval.c:1499) > ==7487== by 0x4EE4AD: command_loop_2 (keyboard.c:1158) > ==7487== by 0x55FEF7: internal_catch (eval.c:1256) > ==7487== by 0x4EFA36: recursive_edit_1 (keyboard.c:1137) > ==7487== > ==7487== > ==7487== ---- Attach to debugger ? --- [Return/N/n/Y/y/C/c] ---- Y > > The line in question is: > > 4212 entry = row_table[i]; > > > (gdb) p i > $1 = 0x157 > (gdb) p row_table[i] > $2 = (struct row_entry *) 0x0 > (gdb) p row_table_size > $3 = 0x193 > > Is it possible for the contents of row_table to be uninitialized? Is this warning a false positive? This is a report with a number of valgrind warnings from 9 years ago. In this discussion, a number of warnings were fixed but then work unfortunately seems to have stopped. Is anyone still working on this or should this be closed? Best regards, Stefan Kangas From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 20 15:02:33 2020 Received: (at control) by debbugs.gnu.org; 20 Aug 2020 19:02:33 +0000 Received: from localhost ([127.0.0.1]:44136 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k8ppZ-0006lL-86 for submit@debbugs.gnu.org; Thu, 20 Aug 2020 15:02:33 -0400 Received: from mail-yb1-f179.google.com ([209.85.219.179]:45697) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k8ppV-0006e9-Oj for control@debbugs.gnu.org; Thu, 20 Aug 2020 15:02:31 -0400 Received: by mail-yb1-f179.google.com with SMTP id x2so1664958ybf.12 for ; Thu, 20 Aug 2020 12:02:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:date:message-id:subject:to; bh=Ss/4YCfMza5RvsW1H0KhwOYOlnIyDUwMV6lxC88sUZs=; b=rC3vpP1vV2COXkOTKO9pAxlhkmq3cbTQC+HnIAt8NDObCEuFHCsFd2rAa78CfV3BhB LjfmMNFeTDo9u1JAAfQMA/KtyUWu4zLwI6Yb77cB7w21OIzPilcULIqRRdUpkTcpHN+c 7heMiKsjahvOh68GivQcFTvEIVwfWWRBWmAblXv8o7buePyXTVSq3U9PoNk1BstgMUc7 Wm7abFr9WdlPzaru1QaR5+TrwBHjjxv28FEoe3WntgGCrDX+C2wNZLJ9K+KMn0JYrYNw prybaVesHINUvkT6MFNag9plXZklbAVXuIV6PytdKmr2MCkctXbzrePy0f0UoHeGUp5n AI1A== X-Gm-Message-State: AOAM532s8Vjwwe9yjVU2hTEeCnj5WxrCYDBlcrLUY+offf2gAlRoLD7X n/jRtr5EX2RMh4BJT0inkNGcEm/Xyr5Wi3WN29xtNM9vdRs= X-Google-Smtp-Source: ABdhPJys2gSLFjMG5t0Dt52ZZCUYZlYfR/fgZ74p7K3awEHpLOejbyEDLobP1GyaWJbdan5AK10SEVIPnOSoyyy1CzI= X-Received: by 2002:a25:4609:: with SMTP id t9mr6418556yba.231.1597950143857; Thu, 20 Aug 2020 12:02:23 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Thu, 20 Aug 2020 12:02:23 -0700 From: Stefan Kangas MIME-Version: 1.0 Date: Thu, 20 Aug 2020 12:02:23 -0700 Message-ID: Subject: To: control@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 2.5 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: tags 9990 + moreinfo thanks Content analysis details: (2.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (stefankangas[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.219.179 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.219.179 listed in list.dnswl.org] 2.0 BLANK_SUBJECT Subject is present but empty 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-Debbugs-Envelope-To: control 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: 1.5 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: tags 9990 + moreinfo thanks Content analysis details: (1.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.219.179 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.219.179 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (stefankangas[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 2.0 BLANK_SUBJECT Subject is present but empty -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines tags 9990 + moreinfo thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 30 21:55:57 2020 Received: (at 9990) by debbugs.gnu.org; 1 Oct 2020 01:55:58 +0000 Received: from localhost ([127.0.0.1]:33498 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNnp7-0006Gm-LA for submit@debbugs.gnu.org; Wed, 30 Sep 2020 21:55:57 -0400 Received: from quimby.gnus.org ([95.216.78.240]:52822) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNnp6-0006GY-E6 for 9990@debbugs.gnu.org; Wed, 30 Sep 2020 21:55:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=hDkD8QD1tYzfBUzvitjgaYLVd4Pq1O75UpjWZBxzJIA=; b=Op8dNqPJjYtme+oADqNc8snSOs iYGd59bKnxS0QY34N8yQ5XpJ/81uQgUyoZ3mPn+PrmnCMo7ZpWfnVlxA+i3adWVcrss4BjpGXXOTN +aIu5y7FeIibA/TnkJBQwRJ114vdHRv+r2oi29BSVU9YaxGj5qzj1t4FxUutRHUsgTkY=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kNnow-0000VZ-QG; Thu, 01 Oct 2020 03:55:49 +0200 From: Lars Ingebrigtsen To: Stefan Kangas Subject: Re: bug#9990: valgrind warning in add_row_entry References: X-Now-Playing: Hood's _The Lost You_: "Over The Land Over The Sea" Date: Thu, 01 Oct 2020 03:55:45 +0200 In-Reply-To: (Stefan Kangas's message of "Mon, 17 Aug 2020 22:34:30 +0000") Message-ID: <87pn62vhem.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Stefan Kangas writes: > This is a report with a number of valgrind warnings from 9 years ago. > In this discussion, a number of warnings were fixed but then work > unfortunately seems to have stopped. > > Is anyone still w [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 9990 Cc: Dan Nicolaescu , 9990@debbugs.gnu.org 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: -1.0 (-) Stefan Kangas writes: > This is a report with a number of valgrind warnings from 9 years ago. > In this discussion, a number of warnings were fixed but then work > unfortunately seems to have stopped. > > Is anyone still working on this or should this be closed? There was no response in six weeks, so I'm now closing this bug report. If there are more valgrind issues (and I'm sure there are), then new reports should be opened for them. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 30 21:56:05 2020 Received: (at control) by debbugs.gnu.org; 1 Oct 2020 01:56:05 +0000 Received: from localhost ([127.0.0.1]:33502 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNnpE-0006HX-VW for submit@debbugs.gnu.org; Wed, 30 Sep 2020 21:56:05 -0400 Received: from quimby.gnus.org ([95.216.78.240]:52838) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNnpC-0006Gn-Tt for control@debbugs.gnu.org; Wed, 30 Sep 2020 21:56:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=C3n4P8NRrqrT6MEI//1IlpUQsdUwuEzNQJ5pQNIQi6g=; b=lhYRFcLO1Rwfl8U+RhqefJVSfo t/Fso1fTUKhpqL1IWYeDcn9FFRpR+KCPcX0QFett0hI5Gc3jsgIFfnfP6U1w/mp6ak2ejee8yvXCu qkH+X5zg3AHjUdklxKtQx7iXInwlFasWCqSFnemeKm8vlA0qLsEU/JTwVxxxm//0Dn74=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kNnp5-0000Vh-3U for control@debbugs.gnu.org; Thu, 01 Oct 2020 03:55:57 +0200 Date: Thu, 01 Oct 2020 03:55:53 +0200 Message-Id: <87o8lmvhee.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #9990 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 9990 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control 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: -1.0 (-) close 9990 quit From unknown Fri Aug 15 16:19:54 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 29 Oct 2020 11:24:09 +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