# SDL\_SetVideoMode mac crash

**URL:** <https://discourse.libsdl.org/t/sdl-setvideomode-mac-crash/17964>\
**Category:** SDL Development\
**Created:** [February 13, 2011, 10:38pm UTC](https://discourse.libsdl.org/t/sdl-setvideomode-mac-crash/17964 "2011-02-13T22:38:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ulrich\_von\_Zadow](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/u/aca169/32.png) [@Ulrich\_von\_Zadow](https://discourse.libsdl.org/u/Ulrich_von_Zadow)\
**Post date:** [February 13, 2011, 10:38pm UTC](https://discourse.libsdl.org/t/sdl-setvideomode-mac-crash/17964/1 "2011-02-13T22:38:06Z")

</div>

Hi,

we have an SDL-based framework here ([www.libavg.de](http://www.libavg.de)) that crashes in SDL\_SetVideoMode on a Mac with Snow Leopard:

2011-02-13 23:13:21.983 Python[85985:d07] \*\*\* Assertion failure in -[NSView initWithFrame:], /SourceCache/AppKit/AppKit-1038.35/AppKit.subproj/NSView.m:1289

This only happens when trying to open a fullscreen window. The error is hard to debug: It appears and disappears depending on completely unrelated code changes, including debug output. The bug only happens on macs. Everything is ok on windows and Linux, and under Linux the framework is Valgrind-clean.

How do I go about debugging this? We have a custom SDLMain.m - could that have something to do with it?

Thanks for any help,

Uli–  
Any technology distinguishable from magic is insufficiently advanced.

Ulrich von Zadow | +49-172-7872715  
Jabber: @Ulrich_von_Zadow  
Skype: uzadow

---

<div class="post-metadata">

**Author:** ![slouken](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/s/ec9cab/32.png) [@slouken](https://discourse.libsdl.org/u/slouken)\
**Post date:** [February 14, 2011, 12:11am UTC](https://discourse.libsdl.org/t/sdl-setvideomode-mac-crash/17964/2 "2011-02-14T00:11:22Z")

</div>

There’s been a lot of work recently with SDL 1.3 fullscreen modes on Mac OS  
X. You might try the latest snapshot and see if that works better for you:  
[http://www.libsdl.org/tmp/SDL-1.3.zip](http://www.libsdl.org/tmp/SDL-1.3.zip)

See ya!On Sun, Feb 13, 2011 at 2:38 PM, Ulrich von Zadow wrote:

> Hi,
> 
> we have an SDL-based framework here ([www.libavg.de](http://www.libavg.de)) that crashes in  
> SDL\_SetVideoMode on a Mac with Snow Leopard:
> 
> 2011-02-13 23:13:21.983 Python[85985:d07] \*\*\* Assertion failure in -[NSView  
> initWithFrame:],  
> /SourceCache/AppKit/AppKit-1038.35/AppKit.subproj/NSView.m:1289
> 
> This only happens when trying to open a fullscreen window. The error is  
> hard to debug: It appears and disappears depending on completely unrelated  
> code changes, including debug output. The bug only happens on macs.  
> Everything is ok on windows and Linux, and under Linux the framework is  
> Valgrind-clean.
> 
> How do I go about debugging this? We have a custom SDLMain.m - could that  
> have something to do with it?
> 
> Thanks for any help,
> 
> Uli
> 
> –  
> Any technology distinguishable from magic is insufficiently advanced.
> 
> Ulrich von Zadow | +49-172-7872715  
> Jabber: coder at [c-base.org](http://c-base.org)  
> Skype: uzadow
> 
> * * *
> 
> SDL mailing list  
> SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

–  
-Sam Lantinga, Founder and CEO, Galaxy Gameworks

---

<div class="post-metadata">

**Author:** ![john\_skaller](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/j/58956e/32.png) [@john\_skaller](https://discourse.libsdl.org/u/john_skaller)\
**Post date:** [February 14, 2011, 12:33am UTC](https://discourse.libsdl.org/t/sdl-setvideomode-mac-crash/17964/3 "2011-02-14T00:33:49Z")

</div>

> There’s been a lot of work recently with SDL 1.3 fullscreen modes on Mac OS X. You might try the latest snapshot and see if that works better for you:  
> [http://www.libsdl.org/tmp/SDL-1.3.zip](http://www.libsdl.org/tmp/SDL-1.3.zip)

Actually since SDL-1.3 is being rapidly debugged and upgraded Mercurial source is probably  
better. IMHO of course. Easier to upgrade and integrate any tweaks.On 14/02/2011, at 11:11 AM, Sam Lantinga wrote:

–  
john skaller  
@john_skaller

---

<div class="post-metadata">

**Author:** ![Ulrich\_von\_Zadow](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/u/aca169/32.png) [@Ulrich\_von\_Zadow](https://discourse.libsdl.org/u/Ulrich_von_Zadow)\
**Post date:** [February 14, 2011, 8:15am UTC](https://discourse.libsdl.org/t/sdl-setvideomode-mac-crash/17964/4 "2011-02-14T08:15:04Z")

</div>

Sorry, my mistake for not mentioning it. We’re still using SDL 1.2.14, since we need something stable. (It’s great there’s stuff happening in SDL-land, though :-)).

So, the question remains: Is there a way to debug this? The crashes are hard to pin to single changes in the code or updates in libSDL, since they come and go.

What needs to be in a custom SDLMain.m? This is a package for python, so we don’t have a main(). Our current SDLMain.m is here:

[https://www.libavg.de/websvn/filedetails.php?repname=libavg&path=%2Ftrunk%2Flibavg%2Fsrc%2Fplayer%2FSDLMain.m](https://www.libavg.de/websvn/filedetails.php?repname=libavg&path=%2Ftrunk%2Flibavg%2Fsrc%2Fplayer%2FSDLMain.m)

Thanks,

UliOn Feb 14, 2011, at 1:11 AM, Sam Lantinga wrote:

> There’s been a lot of work recently with SDL 1.3 fullscreen modes on Mac OS X. You might try the latest snapshot and see if that works better for you:  
> [http://www.libsdl.org/tmp/SDL-1.3.zip](http://www.libsdl.org/tmp/SDL-1.3.zip)
> 
> See ya!
> 
> On Sun, Feb 13, 2011 at 2:38 PM, Ulrich von Zadow \<@Ulrich\_von\_Zadow\> wrote:  
> Hi,
> 
> we have an SDL-based framework here ([www.libavg.de](http://www.libavg.de)) that crashes in SDL\_SetVideoMode on a Mac with Snow Leopard:
> 
> 2011-02-13 23:13:21.983 Python[85985:d07] \*\*\* Assertion failure in -[NSView initWithFrame:], /SourceCache/AppKit/AppKit-1038.35/AppKit.subproj/NSView.m:1289
> 
> This only happens when trying to open a fullscreen window. The error is hard to debug: It appears and disappears depending on completely unrelated code changes, including debug output. The bug only happens on macs. Everything is ok on windows and Linux, and under Linux the framework is Valgrind-clean.
> 
> How do I go about debugging this? We have a custom SDLMain.m - could that have something to do with it?
> 
> Thanks for any help,
> 
> Uli
> 
> –  
> Any technology distinguishable from magic is insufficiently advanced.
> 
> Ulrich von Zadow | +49-172-7872715  
> Jabber: @Ulrich_von_Zadow  
> Skype: uzadow
> 
> * * *
> 
> SDL mailing list  
> SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)
> 
> –  
> -Sam Lantinga, Founder and CEO, Galaxy Gameworks
> 
> * * *
> 
> SDL mailing list  
> SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

–  
Any technology distinguishable from magic is insufficiently advanced.

Ulrich von Zadow | +49-172-7872715  
Jabber: @Ulrich_von_Zadow  
Skype: uzadow
