Bug 23459 - Workers are not properly terminated if execution hasn't begun yet
Summary: Workers are not properly terminated if execution hasn't begun yet
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Alexey Proskuryakov
Depends on:
Reported: 2009-01-21 12:01 PST by Alexey Proskuryakov
Modified: 2009-01-23 06:51 PST (History)
0 users

See Also:

proposed patch (1.53 KB, patch)
2009-01-21 12:04 PST, Alexey Proskuryakov
darin: review+
Details | Formatted Diff | Diff
Alternative patch (1.48 KB, patch)
2009-01-22 00:27 PST, Alexey Proskuryakov
oliver: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2009-01-21 12:01:25 PST
If Worker.terminate() is called before the worker thread has begun execution, it cannot forbid script execution. So, evaluating the script source can result in the thread entering a loop forever, taking 100% of processor (core) time.
Comment 1 Alexey Proskuryakov 2009-01-21 12:04:20 PST
Created attachment 26900 [details]
proposed patch
Comment 2 Darin Adler 2009-01-21 13:46:11 PST
Comment on attachment 26900 [details]
proposed patch

Comment 3 Alexey Proskuryakov 2009-01-22 00:27:04 PST
Created attachment 26924 [details]
Alternative patch

I changed my mind - I now think it's better to go through the normal code path, to avoid getting out of sync in the future. It's slightly less efficient, but this use case is definitely not something to optimize for.
Comment 4 Alexey Proskuryakov 2009-01-23 06:51:15 PST
Committed revision 40159.