Bug 149736

Summary: window that closes by document.onmousedown and right-clicking into that window causes crash
Product: [Applications] konqueror Reporter: Florian Reinhard <florian.reinhard>
Component: khtmlAssignee: David Faure <faure>
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: html to reproduce the crash
html to reproduce the crash using a popup
stacktrace from kde-crashmanager
stacktrace from kde-crashmanager
valgrind trace (for future reference)

Description Florian Reinhard 2007-09-10 18:52:57 UTC
Version:            (using KDE KDE 3.5.7)
Installed from:    Ubuntu Packages
OS:                Linux

<script type="text/javascript">
    function closeMe(){
        window.close();
    }
    document.onmousedown = closeMe;
</script>

These few lines of javascript make konqueror crash when trying to get a contextmenue in that window.
Comment 1 Florian Reinhard 2007-09-10 18:54:37 UTC
Created attachment 21595 [details]
html to reproduce the crash
Comment 2 Florian Reinhard 2007-09-10 18:55:45 UTC
Created attachment 21596 [details]
html to reproduce the crash using a popup
Comment 3 Florian Reinhard 2007-09-10 19:01:15 UTC
Created attachment 21597 [details]
stacktrace from kde-crashmanager
Comment 4 Florian Reinhard 2007-09-10 19:01:52 UTC
Created attachment 21598 [details]
stacktrace from kde-crashmanager
Comment 5 Tommi Tervo 2007-10-04 12:31:58 UTC
*** Bug 132265 has been marked as a duplicate of this bug. ***
Comment 6 David Faure 2007-10-04 12:35:10 UTC
I see, mainwindow gets deleted while popup is shown; khtml has crash-prevention for this but not konqueror.
Comment 7 David Faure 2007-10-04 12:35:42 UTC
Created attachment 21750 [details]
valgrind trace (for future reference)
Comment 8 David Faure 2007-10-04 13:07:14 UTC
SVN commit 721013 by dfaure:

Fix crash when the window is deleted from onmousedown, which takes effect inside the RMB popupmenu event loop.
BUG: 149736


 M  +15 -10    konq_mainwindow.cc  


WebSVN link: http://websvn.kde.org/?view=rev&revision=721013
Comment 9 David Faure 2008-02-15 17:00:21 UTC
Bug reappared in KDE-4.0.1 due to nested event loop in KDesktopFileActions. Fixed, and added unit test (KonqHtmlTest::rightClickClose) so that this bug doesn't re-appear again.