stellar2012wxg / chromiumembedded

Automatically exported from code.google.com/p/chromiumembedded
0 stars 1 forks source link

Crash when exiting Application on Mac OS X 10.6.8 #491

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Start an application embedding cef.
2. Load any page with some content.
3. Quit the application.

What is the expected output? What do you see instead?
Closing the app should not cause exceptions.

What version of the product are you using? On what operating system?
Mac OS X - cef binary package 1.963.439

Please provide any additional information below.

Below is the app output.
For now I haven't been able to build this version of cef on windows or mac, 
therefor I can't specify the exact location and/or reason. Once I manage I'll 
update this issue, if it persists.

"
[0129/020238:VERBOSE1:nsimage_cache.mm(38)] Suggest including the extension in 
the image name
LEAK: 10 CachedResource
LEAK: 2 Frame
LEAK: 1 Page
LEAK: 452 WebCoreNode
LEAK: 256 RenderObject
[0129/020937:FATAL:lock_impl_posix.cc(45)] Check failed: rv == 0 (22 vs. 0)
Backtrace:
    0   libcef.dylib                        0x13f27aef base::debug::StackTrace::StackTrace() + 63
    1   libcef.dylib                        0x13f27a8b base::debug::StackTrace::StackTrace() + 43
    2   libcef.dylib                        0x13f69a6c logging::LogMessage::~LogMessage() + 76
    3   libcef.dylib                        0x13f6854b logging::LogMessage::~LogMessage() + 43
    4   libcef.dylib                        0x13ff7932 base::internal::LockImpl::Lock() + 226
    5   libcef.dylib                        0x152182c6 base::Lock::Acquire() + 54
    6   libcef.dylib                        0x14217809 base::AutoLock::AutoLock(base::Lock&) + 57
    7   libcef.dylib                        0x14214be9 base::AutoLock::AutoLock(base::Lock&) + 57
    8   libcef.dylib                        0x151d8b9d CefThread::CurrentlyOn(CefThread::ID) + 61
    9   libcef.dylib                        0x151bbd54 CefContext::UIT_FinishShutdown(base::WaitableEvent*, base::WaitableEvent*) + 84
    10  libcef.dylib                        0x151b5848 CefContext::Shutdown() + 744
    11  libcef.dylib                        0x151bbc29 CefContext::~CefContext() + 73
    12  libcef.dylib                        0x151bbbbb CefContext::~CefContext() + 43
    13  libcef.dylib                        0x151bbb5e CefContext::~CefContext() + 46
    14  libcef.dylib                        0x151bfbff CefContext::Release() + 95
    15  libcef.dylib                        0x151c54ef CefRefPtr<CefContext>::~CefRefPtr() + 63
    16  libcef.dylib                        0x151bdd9b CefRefPtr<CefContext>::~CefRefPtr() + 43
    17  libSystem.B.dylib                   0x9180fbff __cxa_finalize + 208
    18  libSystem.B.dylib                   0x9180fb14 exit + 33
    19  AppKit                              0x985192be -[NSApplication terminate:] + 1056
    20  Foundation                          0x96ffc369 __NSFireDelayedPerform + 537
    21  CoreFoundation                      0x96597a3b __CFRunLoopRun + 8059
    22  CoreFoundation                      0x965953c4 CFRunLoopRunSpecific + 452
    23  CoreFoundation                      0x965951f1 CFRunLoopRunInMode + 97
    24  HIToolbox                           0x9769de04 RunCurrentEventLoopInMode + 392
    25  HIToolbox                           0x9769daf5 ReceiveNextEventCommon + 158
    26  HIToolbox                           0x9769da3e BlockUntilNextEventMatchingListInMode + 81
    27  AppKit                              0x982e0595 _DPSNextEvent + 847
    28  AppKit                              0x982dfdd6 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 156
    29  AppKit                              0x982a21f3 -[NSApplication run] + 821
    30  ???                                 0x02db7574 0x0 + 47936884
    31  ???                                 0x02dbe420 0x0 + 47965216
    32  ???                                 0x02db84f8 0x0 + 47940856
    33  ???                                 0x02d3edc0 0x0 + 47443392
    34  ???                                 0x02db47ec 0x0 + 47925228
    35  libcef.dylib                        0x13efca4e base::MessagePumpNSApplication::DoRun(base::MessagePump::Delegate*) + 350
    36  libcef.dylib                        0x13efba1d base::MessagePumpCFRunLoopBase::Run(base::MessagePump::Delegate*) + 189
    37  libcef.dylib                        0x13f7eac3 MessageLoop::RunInternal() + 291
    38  libcef.dylib                        0x13f7dd5b MessageLoop::RunHandler() + 43
    39  libcef.dylib                        0x13f7dca0 MessageLoop::Run() + 64
    40  libcef.dylib                        0x151cef4b CefMessageLoopForUI::DoMessageLoopIteration() + 43
    41  libcef.dylib                        0x151cefa2 CefMessageLoopForUI::RunMessageLoop() + 50
    42  libcef.dylib                        0x151cdeae CefProcess::RunMessageLoop() + 318
    43  libcef.dylib                        0x151b5d56 CefRunMessageLoop() + 582
    44  libcef.dylib                        0x13ee86ef cef_run_message_loop + 31
    45  ???                                 0x02dbe329 0x0 + 47964969
    46  ???                                 0x02dbe204 0x0 + 47964676
    47  ???                                 0x02db8588 0x0 + 47941000
    48  ???                                 0x02d3edc0 0x0 + 47443392
    49  ???                                 0x02db47ec 0x0 + 47925228
    50  AppKit                              0x9829a289 NSApplicationMain + 574
    51  ???                                 0x02db4c96 0x0 + 47926422
    52  ???                                 0x02db4a94 0x0 + 47925908
    53  ???                                 0x004a8ff8 0x0 + 4886520
    54  ???                                 0x004a9156 0x0 + 4886870
    55  Crystalbyte.Borderline.TestShell.MacOS 0x0000d282 mono_jit_runtime_invoke + 722
    56  Crystalbyte.Borderline.TestShell.MacOS 0x001a436a mono_runtime_invoke + 170
    57  Crystalbyte.Borderline.TestShell.MacOS 0x001a6f01 mono_runtime_exec_main + 705
    58  Crystalbyte.Borderline.TestShell.MacOS 0x001a6111 mono_runtime_run_main + 929
    59  Crystalbyte.Borderline.TestShell.MacOS 0x00069995 mono_jit_exec + 149
    60  Crystalbyte.Borderline.TestShell.MacOS 0x0006bf13 mono_main + 9587
    61  Crystalbyte.Borderline.TestShell.MacOS 0x00002299 main + 441

Original issue reported on code.google.com by krasshir...@googlemail.com on 29 Jan 2012 at 2:26

GoogleCodeExporter commented 9 years ago
Seems to be related to this issue.
http://code.google.com/p/chromium/issues/detail?id=102161

Original comment by krasshir...@googlemail.com on 30 Jan 2012 at 7:21

GoogleCodeExporter commented 9 years ago
The more immediate problem based on your call stack seems to be that you're not 
calling CefShutdown().

Original comment by magreenb...@gmail.com on 30 Jan 2012 at 7:24

GoogleCodeExporter commented 9 years ago
Now that you mentioned it.
It did not occur to me since I found it to be implied by the code below that 
shutdown will be called after the my message loop ends. It seems however, that 
the error occurs before the loop actually ends, any insights ?
It works as expected on Windows, I guess there must be a subtle difference on a 
mac when closing the window.

        public static void Run() {
            NativeMethods.RunMessageLoop(); // maps to cef_run_message_loop.
            Shutdown();
        }

         public static void Shutdown() {
            if (!IsInitialized) {
                Debug.WriteLine("Framework not initialized.");
                return;
            }

            ReleasePool.ReleaseAll();
            NativeMethods.Shutdown(); // maps to cef_shutdown
            IsInitialized = false;
        }

Original comment by krasshir...@googlemail.com on 31 Jan 2012 at 10:31

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I checked the cefclient and in it you call cef_shutdown inside the 
applicationWillTerminate method. After doing the same the issue has been 
resolved, it seems quitting the application on a mac doesn't seem to just break 
the message loop as it does on windows. Code after the run method on a mac will 
probably never be executed :(

Original comment by krasshir...@googlemail.com on 31 Jan 2012 at 5:43

GoogleCodeExporter commented 9 years ago
That's correct, CefRunMessageLoop() will never exit in a Mac application. See 
comment #4 for issue 443.

Original comment by magreenb...@gmail.com on 31 Jan 2012 at 6:13