| Summary: | Stack overflow in P2TargetUtils | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] PDE | Reporter: | Andrew Niefer <aniefer> | ||||
| Component: | UI | Assignee: | Curtis Windatt <curtis.windatt.public> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | ankur_sharma, curtis.windatt.public, jeffmcaffer | ||||
| Version: | 3.7 | ||||||
| Target Milestone: | 3.7 M4 | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Andrew Niefer
Jeff, can you look at this. We either need to prevent concurrent access to the method (or at least the agent creation section) or alter how we call the GC. Consider for M4. Created attachment 184799 [details]
Proposed fix
This fix avoids the stack overflow by getting the p2 garbage collector directly from the created agent rather than calling the utility method.
I have applied the patch to HEAD and will release for the next build towards M4. Jeff, please take a look to see if the fix is reasonable or whether we need to do more in M5. I took a quick look at the patch and it should do fine. Thanks. I'll take a more comprehensive look later and see if there are any refinements for M5. Verified the fix is in I20101208-1300 I have to say I'm a little confused by how this stack overflow could be happening. createAgent() creates the agent and registers it as a service. getAgent looks for the registered service. The only way this should loop is if somehow the service is not getting registered or not found.
createAgent() does not have a failure path (other than runtime exceptions).
getAgent() can fail lookup if a) the service really is not there or b) if the location does not parse well in an LDAP filter. a) should not happen since the values for the filter are the same on creation and lookup. b) could be happening if the value of
AGENT_LOCATION = URIUtil.fromString("file:" + PDECore.getDefault().getStateLocation().append(".p2"));
is something that causes an error when embedded in an LDAP filter.
My concern here is that with the fix we will prevent the stack overflow but the net result is that we'll be creating a new agent every time we look for one in whatever scenario Andrew has.
Andrew, any thoughts on how to reproduce this? I've been running/testing selfhosted all along and its been working fine. Is there something you can think of that would be unique about your situation?
|