From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.bugs Subject: bug#2435: Bug 2435 Date: Wed, 04 Mar 2009 23:09:48 -0500 Message-ID: <878wnk7gqb.fsf@cyd.mit.edu> References: <87fxhvcmvf.fsf@cyd.mit.edu> <87zlg2a7b9.fsf@cyd.mit.edu> <87ab81293z.fsf@cyd.mit.edu> Reply-To: Chong Yidong , 2435@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1236227039 2868 80.91.229.12 (5 Mar 2009 04:23:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Mar 2009 04:23:59 +0000 (UTC) Cc: 2435@emacsbugs.donarmstrong.com To: Kenichi Handa Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Mar 05 05:25:15 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Lf58z-0005AS-Il for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Mar 2009 05:25:14 +0100 Original-Received: from localhost ([127.0.0.1]:59959 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lf57d-0007jf-Sw for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Mar 2009 23:23:49 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lf57Z-0007jO-AP for bug-gnu-emacs@gnu.org; Wed, 04 Mar 2009 23:23:45 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lf57W-0007j7-MD for bug-gnu-emacs@gnu.org; Wed, 04 Mar 2009 23:23:44 -0500 Original-Received: from [199.232.76.173] (port=36744 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lf57W-0007j4-Iq for bug-gnu-emacs@gnu.org; Wed, 04 Mar 2009 23:23:42 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:53946) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Lf57W-0008Nc-1a for bug-gnu-emacs@gnu.org; Wed, 04 Mar 2009 23:23:42 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n254NdFh028932; Wed, 4 Mar 2009 20:23:39 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n254F3re026569; Wed, 4 Mar 2009 20:15:03 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Chong Yidong Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Thu, 05 Mar 2009 04:15:03 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 2435 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 2435-submit@emacsbugs.donarmstrong.com id=B2435.123622612325259 (code B ref 2435); Thu, 05 Mar 2009 04:15:03 +0000 Original-Received: (at 2435) by emacsbugs.donarmstrong.com; 5 Mar 2009 04:08:43 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2548eNU025253 for <2435@emacsbugs.donarmstrong.com>; Wed, 4 Mar 2009 20:08:41 -0800 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id 8690757E1FC; Wed, 4 Mar 2009 23:09:48 -0500 (EST) In-Reply-To: (Kenichi Handa's message of "Wed, 04 Mar 2009 16:47:29 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Wed, 04 Mar 2009 23:23:44 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:26002 Archived-At: Kenichi Handa writes: > It seems that `pattern' is correct, but `bufp->buffer' is > the compiled code for some of jkr-compr related regexp. > Could you please find why that happens? I think the problem is that regex_compile can call load_charset, which can call regex_compile. I think regex_compile is not designed to be called recursively, leading to memory corruption. Here is a backtrace (I inserted some debugging code to detect when regex_compile is called recursively): #0 abort () at emacs.c:432 #1 0x08196965 in compile_pattern (pattern=139288251, regp=0x0, translate=138358041, posix=0, multibyte=0) at search.c:262 #2 0x0819727d in fast_string_match (regexp=139288251, string=138555267) at search.c:509 #3 0x0817eb9f in Ffind_file_name_handler (filename=138555267, operation=138416225) at fileio.c:380 #4 0x0817f5b3 in Fexpand_file_name (name=138555267, default_directory=141645459) at fileio.c:859 #5 0x081fb92e in openp (path=138676461, str=138555267, #suffixes=138926685, storeptr=0x0, predicate=138358041) at lread.c:1425 #6 0x080b95f6 in load_charset_map_from_file (charset=0x84b4acc, mapfile=138555267, control_flag=1) at charset.c:515 #7 0x080b9bb1 in load_charset (charset=0x84b4acc, control_flag=1) at charset.c:652 #8 0x080bdce8 in maybe_unify_char (c=1638542, val=138788937) at charset.c:1679 #9 0x080eb5fa in string_char ( p=0x83560ac "\340\275\261\340\275\262-\340\275\275\340\276\200\340\276\201\340\276\204]*[\340\275\276\340\276\202\340\276\203\340\276\206-\340\276\213\340\274\231\340\274\265\340\274\267]*", advanced=0x0, len=0xbfc70d28) at character.c:236 #10 0x081a2ac9 in regex_compile ( pattern=0x8356085 "[\340\275\200-\340\275\251\340\275\252][\340\276\220-\340\276\271\340\276\272\340\276\273\340\276\274]*[\340\275\260\366\220\202\216\340\275\261\340\275\262-\340\275\275\340\276\200\340\276\201\340\276\204]*[\340\275\276\340\276\202\340\276\203\340\276\206-\340\276\213\340\274\231\340\274\265\340\274\267]*", size=88, syntax=3408388, bufp=0x83e3210) at regex.c:2982 #11 0x081b3dca in re_compile_pattern ( pattern=0x8356085 "[\340\275\200-\340\275\251\340\275\252][\340\276\220-\340\276\271\340\276\272\340\276\273\340\276\274]*[\340\275\260\366\220\202\216\340\275\261\340\275\262-\340\275\275\340\276\200\340\276\201\340\276\204]*[\340\275\276\340\276\202\340\276\203\340\276\206-\340\276\213\340\274\231\340\274\265\340\274\267]*", length=88, bufp=0x83e3210) at regex.c:6518 #12 0x08196714 in compile_pattern_1 (cp=0x83e3200, pattern=137244011, translate=138358041, regp=0x0, posix=0) at search.c:160 #13 0x08196996 in compile_pattern (pattern=137244011, regp=0x0, translate=138358041, posix=0, multibyte=1) at search.c:265