public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/21524] New: Cancelling a TimerTask puts Timer binary heap in inconsistent state
@ 2005-05-11 23:38 jradel at 2wire dot com
2005-05-11 23:39 ` [Bug java/21524] " jradel at 2wire dot com
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: jradel at 2wire dot com @ 2005-05-11 23:38 UTC (permalink / raw)
To: java-prs
java/util/Timer uses a binary heap for its TimerTasks, using task.scheduled as
the key. Calling task.cancel() sets task.scheduled=-1, but doesn't update the
Timer binary heap. This can leave the binary heap in an inconsistent state --
the key shouldn't be modified while the task is in the binary heap. This can
lead to situations where newly scheduled TimerTasks aren't moved to the
appropriate position in the heap, so tasks might fire late (since they are stuck
behind tasks that aren't scheduled to fire for a while).
Attaching a proposed fix.
--
Summary: Cancelling a TimerTask puts Timer binary heap in
inconsistent state
Product: gcc
Version: 3.4.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: java
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jradel at 2wire dot com
CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21524
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug java/21524] Cancelling a TimerTask puts Timer binary heap in inconsistent state
2005-05-11 23:38 [Bug java/21524] New: Cancelling a TimerTask puts Timer binary heap in inconsistent state jradel at 2wire dot com
@ 2005-05-11 23:39 ` jradel at 2wire dot com
2005-05-11 23:43 ` [Bug libgcj/21524] " pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: jradel at 2wire dot com @ 2005-05-11 23:39 UTC (permalink / raw)
To: java-prs
------- Additional Comments From jradel at 2wire dot com 2005-05-11 23:39 -------
Created an attachment (id=8868)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8868&action=view)
Fix for TimerTask cancel inconsistency in Timer binary heap
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21524
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libgcj/21524] Cancelling a TimerTask puts Timer binary heap in inconsistent state
2005-05-11 23:38 [Bug java/21524] New: Cancelling a TimerTask puts Timer binary heap in inconsistent state jradel at 2wire dot com
2005-05-11 23:39 ` [Bug java/21524] " jradel at 2wire dot com
@ 2005-05-11 23:43 ` pinskia at gcc dot gnu dot org
2005-05-12 18:32 ` jradel at 2wire dot com
2005-05-13 16:30 ` tromey at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-11 23:43 UTC (permalink / raw)
To: java-prs
--
What |Removed |Added
----------------------------------------------------------------------------
Component|java |libgcj
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21524
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libgcj/21524] Cancelling a TimerTask puts Timer binary heap in inconsistent state
2005-05-11 23:38 [Bug java/21524] New: Cancelling a TimerTask puts Timer binary heap in inconsistent state jradel at 2wire dot com
2005-05-11 23:39 ` [Bug java/21524] " jradel at 2wire dot com
2005-05-11 23:43 ` [Bug libgcj/21524] " pinskia at gcc dot gnu dot org
@ 2005-05-12 18:32 ` jradel at 2wire dot com
2005-05-13 16:30 ` tromey at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: jradel at 2wire dot com @ 2005-05-12 18:32 UTC (permalink / raw)
To: java-prs
------- Additional Comments From jradel at 2wire dot com 2005-05-12 18:32 -------
(From update of attachment 8868)
Ignore this first proposed fix... it's buggy. Working on a new version.
--
What |Removed |Added
----------------------------------------------------------------------------
Attachment #8868 is|0 |1
obsolete| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21524
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libgcj/21524] Cancelling a TimerTask puts Timer binary heap in inconsistent state
2005-05-11 23:38 [Bug java/21524] New: Cancelling a TimerTask puts Timer binary heap in inconsistent state jradel at 2wire dot com
` (2 preceding siblings ...)
2005-05-12 18:32 ` jradel at 2wire dot com
@ 2005-05-13 16:30 ` tromey at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: tromey at gcc dot gnu dot org @ 2005-05-13 16:30 UTC (permalink / raw)
To: java-prs
------- Additional Comments From tromey at gcc dot gnu dot org 2005-05-13 16:30 -------
Could you write a reduced test case?
Ideally it would be in Mauve form; that way we can easily put it
in the test suite when we put in the fix.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21524
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-05-13 16:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-11 23:38 [Bug java/21524] New: Cancelling a TimerTask puts Timer binary heap in inconsistent state jradel at 2wire dot com
2005-05-11 23:39 ` [Bug java/21524] " jradel at 2wire dot com
2005-05-11 23:43 ` [Bug libgcj/21524] " pinskia at gcc dot gnu dot org
2005-05-12 18:32 ` jradel at 2wire dot com
2005-05-13 16:30 ` tromey at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).