Re: NSRegularExpression segfault

2014-12-15 Thread ecir hana
On Mon, Dec 15, 2014 at 8:04 PM, Jens Alfke wrote: > > > Anyway, please file a bug report with Apple, as this seems to be a bug in > NSRegularExpression. > Done! I'm no expert on regular expressions, but my understanding is that all the > implementations have a couple of pathological conditions

Re: NSRegularExpression segfault

2014-12-15 Thread Jens Alfke
> On Dec 15, 2014, at 8:56 AM, ecir hana wrote: > > I don't seem to have "bt" but I got instead from "Problem Report" window: Sounds like you're not running the app in Xcode. If you're hitting a crash or other bug you should always try to reproduce it while running the app in Xcode, so the de

Re: NSRegularExpression segfault

2014-12-15 Thread ecir hana
On Mon, Dec 15, 2014 at 6:59 PM, ecir hana wrote: > > It's not precisely 11, but yes, I need to have many. > By "many" I mean more than 2 and less than...maybe 10. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin request

Re: NSRegularExpression segfault

2014-12-15 Thread ecir hana
On Mon, Dec 15, 2014 at 6:50 PM, Stephen J. Butler wrote: > > It seems to be related to the number of capture groups you have. For > example, this also succeeds for me: > > > ((?:1+)|(?:2+)|(?:3+)|(?:4+)|(?:5+)|(?:6+)|(?:7+)|(?:8+)|(?:9+)|(?:0+)|(?:a+)) > > Do you really need the 11 capture groups

Re: NSRegularExpression segfault

2014-12-15 Thread Stephen J. Butler
It seems to be related to the number of capture groups you have. For example, this also succeeds for me: ((?:1+)|(?:2+)|(?:3+)|(?:4+)|(?:5+)|(?:6+)|(?:7+)|(?:8+)|(?:9+)|(?:0+)|(?:a+)) Do you really need the 11 capture groups? On Mon, Dec 15, 2014 at 11:20 AM, ecir hana wrote: > > > > On Mon, De

Re: NSRegularExpression segfault

2014-12-15 Thread Maxthon Chan
I ran into the same problem trying to write a parser of a markup language. I would suggest you to use some mechanism to break this long input to smaller chunks to match. Reggie is only good for lexical analysis which only deal with smaller chunks, bigger blocks need to be handled using grammatic

Re: NSRegularExpression segfault

2014-12-15 Thread ecir hana
On Mon, Dec 15, 2014 at 6:09 PM, Stephen J. Butler wrote: > > If you read the ICU docs on regular expressions you'll see that it sets an > 8MB limit on head size when evaluating. My guess is that you've run into > this and NSRegularExpression misses a return code somewhere. > I would have thought

Re: NSRegularExpression segfault

2014-12-15 Thread Stephen J. Butler
If you read the ICU docs on regular expressions you'll see that it sets an 8MB limit on head size when evaluating. My guess is that you've run into this and NSRegularExpression misses a return code somewhere. But your pattern is really suboptimal for what you're trying to accomplish. For example,

Re: NSRegularExpression segfault

2014-12-15 Thread ecir hana
On Mon, Dec 15, 2014 at 5:44 PM, Jens Alfke wrote: > > > What's the backtrace? Whenever investigating a crash you should always > start by looking at the stack. (To get this in a text form you can paste > into a message, use the debugger command "bt".) > I don't seem to have "bt" but I got instea

Re: NSRegularExpression segfault

2014-12-15 Thread Jens Alfke
> On Dec 15, 2014, at 8:38 AM, ecir hana wrote: > > Please, can anyone explain to me why does the following program > consistently segfault after 5 characters? I'm running 10.9.5… What's the backtrace? Whenever investigating a crash you should always start by looking at the stack. (To get

NSRegularExpression segfault

2014-12-15 Thread ecir hana
Hi! I recently needed to match some patterns but I encountered a problematic situation. Please, can anyone explain to me why does the following program consistently segfault after 5 characters? I'm running 10.9.5... #import int main () { NSString *pattern = @"(1+)|(2+)|(3+)