#75 Internal error processing regular expr.

release
closed-fixed
Eddy De Greef
Program (402)
5
2001-10-04
2001-09-12
Eddy De Greef
No

A syntax highlighting problem was reported at
the discussion list by Igor Bukanov:

> I got while editing a Java file:
> NEdit: Internal error processing regular expression
> (NULL parameter to `ExecRE')
>
> To reproduce, put the cursor after } on the line 5 in
> the attached x.java (after closing } for the static
> block) and hit BackSpace to delete }.
>
> Here is the file inline if you did not get the
> attachment:
> ----------------------x.java------------------
> class Context {
> private static int[]
> intObjCache = new Integer[10];
> static {
> }
> }
> ----------------------end of x.java-----------

It turned out to be triggered by a customized
set of Java highlighting patterns (relevant portions
are in the attached .nedit file), but it is caused
by a flaw in the highlighting routines.

I currently don't know how to fix it without risking
to break something else. Since it is probably a rare
problem, I think it is best to leave it as is till
the 5.2 release, especially since we have another
highlighting patch pending that may interact.

Discussion

1 2 > >> (Page 1 of 2)
  • Eddy De Greef
    Eddy De Greef
    2001-09-12

    .nedit file containing stripped java patterns

     
    Attachments
  • Eddy De Greef
    Eddy De Greef
    2001-09-12

    • assigned_to: nobody --> edg
    • status: open --> open-postponed
     
  • Scott Tringali
    Scott Tringali
    2001-09-13

    Logged In: YES
    user_id=11321

    I agree. If this happens in 5.1 and you think it might be a
    bit risky to fix, by all means, take your time and commit it
    just to the mainline. I don't think it crashes, right?

     
  • Eddy De Greef
    Eddy De Greef
    2001-09-13

    Logged In: YES
    user_id=73597

    Up to now, I haven't seen any crashes with 5.2RC1 but
    I cannot guarantee that it will not happen (there was
    one crash report for 5.1.1, but 5.2RC1 did handle that
    one correctly).
    I believe the highlighting code was heaviliy modified
    after 5.1.1 (by Mark, before we had CVS), so strictly
    speaking, identical internal error messages can be caused
    by different bugs, and it is hard to say whether an
    error is 5.2-specific or not.
    But in general, I think the highlighting has improved
    in 5.2, so I don't worry too much (yet).

     
  • Eddy De Greef
    Eddy De Greef
    2001-09-14

    Logged In: YES
    user_id=73597

    Another bug report came in (by Theo Band):

    > I experience the same problem. I also have
    > customized VHDL patterns. The reason for that
    > was that the build-in patterns had an typo for
    > one of the keywords. Removing my .nedit (and
    > using the new build-in patterns) does not show
    > this problem.
    >
    > il_ram_lane3:dp_w8_r16_ram
    > GENERIC MAP (
    > genff => false
    > )
    > PORT MAP (
    >
    > If I type somewhere within the brackets of the
    > generic map, syntax highlighting reverts to bold
    > white and the same error message: NEdit:
    > Internal error processing regular expression
    > (NULL parameter to `ExecRE')
    >
    > ksh>strings `which nedit`|grep highlight.c,v
    > $Id: highlight.c,v 1.18 2001/08/17 21:54:25 edg Exp $
    >
    > Experienced both with linux and Solaris version
    > (pre-compiled exec)
    >
    > Cheers,
    > Theo

    His (stripped) VHDL patterns are attached.

    It may not be such a rare problem after all (it can
    happen with any pattern that has only coloring
    sub-patterns), so it probably better not to leave it
    in 5.2.

    I believe I have a solution and I'm currently testing
    it. I tend to upload it to the release branch soon,
    because it is important that as many people as possible
    test it on various languages. (I'll upload it together
    with patch #460229, because the two are related).

     
  • Eddy De Greef
    Eddy De Greef
    2001-09-14

    .nedit file containing stripped VHDL patterns

     
    Attachments
  • Eddy De Greef
    Eddy De Greef
    2001-09-14

    Logged In: YES
    user_id=73597

    Yet another bug report (again Igor Bukanov):

    > I managed to get in 5.2 RC1 (binary release for
    > Linux/glibc)
    >
    > NEdit: Internal error processing regular expression (NULL
    > parameter to `ExecRE')
    >
    > with the default Java pattern (I removed my ~/.nedit
    > during the test)
    >
    > To reproduce, go to the end of the line 5 in the attached
    > a.java and hit the backspace key to remove ';'.
    >
    > ------a.java------------
    > class A {
    > void method
    > (String x)
    > {
    > y();
    > }
    > }
    > ------end of a.java-----

    Same problem, and the solution that I'm testing seems
    to hold.

     
  • Eddy De Greef
    Eddy De Greef
    2001-09-14

    • status: open-postponed --> open-fixed
     
  • Eddy De Greef
    Eddy De Greef
    2001-09-14

    Logged In: YES
    user_id=73597

    I've committed a fix (together with a fix for bug #459965,
    which is related) to the BETA-5-2 branch:

    Checking in source/highlight.c;
    /cvsroot/nedit/nedit/source/highlight.c,v <-- highlight.c
    new revision: 1.18.2.1; previous revision: 1.18
    done

    It is a fairly large patch in one of the core routines
    of the incremental reparsing, and I don't really feel
    at ease with committing it to the release branch, but it
    should only affect the behaviour in cases that resulted
    in an internal error before (which are still pretty rare).

    I would appreciate it if as many people as possible could
    test it on as many languages as possible (especially
    the ones with complex patterns) and report any new
    highlighting glitches (including noticable performance
    drops).

     
  • Eddy De Greef
    Eddy De Greef
    2001-10-04

    • status: open-fixed --> closed-fixed
     
1 2 > >> (Page 1 of 2)