regexp crash

Feb 9, 2007 at 8:02am

regexp crash

Instant crash with regexp substitution with the following patch. I seem
to remember crashing bugs with regexp, but I couldn’t find them in the
forum (via Google) or in my personal archive. I did a search of my
entire drive for any name containing “regexp” – aside from the 4.6.2
object and help, I found only 4.5.5′s versions (not in 4.6.2 path) and
cygwin’s resources (also not in Max’s path).

Max 4.6.2 on WinXP, all incremental updates applied. The postmortem
doesn’t even kick in on this one.

Am I doing something wrong? I’ll try the js version as a stopgap, but I
wouldn’t mind having the native object working.

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 294 151 34 9109513 print 5;
#P newex 249 153 34 9109513 print 4;
#P newex 203 153 34 9109513 print 3;
#P newex 157 153 34 9109513 print 2;
#P message 60 63 29 9109513 1 2 3;
#P newex 106 150 34 9109513 print 1;
#P message 136 60 97 9109513 substitute basil%2%3;
#P newex 119 96 177 9109513 regexp
([\\d]+)[\\s]+([\\d]+)[\\s]+([\\d]+);
#P connect 0 0 2 0;
#P connect 3 0 0 0;
#P connect 1 0 0 0;
#P connect 0 1 4 0;
#P connect 0 2 5 0;
#P connect 0 3 6 0;
#P connect 0 4 7 0;
#P window clipboard copycount 8;

#30209
Feb 9, 2007 at 8:22am

#96076
Feb 9, 2007 at 8:34am

No crash with v4.6 /OSX.4.8
But substitute does report nothing.
What result are you expecting with it?

Bye,
Philippe

#96077
Feb 9, 2007 at 9:29am

Philippe Gruchet wrote:
> No crash with v4.6 /OSX.4.8
> But substitute does report nothing.
> What result are you expecting with it?

I have tried a few different things. Originally I was just going for

input: “int int int”

@re ([\d]+)[\s]+([\d]+)[\s]+([\d]+)
substitute %3-%1-%2

So the expected output from “1 2 3″ would be “3-1-2″

Everything I’ve tried with substitute *except* the help patch has
crashed Max. I’m not really sure what the crucial difference is, unless
the multiple backreferences are a problem.

I also don’t know whether I just have some sort of systemic badness
going on. I don’t recall having problems with js before either, but I
am having a strange one now (there’s another thread open about it).

Thanks for checking this out!

Jon

#96078
Feb 9, 2007 at 10:17am

#96079
Feb 9, 2007 at 12:12pm

Emmanuel Jourdan wrote:
>> So the expected output from “1 2 3″ would be “3-1-2″
>
> Sorry for the silly question but, why don’t you just use sprintf? It’s
> made for string concatenation. Regexp is mainly designed for “searching”.

Not silly, of course. This is a first step on the way to somewhere
else… somewhere terribly boring, unfortunately. I’m not worried about
it, as there are other avenues to PCRE goodness. But I was dismayed
that it didn’t work and took the current patch state down with it.

#96080
Feb 9, 2007 at 11:19pm

I can confirm the problems, and will see if a fix can be easily made.
No promises, though.

jb

Am 09.02.2007 um 10:29 schrieb dlurk:

> Philippe Gruchet wrote:
>> No crash with v4.6 /OSX.4.8
>> But substitute does report nothing.
>> What result are you expecting with it?
>
> I have tried a few different things. Originally I was just going for
>
> input: “int int int”
>
> @re ([\d]+)[\s]+([\d]+)[\s]+([\d]+)
> substitute %3-%1-%2
>
> So the expected output from “1 2 3″ would be “3-1-2″
>
> Everything I’ve tried with substitute *except* the help patch has
> crashed Max. I’m not really sure what the crucial difference is,
> unless the multiple backreferences are a problem.
>
> I also don’t know whether I just have some sort of systemic badness
> going on. I don’t recall having problems with js before either,
> but I am having a strange one now (there’s another thread open
> about it).
>
> Thanks for checking this out!
>
> Jon

#96081
Feb 10, 2007 at 12:18am

Thanks! It’s not a showstopper, so no worries (for me anyway).

Jeremy Bernstein wrote:
> I can confirm the problems, and will see if a fix can be easily made. No
> promises, though.
>
>> Everything I’ve tried with substitute *except* the help patch has
>> crashed Max. I’m not really sure what the crucial difference is,
>> unless the multiple backreferences are a problem.

#96082
Feb 23, 2007 at 11:47am

Just a followup — thanks very much for your clear example. I found
the problem and have fixed it. Should be released sometime soon.

jb

Am 09.02.2007 um 09:02 schrieb dlurk:

> Max 4.6.2 on WinXP, all incremental updates applied. The
> postmortem doesn’t even kick in on this one.

#96083

You must be logged in to reply to this topic.