users@glassfish.java.net

[gf-users] Re: GF crashed

From: Martin Gainty <mgainty_at_hotmail.com>
Date: Tue, 4 Aug 2015 17:17:34 -0400

no org.glassfish.config.support.TranslatedConfigView never set matcher.to to be the max limit of your string

 org.glassfish.config.support.TranslatedConfigView.java

Matcher m = p.matcher(stringValue);
m.to = stringValue.length(); //otherwise Pattern search routine will walk beyond the end as seen in find

public boolean find() {
        int nextSearchIndex = last;
        if (nextSearchIndex == first)
            nextSearchIndex++;

        // If next search starts before region, start it at region
        if (nextSearchIndex < from)
            nextSearchIndex = from;

        // If next search starts beyond region then it fails (this is where Andreas routine fails as to wasnt set)
        if (nextSearchIndex > to) {
            for (int i = 0; i < groups.length; i++)
                groups[i] = -1;
            return false;
        }
        return search(nextSearchIndex);
    }

Martin
______________________________________________
 _____ _ _____ _ _____ ___ _ _____ _ _ _
|_ _| |_ ___ | _ |___ ___ ___| |_ ___ | __|___| _| |_ _ _ _ ___ ___ ___ | __|___ _ _ ___ _| |___| |_|_|___ ___
  | | | | -_| | | . | .'| _| | -_| |__ | . | _| _| | | | .'| _| -_| | __| . | | | | . | .'| _| | . | |
  |_| |_|_|___| |__|__| _|__,|___|_|_|___| |_____|___|_| |_| |_____|__,|_| |___| |__| |___|___|_|_|___|__,|_| |_|___|_|_|
                       |_|


> From: willh_at_mirthcorp.com
> Date: Tue, 4 Aug 2015 09:44:04 -0700
> To: users_at_glassfish.java.net
> Subject: [gf-users] Re: GF crashed
>
>
> On Aug 3, 2015, at 5:29 PM, Andreas Junius wrote:
>
> > No, I didn't change anything and I don't use password aliasing. I don't know what triggered that exception (or rather what was running when this happened), that's the problem.
> >
> > What is a DynamicReloadService, maybe that's the culprit?
>
> I don't know if that's the service that scans the auto deploy directory or not.
>
> It is a curious event if nothing has changed, because clearly "something" changed.
>
> It may just be a UFO, +1 alpha particle radiation and high density RAM (unless you have to have ECC RAM in this machine).
>
> Whatever the problem is, it should be consistent. Regexes may be complicated, but at least they don't contain random numbers.
>
> And it's clearly some specific combination of a Regex pattern (which is there in the code) and whatever it was testing against. Which goes to the point of the potential bug in the Regex code.
>
> You mention (in your other post) that the code doesn't check the length of the CharSequence, but it in fact may have already done so when calculating the "matcher.to" value.
>
> If we assume the regex code is ok, that suggests that the sand was shifting beneath the feet of the regex code. That's rather hard to do in this case since while CharSequence may not be immutable, 99.99% of CharSequences are Strings, which are immutable. So, even a careless thread safety issue is likely not to rear it's ugly head here.
>
> So, this may just be a UFO, a true anomaly. You may just want to not worry about it and see if it pokes it's head around again. Could be a hardware problem manifesting itself.
>
> Regards,
>
> Will Hartung
> (willh_at_mirthcorp.com)
>
>
>
>
>
>
> --
> This message, and any documents attached hereto, may contain confidential
> or proprietary information intended only for the use of the addressee(s)
> named above or may contain information that is legally privileged. If you
> are not the intended addressee, or the person responsible for delivering it
> to the intended addressee, you are hereby notified that reading,
> disseminating, distributing or copying this message is strictly prohibited.
> If you have received this message by mistake, please immediately notify us
> by replying to the message and delete the original message and any copies
> immediately thereafter. Thank you for your cooperation.