From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1N8gPN-0005ac-8s for mharc-grub-devel@gnu.org; Thu, 12 Nov 2009 15:36:45 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N8gPK-0005Ym-BD for grub-devel@gnu.org; Thu, 12 Nov 2009 15:36:42 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N8gPF-0005Vf-Lb for grub-devel@gnu.org; Thu, 12 Nov 2009 15:36:41 -0500 Received: from [199.232.76.173] (port=60931 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N8gPF-0005VT-9N for grub-devel@gnu.org; Thu, 12 Nov 2009 15:36:37 -0500 Received: from moutng.kundenserver.de ([212.227.126.186]:63797) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N8gPE-0005uj-Lx for grub-devel@gnu.org; Thu, 12 Nov 2009 15:36:37 -0500 Received: from [85.180.46.174] (e180046174.adsl.alicedsl.de [85.180.46.174]) by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis) id 0LehKM-1MJdXh0kT0-00qj8h; Thu, 12 Nov 2009 21:36:35 +0100 From: Felix Zielcke To: The development of GNU GRUB In-Reply-To: References: Content-Type: multipart/mixed; boundary="=-zA0kGsSTEVfz3HK5AexG" Date: Thu, 12 Nov 2009 21:36:34 +0100 Message-ID: <1258058194.4779.6.camel@fz.local> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 X-Provags-ID: V01U2FsdGVkX1+Ods482+ofDkZBIoU4RpmL4n6u740MxVyPOMb oYg9AkSDyslikC25xzFwRjQhz8clD+vNtS1tG3aeR3ZYe7FsVH 6USMC6qEYSeMzZZ1loOzQ== X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [PATCH] Re: Bug in read_handler_list (autoloading) ??? X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2009 20:36:42 -0000 --=-zA0kGsSTEVfz3HK5AexG Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Am Donnerstag, den 12.11.2009, 21:46 +0530 schrieb BVK: > Valgrind log is attached. It also reported invalid free for the same place. > > BTW, valgrind is run as > > sudo valgrind -v --log-file=/tmp/valgrind.log ./grub-emu Here's a grub-emu tested patch to fix this -- Felix Zielcke Proud Debian Maintainer and GNU GRUB developer --=-zA0kGsSTEVfz3HK5AexG Content-Disposition: attachment; filename="fix_prefix_patch.diff" Content-Type: text/x-patch; name="fix_prefix_patch.diff"; charset="UTF-8" Content-Transfer-Encoding: 7bit 2009-11-12 Felix Zielcke * normal/handler.c (read_handler_list): Use grub_handler_unregister to properly remove the handlers. Skip `rescue' and `console' handlers defined in kernel. === modified file 'normal/handler.c' --- normal/handler.c 2009-11-09 14:55:27 +0000 +++ normal/handler.c 2009-11-12 20:31:00 +0000 @@ -176,14 +176,21 @@ read_handler_list (void) if (file) { char *buf = NULL; - + grub_handler_class_t hcnext, hc = grub_handler_class_list; + grub_handler_t hl; /* Override previous handler.lst. */ - while (grub_handler_class_list) + for (; hc ; hc = hcnext) { - grub_handler_class_t tmp; - tmp = grub_handler_class_list->next; - grub_free (grub_handler_class_list); - grub_handler_class_list = tmp; + hcnext = hc->next; + hl = hc->handler_list; + while (hl) + { + grub_handler_t tmp = hl->next; + if (grub_strcmp (hl->name, "rescue") != 0 + && grub_strcmp (hl->name, "console") != 0) + grub_handler_unregister (hc,hl); + hl = tmp; + } } for (;; grub_free (buf)) --=-zA0kGsSTEVfz3HK5AexG--