This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: StackOverflow
- From: Per Bothner <per at bothner dot com>
- To: Matthieu Vachon <matthieu dot o dot vachon at gmail dot com>, "kawa at sourceware dot org" <kawa at sourceware dot org>
- Date: Thu, 14 Nov 2013 12:24:35 -0800
- Subject: Re: StackOverflow
- Authentication-results: sourceware.org; auth=none
- References: <CAOTvmo=JcUiYA8=1jZR4E5qDpzLLugaUH8TtyAZqxJkfZaZujA at mail dot gmail dot com>
On 11/14/2013 11:58 AM, Matthieu Vachon wrote:
I'm must say that I'm not sure what is the root cause of this. This
seems to have happened after a long period usage of our application.
After the first StackOverflow occurred, I was not able to do anything
since every operation was throwing the StackOverflow error.
After restarting the application, I was able to perform the inital
operation that has first pop the StackOverflow error. I'm unsure if I
will hit the problem again.
That may take it hard to debug. But some ideas:
First, uncomment the DEBUGGING section in Location.java.
Next change ThreadLocation.getLocation to something like:
public NamedLocation<T> getLocation ()
{
if (property != ANONYMOUS)
{
NamedLocation r = Environment.getCurrent().getLocation(name,
property, hash, true);
if (r.base == this) new Error("CYCLE1 "+this+" loc:"+r+"
prop:"+property+" global:"+global).printStackTrace();
return r;
}
NamedLocation entry = (NamedLocation) thLocal.get();
if (entry == null)
{
entry = new SharedLocation(name, property, 0);
if (global == this) new Error("CYCLE2 "+this).printStackTrace();
if (global != null)
entry.setBase(global);
thLocal.set(entry);
}
if (entry.base == this) new Error("CYCLE3 "+this+"
loc:"+entry).printStackTrace();
return entry;
}
If this triggers that can provide some clues. Of course if it's
repeatable and
you have Locations with the same Location.id show up then it is (relatively)
easy to debug.
My guess the problem will trigger in CYCLE1. Maybe the name will allow
you do to
map back to the corresponding source definition - perhaps an implicit or
explicit define-variable. This code is pretty old, so I'd have to do some
reviewing as to what is supposed to happen.
--
--Per Bothner
per@bothner.com http://per.bothner.com/