Bug 35826 - crash when makeSuccessCallbacks is called after disconnectFrame
Summary: crash when makeSuccessCallbacks is called after disconnectFrame
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P1 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2010-03-06 00:36 PST by arno.
Modified: 2010-06-16 09:32 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description arno. 2010-03-06 00:36:53 PST
Hi,
when a request for geolocation permission is emited, and document asking for permission is unloaded, it's possible for the embedder to still call setIsAllowed (possibly other functions) after document has been unloaded.

Then, a crash occurs in Geolocation::makeSuccessCallbacks or Geolocation::handleError
The crash happens in copyToVector inline function.
After investigating, I discovered in this part of copyToVector

        vector.resize(collection.size());
        
        iterator it = collection.begin();
        iterator end = collection.end();
        for (unsigned i = 0; it != end; ++it, ++i)
            vector[i] = (*it).first;

collection.size() evaluates to 1, but loop is entered twice; I don't understood why.

Is it a good idea to have a boolean member m_isDisconnected, set it to false in disconnectFrame, and check its value at start of handleError and makeSuccessCallbacks ? or is there a better solution ?
Comment 1 arno. 2010-03-06 00:42:36 PST
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7295511 in WebCore::Geolocation::makeSuccessCallbacks() ()
   from /home/arno/webkit/WebKit/WebKitBuild/arno/Release/.libs/libwebkit-1.0.so
(gdb) where
#0  0x00007ffff7295511 in WebCore::Geolocation::makeSuccessCallbacks() ()
   from /home/arno/webkit/WebKit/WebKitBuild/arno/Release/.libs/libwebkit-1.0.so
#1  0x00007ffff7295797 in WebCore::Geolocation::setIsAllowed(bool) ()
   from /home/arno/webkit/WebKit/WebKitBuild/arno/Release/.libs/libwebkit-1.0.so
Comment 2 Alexey Proskuryakov 2010-05-07 14:43:51 PDT
<rdar://problem/7958405>
Comment 3 Alexey Proskuryakov 2010-05-07 16:46:16 PDT
This isn't reproducible in Safari. Does this still happen on Linux? Was it Qt or Gtk?
Comment 4 Alexey Proskuryakov 2010-06-16 09:32:29 PDT
No answer, closing. Geolocation lifetime handling is being rewritten now anyway.