Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 152279 - Improve stack trace parsing for duplicate detection
Summary: Improve stack trace parsing for duplicate detection
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Jeff Pound CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-30 15:16 EDT by Mik Kersten CLA
Modified: 2006-08-18 19:54 EDT (History)
1 user (show)

See Also:


Attachments
Screen shot (55.01 KB, image/png)
2006-07-30 15:46 EDT, Jeff Pound CLA
no flags Details
Regex match stacktrace (6.87 KB, patch)
2006-08-03 23:33 EDT, Jeff Pound CLA
no flags Details | Diff
Adds tests to cover all known stack trace formats (7.63 KB, patch)
2006-08-08 14:09 EDT, Jeff Pound CLA
no flags Details | Diff
mylar/context/zip (3.52 KB, application/octet-stream)
2006-08-08 14:09 EDT, Jeff Pound CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mik Kersten CLA 2006-07-30 15:16:40 EDT
The following stack reports 71 matches, which is too many.  I wonder if we need to require a more strict match on the first stack frame, e.g. ignore the sourceline (since line numbers change often), but require the fully qualified type name and method name to match.

-- Error Log --
Date: Sun Jul 30 12:07:01 PDT 2006
Message: Could not create editor via factory: org.eclipse.mylar.internal.bugzilla.ui.tasklist.BugzillaReportEditorFactory@149544d

Severity: Error
Plugin ID: org.eclipse.mylar.core
Stack Trace:
java.lang.NullPointerException
	at org.eclipse.mylar.internal.bugzilla.ui.editor.ExistingBugEditor.addAttachContextButton(ExistingBugEditor.java:269)
	at org.eclipse.mylar.internal.bugzilla.ui.editor.ExistingBugEditor.addRadioButtons(ExistingBugEditor.java:174)
	at org.eclipse.mylar.internal.tasks.ui.editors.AbstractRepositoryTaskEditor.createActionsLayout(AbstractRepositoryTaskEditor.java:1205)
	at org.eclipse.mylar.internal.tasks.ui.editors.AbstractRepositoryTaskEditor.createFormContent(AbstractRepositoryTaskEditor.java:472)
Comment 1 Jeff Pound CLA 2006-07-30 15:46:49 EDT
This issue is probably best addressed  by improving the stack trace parsing to be independant of the formatting. If we match stack trace lines against a regular expression which allows for arbitrary spacing and newlines, it should fix this problem.
Comment 2 Jeff Pound CLA 2006-07-30 15:46:55 EDT
Created attachment 47033 [details]
Screen shot

Mik, it looks like the formatting of the stack trace is getting messed up from a copy/paste. This causes the parsing to stop at just the first line of the stack trace which is what gets searched for. This could be a problem when people copy a stack trace from a web browser for example. 


The screen shot shows the search with the formatting fixed and one search result.
Comment 3 Eugene Kuleshov CLA 2006-07-31 18:33:35 EDT
BTW, jrockit vm produces different stack traces...
Comment 4 Jeff Pound CLA 2006-07-31 19:14:10 EDT
(In reply to comment #3)
> BTW, jrockit vm produces different stack traces...
> 

Yeah, I just realized that gcj does as well. I guess we'll have to find a common subset of attributes to improve the stack trace parsing. For now, only Sun style stack traces will parse corectly.
Comment 5 Jeff Pound CLA 2006-08-03 23:33:25 EDT
Created attachment 47381 [details]
Regex match stacktrace

Improves stack trace matching with regular expressions. Stack trace matching is now independant of line formatting (from copy/paste, etc..), spacing, and is compatible with multiple jvms style stack traces.

I added a few new test cases to test the stack trace parsing as well.
Comment 6 Mik Kersten CLA 2006-08-04 00:09:31 EDT
Patch applied and verified with bugs222 bug 41.  Good tests. Does this resolve the bug?

You should create a new report for JRockit stack traces if this doesn't address those, and we'll prioritize according to demand.
Comment 7 Jeff Pound CLA 2006-08-04 00:32:18 EDT
This completes the bug. I googled stack traces from various JVMs (including jrockit). It should work with everyone I saw including:

sun
ibm
bea (jrockit)
gcj/gij
jamvm
sablevm
kaffe
ikvm
cacao
jikes
Comment 8 Mik Kersten CLA 2006-08-04 00:42:47 EDT
Did you add a test case for each format?  A good way to do that is to have multiple tests run one helper method with different stack trace strings so that it is easy to understand and to update.  That would be fantastic because it would insulate us from changes.
Comment 9 Jeff Pound CLA 2006-08-04 00:51:55 EDT
I didn't add separate cases for each of them because most of them are very similar, the pattern matching is based on a subset of the similarities. Some of them just have different information in the brackets at the end of the line or use "/" instead of "." in the namespaces.

I can add a few more test cases to be sure all of the features from each type are covered.
Comment 10 Mik Kersten CLA 2006-08-04 00:54:18 EDT
That would be great, and it totally makes sense only to cover a subset.  Please name the tests according to the vendor name to make it obvious where to go to update when something changes.
Comment 11 Jeff Pound CLA 2006-08-08 14:09:12 EDT
Created attachment 47546 [details]
Adds tests to cover all known stack trace formats

Each test lists the JVMs which share that type of stack trace formatting and includes a small comment indicating what makes that stack trace format different from others.
Comment 12 Jeff Pound CLA 2006-08-08 14:09:14 EDT
Created attachment 47547 [details]
mylar/context/zip
Comment 13 Mik Kersten CLA 2006-08-18 19:54:37 EDT
Patch applied, good tests.