regexp troubles, expert help needed

Nov 9, 2006 at 4:12pm

regexp troubles, expert help needed

Argh! My small example patch awaits approval. Just over 40 KB. Let’s
see if this message comes trough…. Input is a list of chars with
extra spaces, like z i p @ k n o w a r e . n l

First regexp get rids of the spaces, the second does a validity check
of some sorts…


Zip Boterbloem
Media Mechanics
Zwaluwstraat 54
2025 VR Haarlem
The Netherlands
+31627014758
zip@knoware.nl

#28609
Nov 9, 2006 at 4:56pm

On 9 nov. 06, at 17:12, Zip Boterbloem wrote:

> Argh! My small example patch awaits approval. Just over 40 KB.
> Let’s see if this message comes trough…. Input is a list of chars
> with extra spaces, like z i p @ k n o w a r e . n l
>
> First regexp get rids of the spaces, the second does a validity
> check of some sorts…

Strange… it works here (PPC). I just put the – in the class of
character at the beginning (it seems PCRE is more intelligent and
knows when – have the special meaning inside a class). Can you
confirm the crash with the following patch?

ej

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P hidden newex 411 150 219 196617 loadmess set;
#P message 35 67 64 196617 to- to @ti ti;
#P message 140 186 119 196617 to-to@titi;
#P newex 140 157 62 196617 prepend set;
#P message 304 281 119 196617 to-to@titi;
#P newex 304 252 62 196617 prepend set;
#P message 241 338 119 196617 zip@knoware.nl;
#P newex 241 309 62 196617 prepend set;
#P newex 118 130 188 196617 regexp @re (\\S)\\s? @substitute %1;
#P message 159 93 119 196617 z i p @ k n o w a r e . n l;
#P button 222 307 15 0;
#P button 274 281 15 0;
#P message 118 67 82 196617 to -to@ti ti.com;
#P newex 118 218 219 196617 regexp [-a-z0-9._%]+@[-a-z0-9.]+\\.[a-z]+;
#P connect 4 0 5 0;
#P connect 1 0 5 0;
#P connect 12 0 5 0;
#P connect 5 0 0 0;
#P connect 5 0 10 0;
#P hidden connect 13 0 11 0;
#P connect 10 0 11 0;
#P connect 0 2 3 0;
#P connect 0 2 6 0;
#P hidden connect 13 0 7 0;
#P connect 6 0 7 0;
#P connect 0 3 2 0;
#P connect 0 3 8 0;
#P hidden connect 13 0 9 0;
#P connect 8 0 9 0;
#P window clipboard copycount 14;

#88104
Nov 9, 2006 at 5:15pm

Hi Emmanuel,

Thanks for having a look! Much appreciated.

It doesn’t crash on any rogue(not a valid email address) input, but
every once in a while(3 times in the last hour). Can’t see a pattern
yet. Lots of %@. characters seem to trigger it. I should save all
input to a file, so I can see what causes it, but I’m just to busy
for this sort of bug hunting. Anyway, methinks it shouldn’t crash on
any input, overdrive on or not.

Thanks again for your time,

Zip Boterbloem
Media Mechanics
Zwaluwstraat 54
2025 VR Haarlem
The Netherlands
+31627014758
zip@knoware.nl

Op 9-nov-2006, om 17:56 heeft Emmanuel Jourdan het volgende geschreven:

> On 9 nov. 06, at 17:12, Zip Boterbloem wrote:
>
>> Argh! My small example patch awaits approval. Just over 40 KB.
>> Let’s see if this message comes trough…. Input is a list of
>> chars with extra spaces, like z i p @ k n o w a r e . n l
>>
>> First regexp get rids of the spaces, the second does a validity
>> check of some sorts…
>
> Strange… it works here (PPC). I just put the – in the class of
> character at the beginning (it seems PCRE is more intelligent and
> knows when – have the special meaning inside a class). Can you
> confirm the crash with the following patch?
>
> ej
>
> #P window setfont “Sans Serif” 9.;
> #P window linecount 1;
> #P hidden newex 411 150 219 196617 loadmess set;
> #P message 35 67 64 196617 to- to @ti ti;
> #P message 140 186 119 196617 to-to@titi;
> #P newex 140 157 62 196617 prepend set;
> #P message 304 281 119 196617 to-to@titi;
> #P newex 304 252 62 196617 prepend set;
> #P message 241 338 119 196617 zip@knoware.nl;
> #P newex 241 309 62 196617 prepend set;
> #P newex 118 130 188 196617 regexp @re (\\S)\\s? @substitute %1;
> #P message 159 93 119 196617 z i p @ k n o w a r e . n l;
> #P button 222 307 15 0;
> #P button 274 281 15 0;
> #P message 118 67 82 196617 to -to@ti ti.com;
> #P newex 118 218 219 196617 regexp [-a-z0-9._%]+@[-a-z0-9.]+\\.[a-
> z]+;
> #P connect 4 0 5 0;
> #P connect 1 0 5 0;
> #P connect 12 0 5 0;
> #P connect 5 0 0 0;
> #P connect 5 0 10 0;
> #P hidden connect 13 0 11 0;
> #P connect 10 0 11 0;
> #P connect 0 2 3 0;
> #P connect 0 2 6 0;
> #P hidden connect 13 0 7 0;
> #P connect 6 0 7 0;
> #P connect 0 3 2 0;
> #P connect 0 3 8 0;
> #P hidden connect 13 0 9 0;
> #P connect 8 0 9 0;
> #P window clipboard copycount 14;
>
>

#88105
Nov 10, 2006 at 1:10pm

I agree, but unless you’re willing to invest the time to show how it
crashes, It can’t be fixed. Also, please, in the future, send
patches, not pictures.

jb

Am 09.11.2006 um 18:15 schrieb Zip Boterbloem:

> Anyway, methinks it shouldn’t crash on any input, overdrive on or not.

#88106
Nov 10, 2006 at 2:37pm

Hi Jeremy,

I ‘ve sent patches. But they’re stopped by the moderator(they are
just over 40 k), who doesn’t send them on. So this was the best I
could do.

Cheers,

Zip

Zip Boterbloem
Media Mechanics
Zwaluwstraat 54
2025 VR Haarlem
The Netherlands
+31627014758
zip@knoware.nl

Op 10-nov-2006, om 14:10 heeft Jeremy Bernstein het volgende geschreven:

> I agree, but unless you’re willing to invest the time to show how
> it crashes, It can’t be fixed. Also, please, in the future, send
> patches, not pictures.
>
> jb
>
> Am 09.11.2006 um 18:15 schrieb Zip Boterbloem:
>
>> Anyway, methinks it shouldn’t crash on any input, overdrive on or
>> not.
>

#88107
Nov 10, 2006 at 2:45pm

Zip – we’d generally prefer if you send _small_ patches which clearly
and obviously demonstrate the problem, without distractions like
network communication, etc. Basically, a regexp object with a string
that breaks it is all we need. And that won’t be 40k.

jb

Am 10.11.2006 um 15:37 schrieb Zip Boterbloem:

> I ‘ve sent patches. But they’re stopped by the moderator(they are
> just over 40 k), who doesn’t send them on. So this was the best I
> could do.

#88108
Nov 10, 2006 at 2:55pm

On 10 nov. 06, at 15:37, Zip Boterbloem wrote:

> Hi Jeremy,
>
> I ‘ve sent patches. But they’re stopped by the moderator(they are
> just over 40 k), who doesn’t send them on. So this was the best I
> could do.

You can also send part of the patch by just select/copy and paste the
contents as text (since MaxMSP 4.5.5).

Best,
ej

#88109
Nov 10, 2006 at 3:59pm

I type some random characters, lots of %@. characters. 99 out of 100
times this works OK. It crashes 1 out of 100 times, Max disappears
taking the culprit string with it. Yesterday afternoon it crashed
three times in an hour of testing. This is not good enough for
unattended use in a museum installation. I don’t have the time to log
everything to a file. Must get big patch working before Monday….
Wiil revert to JS regular expressions for now.

Thanks for your help anyway.

Best regards,

Zip

Zip Boterbloem
Media Mechanics
Zwaluwstraat 54
2025 VR Haarlem
The Netherlands
+31627014758
zip@knoware.nl

Op 10-nov-2006, om 15:45 heeft Jeremy Bernstein het volgende geschreven:

> Zip – we’d generally prefer if you send _small_ patches which
> clearly and obviously demonstrate the problem, without distractions
> like network communication, etc. Basically, a regexp object with a
> string that breaks it is all we need. And that won’t be 40k.
>
> jb
>
> Am 10.11.2006 um 15:37 schrieb Zip Boterbloem:
>
>> I ‘ve sent patches. But they’re stopped by the moderator(they are
>> just over 40 k), who doesn’t send them on. So this was the best I
>> could do.
>

#88110
Nov 10, 2006 at 4:23pm

OK, I hope you’ll take the time after your deadline to follow up.

jb

Am 10.11.2006 um 16:59 schrieb Zip Boterbloem:

> I type some random characters, lots of %@. characters. 99 out of
> 100 times this works OK. It crashes 1 out of 100 times, Max
> disappears taking the culprit string with it. Yesterday afternoon
> it crashed three times in an hour of testing. This is not good
> enough for unattended use in a museum installation. I don’t have
> the time to log everything to a file. Must get big patch working
> before Monday…. Wiil revert to JS regular expressions for now.
>
> Thanks for your help anyway.

#88111
Nov 10, 2006 at 7:14pm

I have a whole list of rogue objects/behaviour. If I ever get the
time…

Best,

Zip Boterbloem
Media Mechanics
Zwaluwstraat 54
2025 VR Haarlem
The Netherlands
+31627014758
zip@knoware.nl

Op 10-nov-2006, om 17:23 heeft Jeremy Bernstein het volgende geschreven:

> OK, I hope you’ll take the time after your deadline to follow up.
>
> jb
>
> Am 10.11.2006 um 16:59 schrieb Zip Boterbloem:
>
>> I type some random characters, lots of %@. characters. 99 out of
>> 100 times this works OK. It crashes 1 out of 100 times, Max
>> disappears taking the culprit string with it. Yesterday afternoon
>> it crashed three times in an hour of testing. This is not good
>> enough for unattended use in a museum installation. I don’t have
>> the time to log everything to a file. Must get big patch working
>> before Monday…. Wiil revert to JS regular expressions for now.
>>
>> Thanks for your help anyway.
>

#88112

You must be logged in to reply to this topic.