Bug 43168 - StackOverflowError using key sequence entry widget
Summary: StackOverflowError using key sequence entry widget
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux-GTK
: P1 critical (vote)
Target Milestone: ---   Edit
Assignee: Douglas Pollock CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 43381 43567 44176 44522 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-09-16 14:49 EDT by Douglas Pollock CLA
Modified: 2003-10-09 10:46 EDT (History)
4 users (show)

See Also:


Attachments
Patch to KeySequenceText (4.32 KB, patch)
2003-09-16 15:51 EDT, Douglas Pollock CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Douglas Pollock CLA 2003-09-16 14:49:36 EDT
I20030916.  The problem is the first patch from Bug 41962.  The modify listener
is re-entrant because the text of the widget isn't updated before another event
is processed.  This problem does not happen on Windows XP.

This may be an SWT problem.
Comment 1 Douglas Pollock CLA 2003-09-16 15:51:04 EDT
Created attachment 6119 [details]
Patch to KeySequenceText

Fixes the StackOverflow error by removing the modification listener just before
making a text change driven by the key sequence, and places the listener back
on afterward.  The idea is that, in general, the modification listener
translates textual changes into corresponding changes to the key sequence.  In
this particular case, the textual change is driven by a change to the key
sequence, so the reverse operation is not needed.

The problem occurred because SWT calls a delete (with full event propagation)
before inseting the new text.  I'll file a separate bug against SWT's GTK
implementation so that they have a chance to respond.

Minor cosmetic changes were made to remove warnings.
Comment 2 Douglas Pollock CLA 2003-09-16 15:55:43 EDT
nick: you said you wanted to see some of my patches.  here's one -- fixing a
stack overflow and making some cosmetic changes.
Comment 3 Douglas Pollock CLA 2003-09-16 16:33:55 EDT
See Bug 43177 for the separate GTK bug.
Comment 4 Nick Edgar CLA 2003-09-22 23:16:17 EDT
Changes applied.  They look reasonable, however I did not do any extra testing.

Note that the extra get methods to avoid accesses to outer private fields are 
not strictly necessary.  Contrary to the currently posted guidelines, I don't 
think that the compile-time check for access to outer private members is 
terribly helpful.  I'll be updating the guidelines.
Comment 5 Douglas Pollock CLA 2003-09-23 09:27:52 EDT
Patch is applied.  This should prevent the StackOverflowError on GTK.  If SWT
makes changes to how ModifyEvents are fired, then this fix may not be needed. 
However, it is still probably a decent safety precaution. 
Comment 6 Chris McLaren CLA 2003-09-24 16:17:32 EDT
*** Bug 43381 has been marked as a duplicate of this bug. ***
Comment 7 Debbie Wilson CLA 2003-09-25 10:51:33 EDT
*** Bug 43567 has been marked as a duplicate of this bug. ***
Comment 8 Debbie Wilson CLA 2003-10-06 10:58:59 EDT
*** Bug 44176 has been marked as a duplicate of this bug. ***
Comment 9 Chris McLaren CLA 2003-10-09 10:46:50 EDT
*** Bug 44522 has been marked as a duplicate of this bug. ***