SFML community forums

Help => Window => Topic started by: Acrobat on January 28, 2013, 09:10:03 am

Title: SFML crash on MacOS 10.6
Post by: Acrobat on January 28, 2013, 09:10:03 am
How to fix this ? On 10.7, 10.8 everything is Ok.
0 libstdc++.6.dylib 0x0000000101aca002 0x101aca000 + 2
1 Module 0x000000010078915f sf::VideoMode::isValid() const + 15
2 Module 0x0000000100789f47 sf::Window::create(sf::VideoMode, std::string const&, unsigned int, sf::ContextSettings const&) + 215
Title: Re: SFML crash on MacOS 10.6
Post by: Hiura on January 28, 2013, 09:25:28 am
How exactly did you compile SFML and which revision are you using ? Also, how did you install / ship SFML with you application ?
Title: Re: SFML crash on MacOS 10.6
Post by: Acrobat on January 28, 2013, 09:29:21 am
sfml complied with garbage collector, target 10.5, static linking, latest sdk 10.8
Title: Re: SFML crash on MacOS 10.6
Post by: Hiura on January 28, 2013, 09:34:31 am
Quote
and which revision are you using
Title: Re: SFML crash on MacOS 10.6
Post by: Acrobat on January 28, 2013, 09:40:03 am
hard to tell, it's old, but there is no changes in video mode implementation for almost a year.
Title: Re: SFML crash on MacOS 10.6
Post by: Acrobat on January 28, 2013, 09:49:07 am
also i ship  libstdc++.6.dylib with application, with fixed loading path
Title: Re: SFML crash on MacOS 10.6
Post by: Hiura on January 28, 2013, 09:53:37 am
First, it's not recommended to use static linking on Unixes (like OS X). There might be something subtle here with the compilation flags too.

Can you gather more information about the crash ? Use a debug version of SFML and print the VM for example.

Finally, get the last sources. Maybe it won't change a thing here but I prefer to be sure that it's not an bug already fixed somehow.

EDIT: Ho, and, BTW, you never told me exactly how you modified SFML to use GC. Maybe the issue lies here.
Title: Re: SFML crash on MacOS 10.6
Post by: Acrobat on January 28, 2013, 10:10:25 am
Maybe i will get a 10.6 mac today, to get more information. We are working with 10.7 and 10.8.
I can use dylibs, but not sure if it will change something, also we use sndfile compiled from sources with flac and ogg manualy. (some strange bug that xcode can't find framework  ???)
I can send you the copy of sfml we are using.
Title: Re: SFML crash on MacOS 10.6
Post by: Hiura on January 28, 2013, 10:27:02 am
Quote
also we use sndfile compiled from sources with flac and ogg manualy.
The sndfile binary provided by SFML is 1.0.24, with ogg / vorbis / flac support, works on 10.5, both 32 & 64 bits.

Quote
some strange bug that xcode can't find framework
You should not build SFML with Xcode. There are too many issues with cmake. Use makefile instead (as stated in the tutorial).

Quote
I can send you the copy of sfml we are using.
The best would be a fork on github.
Title: Re: SFML crash on MacOS 10.6
Post by: Acrobat on January 28, 2013, 10:43:55 am
Quote
also we use sndfile compiled from sources with flac and ogg manualy.
The sndfile binary provided by SFML is 1.0.24, with ogg / vorbis / flac support, works on 10.5, both 32 & 64 bits.
take a look : http://en.sfml-dev.org/forums/index.php?topic=10248.msg70494

Quote
some strange bug that xcode can't find framework

You should not build SFML with Xcode. There are too many issues with cmake. Use makefile instead (as stated in the tutorial).
SFML don't have to be linked with libsndfile
Title: Re: SFML crash on MacOS 10.6
Post by: Hiura on January 28, 2013, 11:28:54 am
SFML is linked against libsndfile : https://github.com/SFML/SFML/blob/master/src/SFML/Audio/CMakeLists.txt#L41-L52

However your project doesn't need to be linked against libsndfile if you're using SFML as dylibs/frameworks. (That's one of the reason why static linking is not recommended.)

Anyway, that's not the current issue. Tell me when you have more data.

Title: Re: SFML crash on MacOS 10.6
Post by: Ceylo on January 28, 2013, 09:29:41 pm
sfml complied with garbage collector, target 10.5, static linking, latest sdk 10.8
Isn't it the important point?
Title: Re: SFML crash on MacOS 10.6
Post by: Hiura on January 28, 2013, 10:49:33 pm
From what I understood of target/sdk it's the correct way of doing it.

I could run on Leopard an application targeting 10.5 with 10.8 SDK, linked against SFML build for 10.5 (both SDK and target) so this configuration should be ok.

But maybe the static linking mess things up ?
Title: Re: SFML crash on MacOS 10.6
Post by: Ceylo on January 28, 2013, 10:57:03 pm
Hmm I'm not that much convinced...

From my understanding, the target OS tells which instructions are allowed in the final binary, like dyld load codes and such. Whereas the SDK controls the compilation step including the
Code: [Select]
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060that is in the OS X implementation of VideoMode. Obviously this section will not be enabled because he's using the 10.8 SDK although it should probably be used here.
Title: Re: SFML crash on MacOS 10.6
Post by: Hiura on January 28, 2013, 11:09:30 pm
You might be right. Here are some interesting facts : https://developer.apple.com/library/mac/#documentation/developertools/conceptual/cross_development/Configuring/configuring.html (but I'm too tired to focus right now :-° )

In any case, the crash occurs on 10.6, so the conditional build settings should not be an issue as both code would work. No ?
Title: Re: SFML crash on MacOS 10.6
Post by: Ceylo on January 28, 2013, 11:11:30 pm
Uh you're right, I don't know why but I thought he was getting a crash on OS X 10.5.
Title: Re: SFML crash on MacOS 10.6
Post by: Acrobat on January 29, 2013, 08:07:36 am
i got the same crash with 10.5  ;D
Title: Re: SFML crash on MacOS 10.6
Post by: Ceylo on January 29, 2013, 10:08:15 am
Do you mean when building against the 10.5 SDK or when trying to run the application on OS X 10.5 ?
Title: Re: SFML crash on MacOS 10.6
Post by: Acrobat on January 29, 2013, 03:26:09 pm
Now i installed 10.5 Mac on VirtualBox and tried to launch my application (after i rebuild it with dylibs and latest sfml). Now my problem is this : http://en.sfml-dev.org/forums/index.php?topic=10445
I think the same problem is here : http://en.sfml-dev.org/forums/index.php?topic=10440.0
Title: Re: SFML crash on MacOS 10.6
Post by: Acrobat on January 29, 2013, 03:33:03 pm
The best would be a fork on github.
https://github.com/MikeAcrobat/SFML
Title: Re: SFML crash on MacOS 10.6
Post by: Hiura on January 29, 2013, 06:37:38 pm
Quote
I think the same problem is here : http://en.sfml-dev.org/forums/index.php?topic=10440.0
No, this one is different.

https://github.com/MikeAcrobat/SFML
Great, I'll have a look.

Quote
after i rebuild it with dylibs and latest sfml
Just to be sure, could you precise with which SDK did you compile it ?
Title: Re: SFML crash on MacOS 10.6
Post by: Acrobat on January 29, 2013, 07:09:53 pm
sdk 10.8, target 10.5
Title: Re: SFML crash on MacOS 10.6
Post by: Acrobat on January 30, 2013, 10:45:45 am
Moving next.
I linked everything with "-weak_library /usr/lib/libSystem.B.dylib", problems with unresolved symbols gone, now other problem (on 10.5 OSX under VM) :
Thread 0 Crashed:
0   ???                                 000000000000000000 0 + 0
1   libsfml-window.dylib                0x000000010169948f sf::priv::VideoModeImpl::getDesktopMode() + 47
2   libsfml-window.dylib                0x0000000101694a1b sf::priv::SFContext::SFContext(sf::priv::SFContext*) + 59
3   libsfml-window.dylib                0x000000010168b6d1 sf::priv::GlContext::globalInit() + 33
4   libsfml-window.dylib                0x000000010168c3a5 sf::GlResource::GlResource() + 37
5   libsfml-window.dylib                0x000000010168e6ff sf::Window::Window() + 15
6   libsfml-graphics.dylib              0x00000001015e545f sf::RenderWindow::RenderWindow() + 15
&#8230;.
 
Title: Re: SFML crash on MacOS 10.6
Post by: Hiura on January 30, 2013, 10:54:19 am
what happen when you compile SFML with 10.5 SDK ?
Title: Re: SFML crash on MacOS 10.6
Post by: Acrobat on January 30, 2013, 10:55:06 am
i don't have it  :o
Title: Re: SFML crash on MacOS 10.6
Post by: Ceylo on January 30, 2013, 11:42:42 am
You can get it from previous Xcode installation packages and put the 10.5 SDK next to the other ones for your current Xcode installation.
Title: Re: SFML crash on MacOS 10.6
Post by: Hiura on January 30, 2013, 11:49:36 am
Note: if you don't want to install both Xcode 3 and Xcode 4, do as follow :

Download xcode_3.2.6_and_ios_sdk_4.3.dmg from connect.apple.com, mount the dmg, go to /Volumes/Xcode and iOS SDK/Packages and run MacOSX10.5.pkg, then move /SDKs to /Developer/SDKs. Next in CMake set CMAKE_OSX_DEPLOYMENT_TARGET to 10.5 and CMAKE_OSX_SYSROOT to /Developer/SDKs/MacOSX10.5.sdk. Now you can rebuild SFML.

EDIT: or, like Ceylo said, you can move the SDK to /Application/Xcode.app/..../SDKs.
Title: Re: SFML crash on MacOS 10.6
Post by: Acrobat on January 30, 2013, 11:50:05 am
Just tested on 10.6.8 , everything is Ok. Think that the problem with 10.5 is that i launched it inside VirtualBox, what do you think ?
Title: Re: SFML crash on MacOS 10.6
Post by: Acrobat on January 30, 2013, 11:52:02 am
I don't think that using old SDK is a solution, there will be many problems with compilation.
Title: Re: SFML crash on MacOS 10.6
Post by: Hiura on January 30, 2013, 11:54:14 am
No, compilation works. I did it myself...

Title: Re: SFML crash on MacOS 10.6
Post by: Ceylo on January 30, 2013, 11:54:49 am
I don't think that using old SDK is a solution, there will be many problems with compilation.
Please trust us :)
Title: Re: SFML crash on MacOS 10.6
Post by: Acrobat on January 30, 2013, 01:19:03 pm
I'm talking about compilation of my project, can i mix SDK's ?
Title: Re: SFML crash on MacOS 10.6
Post by: Ceylo on January 30, 2013, 01:36:57 pm
Why mix SDKs? If you want your application to work on OS X 10.5, you should build your application and each of its dependencies against the 10.5 SDK.
Title: Re: SFML crash on MacOS 10.6
Post by: Acrobat on January 30, 2013, 01:38:40 pm
Why mix SDKs? If you want your application to work on OS X 10.5, you should build your application and each of its dependencies against the 10.5 SDK.
You are wrong
Title: Re: SFML crash on MacOS 10.6
Post by: Ceylo on January 30, 2013, 01:43:19 pm
You are wrong
Why?
Title: Re: SFML crash on MacOS 10.6
Post by: Acrobat on January 30, 2013, 01:47:28 pm
You are wrong
Why?
search for SDK-Based Development
Title: Re: SFML crash on MacOS 10.6
Post by: Hiura on January 30, 2013, 01:53:52 pm
What an... elaborated answer.... seriously !


If you know all that stuff why are you having some issues? Why can't you simply explain us why we are wrong ? I've other things to do than waste my time on such non-constructive discussion..
Title: Re: SFML crash on MacOS 10.6
Post by: Acrobat on January 30, 2013, 02:01:11 pm
I'll try to rebuild sfml with 10.5 sdk
Title: Re: SFML crash on MacOS 10.6
Post by: Acrobat on January 30, 2013, 02:23:49 pm
I tried, but audio module fails to compile  :(
something with typedef-ed void  :-\ in headers