Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: svn: font problem  (Read 6453 times)

0 Members and 1 Guest are viewing this topic.

SvenB

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • http://www.psych.uni-halle.de/sven/
svn: font problem
« 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

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
svn: font problem
« Reply #1 on: October 15, 2008, 02:05:37 pm »
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 ?
Laurent Gomila - SFML developer

SvenB

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • http://www.psych.uni-halle.de/sven/
svn: font problem
« Reply #2 on: October 15, 2008, 02:31:50 pm »
Quote from: "Laurent"
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?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
svn: font problem
« Reply #3 on: October 15, 2008, 02:41:36 pm »
No. Maybe you can try to compile in debug mode and use your debugger.
Laurent Gomila - SFML developer

SvenB

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • http://www.psych.uni-halle.de/sven/
svn: font problem
« Reply #4 on: October 15, 2008, 03:33:37 pm »
Quote from: "Laurent"
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:

Code: [Select]

#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]

SvenB

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • http://www.psych.uni-halle.de/sven/
svn: font problem
« Reply #5 on: October 15, 2008, 03:48:07 pm »
Quote from: "Laurent"
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-

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
svn: font problem
« Reply #6 on: October 15, 2008, 04:52:21 pm »
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) ?
Laurent Gomila - SFML developer

SvenB

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • http://www.psych.uni-halle.de/sven/
svn: font problem
« Reply #7 on: October 15, 2008, 05:40:00 pm »
Quote from: "Laurent"
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-

Wizzard

  • Full Member
  • ***
  • Posts: 213
    • View Profile
svn: font problem
« Reply #8 on: October 15, 2008, 07:24:15 pm »
-snip-

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
svn: font problem
« Reply #9 on: October 15, 2008, 07:24:50 pm »
Hmm, are you sure you compiled in debug ? The call stack should at least start from a SFML function.
Laurent Gomila - SFML developer

SvenB

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • http://www.psych.uni-halle.de/sven/
svn: font problem
« Reply #10 on: October 16, 2008, 12:31:13 pm »
Quote from: "Laurent"
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:
Code: [Select]

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:
Code: [Select]

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

SvenB

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • http://www.psych.uni-halle.de/sven/
svn: font problem
« Reply #11 on: October 16, 2008, 02:06:58 pm »
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-

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
svn: font problem
« Reply #12 on: October 16, 2008, 02:14:10 pm »
Quote
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.
Laurent Gomila - SFML developer

SvenB

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • http://www.psych.uni-halle.de/sven/
svn: font problem
« Reply #13 on: October 16, 2008, 04:03:07 pm »
Quote from: "Laurent"
Quote
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

 

anything