SFML community forums
Help => Graphics => Topic started by: SvenB on October 15, 2008, 02:01:50 pm
-
Hi,
I switched from sfml 1.3 to the svn-version, now I experience
a fundamental problem with fonts:
the program crashes after font loading with error code
0xC0000005.
I verified this with the sfml tutorial demo graphics-fonts.cpp
Any help is appreciated,
Sven
-
Are you sure you don't mix debug and release buils, or CRT versions ? Are you sure you don't have SFML 1.3 headers or binaries which may conflict ?
-
Are you sure you don't mix debug and release buils, or CRT versions ? Are you sure you don't have SFML 1.3 headers or binaries which may conflict ?
I just deleted all the 1.3 stuff, including the dlls. I updated the
svn-version, recompiled it, used only the latest files
(dlls, headers, *.a). I built the release-version, compiled the
demo-program to release-version (dynamic, not static).
Same error as before.
Any ideas?
-
No. Maybe you can try to compile in debug mode and use your debugger.
-
No. Maybe you can try to compile in debug mode and use your debugger.
Well.... I'm an old C-programmer, my debugger is printf() ;-)
Okay, okay, I built the debug-versions and compiled to debug, the
following very short program:
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow App(sf::VideoMode(800, 600), "SFML Fonts");
sf::Font MyFont;
if (!MyFont.LoadFromFile("c:\\windows\\fonts\\comic.ttf", 50))
return EXIT_FAILURE;
App.Close() ;
return EXIT_SUCCESS;
}
The debugger says:
Debugger name and version: GNU gdb 6.7.50.20071127
Child process PID: 1796
Program received signal SIGSEGV, Segmentation fault.
In wglChoosePixelFormat () (C:\WINDOWS\system32\opengl32.dll)
Is this of any help for you?
-Sven-
[/code]
-
No. Maybe you can try to compile in debug mode and use your debugger.
Hi,
funny additional information:
font-loading crashes for several fonts in several sizes,
except: arial 100 runs okay
-Sven-
-
wglChoosePixelFormat is called at window creation (sf::RenderWindow constructor), it has nothing to do with fonts... really weird.
Can you print the call stack with your debugger (sorry I don't know how to do it with Code::Blocks) ?
-
wglChoosePixelFormat is called at window creation (sf::RenderWindow constructor), it has nothing to do with fonts... really weird.
Can you print the call stack with your debugger (sorry I don't know how to do it with Code::Blocks) ?
Don't know whether this is what you want, the call stack window of
Code::Blocks gives this:
Nr Adress Function File
0 5F14680B wglChosePixelFormat() C:\Windows\system32\opengl32.dll
1 00000000 ??()
-Sven-
-
-snip-
-
Hmm, are you sure you compiled in debug ? The call stack should at least start from a SFML function.
-
Hmm, are you sure you compiled in debug ? The call stack should at least start from a SFML function.
Hi Laurent,
yes, I compiled in debug mode.
Unfortunately, I don't know how to collect the data you need.
As I said, my debugger is printf(). Maybe someone else familiar with
Code::Blocks' debugging system could instruct me, the C::B manual is
of no help.
In debug mode of C::B there is a window called "Call stack". I posted the information yesterday, just the call to wglChoosePixelFormat () (C:\WINDOWS\system32\opengl32.dll)
The "Current stack frame" gives:
Stack level 0, frame at 0x22f4cc:
eip = 0x5f14680b in wglChoosePixelFormat; saved eip 0x0
called by frame at 0x22f4d0
Arglist at 0x22f4c4, args:
Locals at 0x22f4c4, Previous frame's sp is 0x22f4cc
Saved registers:
eip at 0x22f4c8
"Loaded libraries" says:
From To Syms Read Shared Object Library
0x7c911000 0x7c9c5e84 Yes C:\WINDOWS\system32\ntdll.dll
0x7c801000 0x7c907c80 Yes C:\WINDOWS\system32\kernel32.dll
0x77be1000 0x77c37d74 Yes C:\WINDOWS\system32\msvcrt.dll
0x674c1000 0x676835c4 Yes C:\WINDOWS\system32\sfml-graphics-d.dll
0x67981000 0x679dd784 Yes C:\WINDOWS\system32\sfml-system-d.dll
0x6af41000 0x6af9c72c Yes C:\WINDOWS\system32\sfml-window-d.dll
0x77ef1000 0x77f38880 Yes C:\WINDOWS\system32\gdi32.dll
0x7e361000 0x7e3f0de4 Yes C:\WINDOWS\system32\user32.dll
0x5f0d1000 0x5f19bed4 Yes C:\WINDOWS\system32\opengl32.dll
0x77da1000 0x77e49aec Yes C:\WINDOWS\system32\advapi32.dll
0x77e51000 0x77ee1494 Yes C:\WINDOWS\system32\rpcrt4.dll
0x77fc1000 0x77fd0884 Yes C:\WINDOWS\system32\secur32.dll
0x68fc1000 0x68fdf918 Yes C:\WINDOWS\system32\glu32.dll
0x736d1000 0x7371a0cc Yes C:\WINDOWS\system32\ddraw.dll
0x73b31000 0x73b350c4 Yes C:\WINDOWS\system32\dciman32.dll
0x76af1000 0x76b1d8b4 Yes C:\WINDOWS\system32\winmm.dll
0x76331000 0x7634cc6c Yes C:\WINDOWS\system32\imm32.dll
0x72211000 0x7223a75a Yes C:\WINDOWS\system32\dinput.dll
0x68d91000 0x68d98128 Yes C:\WINDOWS\system32\hid.dll
0x778f1000 0x779e35a8 Yes C:\WINDOWS\system32\setupapi.dll
0x76bf1000 0x76c1d4c8 Yes C:\WINDOWS\system32\wintrust.dll
0x77a51000 0x77ae5fa0 Yes C:\WINDOWS\system32\crypt32.dll
0x77af1000 0x77b0125c Yes C:\WINDOWS\system32\msasn1.dll
0x76c51000 0x76c77054 Yes C:\WINDOWS\system32\imagehlp.dll
0x746a1000 0x746ebc4c Yes C:\WINDOWS\system32\msctf.dll
0x10001000 0x10028b74 Yes C:\Programme\ScanSoft\OmniPageSE2.0\OpHookSE2.dll
0x774b1000 0x775ec0d4 Yes C:\WINDOWS\system32\ole32.dll
0x770f1000 0x7717a414 Yes C:\WINDOWS\system32\oleaut32.dll
0x77bd1000 0x77bd7300 Yes C:\WINDOWS\system32\version.dll
0x75251000 0x7527dba0 Yes C:\WINDOWS\system32\msctfime.ime
From loaded libraries you can see the debug-dlls were used.
Any hints?
Yours - Sven
-
some more information:
I copied the crashing program to a new computer,
no Code::Blocks there, no sfml there (except the
dlls). It runs okay, but crashes at closing the window
with a message box saying that some instruction at 0x00000000
wants to read memory at 0x00000000 (or similar, the
message box is in german).
Now I have no idea what went wrong on the original computer
due to the transition from sfml-1.3 to the svn-version.
I deleted the whole 1.3 stuff (all directories). I deleted the
1.3 dlls (audio, graphics, network, window, system),
I deleted the 1.3 extlibs (libsndfile-1, openal32), I pointed
compiler and linker to the 1.4 headers and librariers.
Something forgotten?
And: the crash at program end on the new pc is bad, too.
-Sven-
-
And: the crash at program end on the new pc is bad, too.
This is a known bug (related to the destruction of the default font), which only happens with dynamic SFML libraries.
Regarding the other crash, I still have no idea. But as soon as I have some free time I'll check the graphics contexts stuff, as it seems there are a lot of new issues related to this part of the code.
-
And: the crash at program end on the new pc is bad, too.
This is a known bug (related to the destruction of the default font), which only happens with dynamic SFML libraries.
Regarding the other crash, I still have no idea. But as soon as I have some free time I'll check the graphics contexts stuff, as it seems there are a lot of new issues related to this part of the code.
Okay, thanks for your patience. Meanwhile I go back to 1.3.
Yours - Sven