Kodi Community Forum

Full Version: Kodi crashes in CWinSystemOSX::UpdateResolutions when TV turns off
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Hi all,

First time poster, long time lurker and Kodi (XBMC) user Smile

I'm using Kodi nightlies for couple of years already (updating once or twice a week) and had only really good experiences with stability so far. Amazing job everybody on Kodi team!

Recently however Kodi started to crash every time I turn off my TV and receiver. My Mac Mini is hooked to a receiver through HDMI and never shuts down.
For a while I did not have time to look into this further and I just kept updating hoping the crash goes away. It did not stop, therefore I looked into this a bit more.

It seems like the recent (23 days old) change c2d14c7 in /windowing/osx/WinSystemOSX.mm introduced display name query, but does not perform nil pointer check.
This looks like something which could easily cause crash if the HDMI is lost (receiver shuts down) and primary display is not available anymore.

I'm including the crash callstack which shows that nil/null pointer exception in string creation is indeed happening:
Code:
Process:               Kodi [65800]
Path:                  /Applications/Kodi.app/Contents/MacOS/Kodi
Identifier:            org.xbmc.kodi
Version:               15.0.beta2 (Git-20150608-9b86184)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Kodi [65800]
User ID:               501

Date/Time:             2015-06-08 22:47:00.987 +0200
OS Version:            Mac OS X 10.10.3 (14D136)
Report Version:        11
Anonymous UUID:        A16FB2B6-1EC4-D982-9039-50257548E01F


Time Awake Since Boot: 1300000 seconds

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000000

VM Regions Near 0:
-->
    __TEXT                 0000000100000000-0000000103bf6000 [ 60.0M] r-x/rwx SM=COW  /Applications/Kodi.app/Contents/MacOS/Kodi

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_c.dylib                 0x00007fff8f1f5152 strlen + 18
1   libc++.1.dylib                    0x00007fff8cba94a3 std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::assign(char const*) + 21
2   org.xbmc.kodi                     0x0000000100b717cc CWinSystemOSX::UpdateResolutions() + 252
3   org.xbmc.kodi                     0x0000000100b6f01c DisplayReconfigured(unsigned int, unsigned int, void*) + 428
4   com.apple.CoreGraphics            0x00007fff9180efdb CGSReconfigNotifierCalloutListInvokeAll + 64
5   com.apple.CoreGraphics            0x00007fff91631331 displayConfigFinalizedProc + 249
6   com.apple.CoreGraphics            0x00007fff915a9291 CGSPostLocalNotification + 581
7   com.apple.CoreGraphics            0x00007fff915c7306 (anonymous namespace)::notify_datagram_handler(unsigned int, CGSDatagramType, void*, unsigned long, void*) + 70
8   com.apple.CoreGraphics            0x00007fff915a6d6e CGSDatagramReadStream::dispatch_next_main_queue_datagram() + 280
9   com.apple.CoreGraphics            0x00007fff915a5cb4 CGSDatagramReadStream::dispatch_next_datagram() + 42
10  com.apple.CoreGraphics            0x00007fff915a5c7a CGSDatagramReadStream::dispatch_datagrams() + 50
11  com.apple.CoreGraphics            0x00007fff915e450a ___ZN21CGSDatagramReadStream24dispatch_datagrams_asyncEP16dispatch_queue_sPS__block_invoke + 18
12  libdispatch.dylib                 0x00007fff9728b323 _dispatch_call_block_and_release + 12
13  libdispatch.dylib                 0x00007fff97286c13 _dispatch_client_callout + 8
14  libdispatch.dylib                 0x00007fff97292cbf _dispatch_main_queue_callback_4CF + 861
15  com.apple.CoreFoundation          0x00007fff912663f9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
16  com.apple.CoreFoundation          0x00007fff9122168f __CFRunLoopRun + 2159
17  com.apple.CoreFoundation          0x00007fff91220bd8 CFRunLoopRunSpecific + 296
18  com.apple.HIToolbox               0x00007fff91e4f56f RunCurrentEventLoopInMode + 235
19  com.apple.HIToolbox               0x00007fff91e4f2ea ReceiveNextEventCommon + 431
20  com.apple.HIToolbox               0x00007fff91e4f12b _BlockUntilNextEventMatchingListInModeWithFilter + 71
21  com.apple.AppKit                  0x00007fff94b909bb _DPSNextEvent + 978
22  com.apple.AppKit                  0x00007fff94b8ff68 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 346
23  libSDL-1.2.0.dylib                0x00000001062f4e9a QZ_PumpEvents + 490
24  libSDL-1.2.0.dylib                0x00000001062b284d SDL_PumpEvents + 77
25  libSDL-1.2.0.dylib                0x00000001062b28a1 SDL_PollEvent + 17
26  org.xbmc.kodi                     0x0000000100b5fed3 CWinEventsSDL::MessagePump() + 51
27  org.xbmc.kodi                     0x00000001019238c7 CWinEvents::MessagePump() + 39
28  org.xbmc.kodi                     0x0000000100026fb6 CApplication::FrameMove(bool, bool) + 278
29  org.xbmc.kodi                     0x00000001009b6785 CXBApplicationEx::Run() + 181
30  org.xbmc.kodi                     0x00000001009b6a5d XBMC_Run + 301
31  org.xbmc.kodi                     0x0000000101636430 SDL_main + 224
32  org.xbmc.kodi                     0x0000000101637d3e main + 766
33  org.xbmc.kodi                     0x0000000100008b74 start + 52

For completeness I'm also including my debug log file, but it's rather uneventful - http://pastebin.com/2xMLfWXM

Hope this helps to fix the problem quickly. I'm available for testing if necessary.

cheers,
michalv
args - crap

Testbuild incoming...
Please try this testbuild and report back:

http://mirrors.kodi.tv/test-builds/osx/x...x86_64.dmg

(link might need up to 20 mins from now to be valid).
Hi Memphiz,

Thanks for the quick fix! Can confirm that this solves the issue.

cheers,
michalv
Should be available in nightly tomorrow if all goes well...
Thanks again Memphiz. Confirming that isue is fixed in kodi-20150611-bc4997c-master-x86_64.dmg
thx for the feedback.
i am seeing this again in kodi leia alpha3   can someone check if this problem was reintroduced?

unfortunately the crash only ends up showing the following in the log file

23:05:42.802 T:140735611065216   DEBUG: CWinSystemOSX:Big GrinisplayReconfigured with flags 1
23:05:42.802 T:123145346605056   DEBUG: Thread Timer start, auto delete: false
23:05:42.901 T:140735611065216   DEBUG: CWinSystemOSX:Big GrinisplayReconfigured with flags 544
23:05:42.901 T:140735611065216  NOTICE: Display 0 has name 1104977153
23:05:42.901 T:140735611065216  NOTICE: Found possible resolution for display 0 with 800 x 600 @ 60.000000 Hz
23:05:42.901 T:140735611065216  NOTICE: Found possible resolution for display 0 with 1024 x 768 @ 60.000000 Hz
23:05:42.901 T:140735611065216  NOTICE: Found possible resolution for display 0 with 1280 x 720 @ 60.000000 Hz
23:05:42.901 T:140735611065216  NOTICE: Found possible resolution for display 0 with 1280 x 1024 @ 60.000000 Hz
23:05:42.901 T:140735611065216  NOTICE: Found possible resolution for display 0 with 1440 x 900 @ 60.000000 Hz
23:05:42.901 T:140735611065216  NOTICE: Found possible resolution for display 0 with 1680 x 1050 @ 60.000000 Hz
23:05:42.901 T:140735611065216  NOTICE: Found possible resolution for display 0 with 1920 x 1080 @ 60.000000 Hz
23:05:42.901 T:140735611065216  NOTICE: Previous line repeats 1 times.
23:05:42.901 T:140735611065216   DEBUG: CWinSystemOSX:Big GrinisplayReconfigured with flags 286
23:05:42.902 T:123145346605056   DEBUG: Thread Timer 123145346605056 terminating
23:05:42.902 T:140735611065216  NOTICE: Display 0 has name 1104977153
23:05:42.902 T:140735611065216  NOTICE: Found possible resolution for display 0 with 800 x 600 @ 60.000000 Hz
23:05:42.902 T:140735611065216  NOTICE: Found possible resolution for display 0 with 1024 x 768 @ 60.000000 Hz
23:05:42.902 T:140735611065216  NOTICE: Found possible resolution for display 0 with 1280 x 720 @ 60.000000 Hz
23:05:42.902 T:140735611065216  NOTICE: Found possible resolution for display 0 with 1280 x 1024 @ 60.000000 Hz
23:05:42.902 T:140735611065216  NOTICE: Found possible resolution for display 0 with 1440 x 900 @ 60.000000 Hz
23:05:42.902 T:140735611065216  NOTICE: Found possible resolution for display 0 with 1680 x 1050 @ 60.000000 Hz
23:05:42.902 T:140735611065216  NOTICE: Found possible resolution for display 0 with 1920 x 1080 @ 60.000000 Hz
kataliysts-Mac-mini:Logs kataliyst$
Share the complete Debug log (wiki) and the crash report.
And post the crash report which might be needed aswell.
Please try this test build and report back with new logs in case it still crashes:

http://mirrors.kodi.tv/test-builds/osx/x...x86_64.dmg

(Download link will be valid 30 minutes from now)
I have been having this issue since Kodi 18. Thought it might have been fixed in the last Alpha but isn’t.

Will try the test build tonight.
Installed the test build. Was weird. It changed my resolution to 720P and Kodi wouldn't open at all. Just kept crashing.

HDMI AV Receiver Crash
I need the crash report in addition
Pages: 1 2 3