[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#11519: "Wrong type argument: characterp" building custom-deps while
From: |
Stefan Monnier |
Subject: |
bug#11519: "Wrong type argument: characterp" building custom-deps while boostrapping |
Date: |
Mon, 21 May 2012 16:39:56 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) |
> So I think that what happened is that something, probably the
> translation through a char-table, caused allocation of a large chunk
> of memory, which in turn relocated the text of the current buffer
> behind regex.c's back, which still uses C pointers to the old location
> of the buffer text. Here's how search.c calls re_search_2:
> p1 = BEGV_ADDR;
> s1 = GPT_BYTE - BEGV_BYTE;
> p2 = GAP_END_ADDR;
> s2 = ZV_BYTE - GPT_BYTE;
> if (s1 < 0)
> {
> p2 = p1;
> s2 = ZV_BYTE - BEGV_BYTE;
> s1 = 0;
> }
> if (s2 < 0)
> {
> s1 = ZV_BYTE - BEGV_BYTE;
> s2 = 0;
> }
> re_match_object = Qnil;
> while (n < 0)
> {
> EMACS_INT val;
> val = re_search_2 (bufp, (char *) p1, s1, (char *) p2, s2,
> pos_byte - BEGV_BYTE, lim_byte - pos_byte,
> (NILP (Vinhibit_changing_match_data)
> ? &search_regs : &search_regs_1),
> /* Don't allow match past current point */
> pos_byte - BEGV_BYTE);
> We pass s1 and s2, which are pointers to buffer text, so if buffer
> text is relocated, we are screwed.
> Does this explanation sound reasonable? If so, any ideas how to fix
> this?
I suggest you let-bind some witness variable is re_search_2 and then in
the buffer-relocation code, you test this var and abort if it's non-nil.
That should let us catch the offender red-handed, after which we will
know better how to fix the problem.
Stefan
- bug#11519: "Wrong type argument: characterp" building custom-deps while boostrapping, Juanma Barranquero, 2012/05/19
- bug#11519: "Wrong type argument: characterp" building custom-deps while boostrapping, Eli Zaretskii, 2012/05/19
- bug#11519: "Wrong type argument: characterp" building custom-deps while boostrapping, Juanma Barranquero, 2012/05/19
- bug#11519: "Wrong type argument: characterp" building custom-deps while boostrapping, Eli Zaretskii, 2012/05/20
- bug#11519: "Wrong type argument: characterp" building custom-deps while boostrapping, Juanma Barranquero, 2012/05/20
- bug#11519: "Wrong type argument: characterp" building custom-deps while boostrapping, Stefan Monnier, 2012/05/20
- bug#11519: "Wrong type argument: characterp" building custom-deps while boostrapping, Eli Zaretskii, 2012/05/20
- bug#11519: "Wrong type argument: characterp" building custom-deps while boostrapping, Andreas Schwab, 2012/05/21
- bug#11519: "Wrong type argument: characterp" building custom-deps while boostrapping, Eli Zaretskii, 2012/05/21
- bug#11519: "Wrong type argument: characterp" building custom-deps while boostrapping,
Stefan Monnier <=
- bug#11519: "Wrong type argument: characterp" building custom-deps while boostrapping, Eli Zaretskii, 2012/05/22
- bug#11519: "Wrong type argument: characterp" building custom-deps while boostrapping, Stefan Monnier, 2012/05/22
- bug#11519: "Wrong type argument: characterp" building custom-deps while boostrapping, Eli Zaretskii, 2012/05/22
- bug#11519: "Wrong type argument: characterp" building custom-deps while boostrapping, Stefan Monnier, 2012/05/22
- bug#11519: "Wrong type argument: characterp" building custom-deps while boostrapping, Eli Zaretskii, 2012/05/22
- bug#11519: "Wrong type argument: characterp" building custom-deps while boostrapping, Stefan Monnier, 2012/05/23
- bug#11519: "Wrong type argument: characterp" building custom-deps while boostrapping, Ken Brown, 2012/05/23
- bug#11519: "Wrong type argument: characterp" building custom-deps while boostrapping, Eli Zaretskii, 2012/05/23
- bug#11519: "Wrong type argument: characterp" building custom-deps while boostrapping, Stefan Monnier, 2012/05/23
- bug#11519: "Wrong type argument: characterp" building custom-deps while boostrapping, Eli Zaretskii, 2012/05/24