Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Radegast

#1
Help requests / Re: Android crash on setFont()
11 February 2016, 19:22:18
Yeah, I was using both TGUI and SFML from git.

Great job, thanks for figuring that out!
#2
Help requests / Re: Android crash on setFont()
08 February 2016, 11:28:40
Quote from: texus on 06 February 2016, 21:06:24
Does the following work?
Code (cpp) Select
auto font2 = std::make_shared<sf::Font>(font);

Oh yea and if I replace the gui.setFont(font) line with this there is no crash.
#3
Help requests / Re: Android crash on setFont()
08 February 2016, 11:25:21
Never mind that. It actually crashes BOTH in loadFromFile() and setFont(). I created a bug report at SFML bug tracker and it turns out loadFromFile() crashed because I provided a wrong path to the font file (assets folder is the top directory on Android by default).  After correcting that I was able to use sf::Text without an issue. However, when I switched back to TGUI, it crashed again and this time I am 100% it is in setFont() - use the minimal example above with if(!font.loadFromFile("sansation.ttf")). The backtrace is different this time:

Quote
:     #00 pc 000318d6  /data/app/xyz.simek.theycome-1/lib/arm/libsfml-graphics.so (FT_Stroker_Done+9)
:     #01 pc 0001590d  /data/app/xyz.simek.theycome-1/lib/arm/libsfml-graphics.so (sf::Font::cleanup()+72)
:     #02 pc 00015931  /data/app/xyz.simek.theycome-1/lib/arm/libsfml-graphics.so (sf::Font::~Font()+4)
:     #03 pc 0006422b  /data/app/xyz.simek.theycome-1/lib/arm/libc++_shared.so (std::__1::__shared_weak_count::__release_shared()+46)
:     #04 pc 0005dd1d  /data/app/xyz.simek.theycome-1/lib/arm/libtgui.so (tgui::Widget::setFont(tgui::Font const&)+36)
:     #05 pc 000423df  /data/app/xyz.simek.theycome-1/lib/arm/libtgui.so (tgui::Container::setFont(tgui::Font const&)+6)
:     #06 pc 000067cf  /data/app/xyz.simek.theycome-1/lib/arm/libsfml-example.so (main+322)
:     #07 pc 00006903  /data/app/xyz.simek.theycome-1/lib/arm/libsfml-example.so (sf::priv::main(sf::priv::ActivityStates*)+70)
:     #08 pc 00007e6f  /data/app/xyz.simek.theycome-1/lib/arm/libsfml-system.so
:     #09 pc 0003e7f7  /system/lib/libc.so (__pthread_start(void*)+30)
:     #10 pc 00018d9d  /system/lib/libc.so (__start_thread+6)

#4
Help requests / Re: Android crash on setFont()
06 February 2016, 22:31:41
You are right the crash was earlier than setFont(), it's in font.loadFromFile(), so it is not TGUI fault after all. Just for reference this is all I had:

Code (cpp) Select
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
#include <SFML/Network.hpp>
#include <TGUI/TGUI.hpp>

int main()
{
    sf::RenderWindow window{{800, 600}, "Window"};
    tgui::Gui gui{window}; // Create the gui and attach it to the window
   
    sf::Font font;

    if(!font.loadFromFile("assets/sansation.ttf"))
    {
        std::cerr << "Could not load font" << std::endl;
        return 1;
    }

    gui.setFont(font);

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();

            gui.handleEvent(event); // Pass the event to the widgets
        }

        window.clear();
        gui.draw(); // Draw all widgets
        window.display();
    }
}

#5
Help requests / Re: Android crash on setFont()
06 February 2016, 21:12:18
If you mean like this:

Code (cpp) Select
    auto font2 = std::make_shared<sf::Font>(font);
    gui.setFont(font2);


Then it crashes as well:

Quote02-06 21:09:13.381    66    66 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
02-06 21:09:13.381    66    66 F DEBUG   : Build fingerprint: 'generic/sdk_phone_armv7/generic:6.0/MRA44C/2166767:eng/test-keys'
02-06 21:09:13.382    66    66 F DEBUG   : Revision: '0'
02-06 21:09:13.382    66    66 F DEBUG   : ABI: 'arm'
02-06 21:09:13.383    66    66 F DEBUG   : pid: 1326, tid: 1340, name: .simek.theycome  >>> xyz.simek.theycome <<<
02-06 21:09:13.383    66    66 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
02-06 21:09:13.881    66    66 F DEBUG   :     r0 00000000  r1 00000000  r2 00000000  r3 00000000
02-06 21:09:13.882    66    66 F DEBUG   :     r4 a4c3f578  r5 00000000  r6 a4c3f888  r7 ae91d740
02-06 21:09:13.882    66    66 F DEBUG   :     r8 a5442de4  r9 a4c3f570  sl a4c3f888  fp ad097de4
02-06 21:09:13.883    66    66 F DEBUG   :     ip ad111ff0  sp a4c3f4e8  lr ad10e721  pc ac768d8c  cpsr 60000030
02-06 21:09:13.960    66    66 F DEBUG   :
02-06 21:09:13.960    66    66 F DEBUG   : backtrace:
02-06 21:09:13.961    66    66 F DEBUG   :     #00 pc 00008d8c  /system/lib/libandroid.so (AAsset_seek+1)
02-06 21:09:13.961    66    66 F DEBUG   :     #01 pc 0000871d  /data/app/xyz.simek.theycome-2/lib/arm/libsfml-system.so (sf::priv::ResourceStream::seek(long long)+8)
02-06 21:09:13.962    66    66 F DEBUG   :     #02 pc 00015d63  /data/app/xyz.simek.theycome-2/lib/arm/libsfml-graphics.so (sf::Font::loadFromStream(sf::InputStream&)+62)
02-06 21:09:13.962    66    66 F DEBUG   :     #03 pc 000065e3  /data/app/xyz.simek.theycome-2/lib/arm/libsfml-example.so (main+186)
02-06 21:09:13.963    66    66 F DEBUG   :     #04 pc 0000680b  /data/app/xyz.simek.theycome-2/lib/arm/libsfml-example.so (sf::priv::main(sf::priv::ActivityStates*)+70)
02-06 21:09:13.963    66    66 F DEBUG   :     #05 pc 00007e6f  /data/app/xyz.simek.theycome-2/lib/arm/libsfml-system.so
02-06 21:09:13.964    66    66 F DEBUG   :     #06 pc 0003e7f7  /system/lib/libc.so (__pthread_start(void*)+30)
02-06 21:09:13.964    66    66 F DEBUG   :     #07 pc 00018d9d  /system/lib/libc.so (__start_thread+6)
#6
Help requests / Android crash on setFont()
06 February 2016, 20:58:15
I think I found a bug with TGUI on Android. Let's use the minimal example from the documentation and just add this:

Code (cpp) Select
    sf::Font font;

    if(!font.loadFromFile("assets/sansation.ttf"))
    {
        std::cerr << "Could not load font" << std::endl;
        return 1;
    }

    gui.setFont(font);


It works fine on OS X, but on Android it will crash with this log: https://pastebin.com/WBe1BGnT

If you don't use custom font then it works without any issues.