From: Chong Yidong <cyd@stupidchicken.com>
To: Kenichi Handa <handa@m17n.org>
Cc: 2435@emacsbugs.donarmstrong.com
Subject: bug#2435: Bug 2435
Date: Wed, 04 Mar 2009 23:09:48 -0500 [thread overview]
Message-ID: <878wnk7gqb.fsf@cyd.mit.edu> (raw)
In-Reply-To: <E1LelpB-0007tx-PR@etlken> (Kenichi Handa's message of "Wed, 04 Mar 2009 16:47:29 +0900")
Kenichi Handa <handa@m17n.org> 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
next prev parent reply other threads:[~2009-03-05 4:09 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <87fxhvcmvf.fsf@cyd.mit.edu>
[not found] ` <E1LePPk-0002zE-RW@etlken>
2009-03-03 16:40 ` bug#2435: Bug 2435 Chong Yidong
2009-03-04 2:16 ` Kenichi Handa
2009-03-04 4:41 ` Chong Yidong
2009-03-04 7:47 ` Kenichi Handa
2009-03-05 4:09 ` Chong Yidong [this message]
2009-03-05 6:39 ` Kenichi Handa
2009-03-05 4:42 ` Chong Yidong
2009-03-05 11:23 ` Kenichi Handa
2009-03-05 16:46 ` Stefan Monnier
2009-03-06 3:38 ` Kenichi Handa
2009-03-06 4:11 ` Chong Yidong
2009-03-06 4:48 ` Kenichi Handa
2009-03-06 5:07 ` Stefan Monnier
2009-03-06 5:21 ` Kenichi Handa
2009-03-07 4:00 ` Chong Yidong
2009-03-07 23:07 ` Stefan Monnier
2009-03-09 1:12 ` Kenichi Handa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878wnk7gqb.fsf@cyd.mit.edu \
--to=cyd@stupidchicken.com \
--cc=2435@emacsbugs.donarmstrong.com \
--cc=handa@m17n.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.