Bienvenue, Invité. Merci de vous connecter ou de vous inscrire.
Avez-vous perdu votre e-mail d'activation ?

Auteur Sujet: options gcc & runtime error SFML 2.4  (Lu 1788 fois)

0 Membres et 1 Invité sur ce sujet

katian

  • Newbie
  • *
  • Messages: 8
    • Voir le profil
options gcc & runtime error SFML 2.4
« le: Mai 25, 2017, 08:06:49 am »
Salut tous !

je compile un main.cpp avec gcc 6.3.0 options : -std=c++14 -W -pedantic   -g -Wall -Werror -Wextra -flto -fsanitize=undefined -fsanitize=leak -pipe -O0 -DENABLE_DEBUG_MACRO

et simplement avec ce code

sf::Text text;
 
j'obtiens :

/usr/include/SFML/Graphics/VertexArray.hpp:45:25: runtime error: member call on address 0x7ffd4934cf60 which does not point to an object of type 'Drawable'
0x7ffd4934cf60: note: object is of type 'sf::VertexArray'
 00 00 00 00  40 3a 19 f9 79 55 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'sf::VertexArray'
/usr/include/SFML/Graphics/Text.hpp:48:25: runtime error: member call on address 0x7ffd4934ce40 which does not point to an object of type 'Drawable'
0x7ffd4934ce40: note: object is of type 'sf::Text'
 79 55 00 00  f8 39 19 f9 79 55 00 00  20 3a 19 f9 79 55 00 00  00 00 00 00 00 00 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'sf::Text'
 

Est-ce que c'est un bug ?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Messages: 32498
    • Voir le profil
    • SFML's website
    • E-mail
Re: options gcc & runtime error SFML 2.4
« Réponse #1 le: Mai 25, 2017, 09:53:15 am »
Ces deux classes dérivent de sf::Drawable, alors je ne sais pas ce que ces messages signifient. Et toi ?
Laurent Gomila - SFML developer

katian

  • Newbie
  • *
  • Messages: 8
    • Voir le profil
Re: options gcc & runtime error SFML 2.4
« Réponse #2 le: Mai 25, 2017, 04:41:46 pm »
Bonjour Laurent,

complètement d'accord avec toi mais je seche un peu, avec valgrind cela donne :

==32539==
==32539== HEAP SUMMARY:
==32539==     in use at exit: 64 bytes in 4 blocks
==32539==   total heap usage: 16 allocs, 12 frees, 73,100 bytes allocated
==32539==
==32539== 16 bytes in 1 blocks are definitely lost in loss record 1 of 4
==32539==    at 0x4C2DA5F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==32539==    by 0x4C2FDDF: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==32539==    by 0x67A2FD3: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22)
==32539==    by 0x67AC2E2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22)
==32539==    by 0x67AC548: __cxa_demangle (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22)
==32539==    by 0x6AB7E2B: ??? (in /usr/lib/x86_64-linux-gnu/libubsan.so.0.0.0)
==32539==    by 0x6AB6E72: ??? (in /usr/lib/x86_64-linux-gnu/libubsan.so.0.0.0)
==32539==    by 0x6A9E74D: ??? (in /usr/lib/x86_64-linux-gnu/libubsan.so.0.0.0)
==32539==    by 0x6A9EC6B: ??? (in /usr/lib/x86_64-linux-gnu/libubsan.so.0.0.0)
==32539==    by 0x6AA3687: ??? (in /usr/lib/x86_64-linux-gnu/libubsan.so.0.0.0)
==32539==    by 0x6AA3A22: __ubsan_handle_dynamic_type_cache_miss (in /usr/lib/x86_64-linux-gnu/libubsan.so.0.0.0)
==32539==    by 0x129709: sf::VertexArray::~VertexArray() [clone .lto_priv.55] (VertexArray.hpp:45)
==32539==
==32539== 16 bytes in 1 blocks are definitely lost in loss record 2 of 4
==32539==    at 0x4C2DA5F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==32539==    by 0x4C2FDDF: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==32539==    by 0x67A2FD3: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22)
==32539==    by 0x67AC2E2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22)
==32539==    by 0x67AC548: __cxa_demangle (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22)
==32539==    by 0x6AB7E2B: ??? (in /usr/lib/x86_64-linux-gnu/libubsan.so.0.0.0)
==32539==    by 0x6AB6E72: ??? (in /usr/lib/x86_64-linux-gnu/libubsan.so.0.0.0)
==32539==    by 0x6A9E74D: ??? (in /usr/lib/x86_64-linux-gnu/libubsan.so.0.0.0)
==32539==    by 0x6A9F1FA: ??? (in /usr/lib/x86_64-linux-gnu/libubsan.so.0.0.0)
==32539==    by 0x6AA3687: ??? (in /usr/lib/x86_64-linux-gnu/libubsan.so.0.0.0)
==32539==    by 0x6AA3A22: __ubsan_handle_dynamic_type_cache_miss (in /usr/lib/x86_64-linux-gnu/libubsan.so.0.0.0)
==32539==    by 0x129709: sf::VertexArray::~VertexArray() [clone .lto_priv.55] (VertexArray.hpp:45)
==32539==
==32539== 16 bytes in 1 blocks are definitely lost in loss record 3 of 4
==32539==    at 0x4C2DA5F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==32539==    by 0x4C2FDDF: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==32539==    by 0x67A2FD3: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22)
==32539==    by 0x67AC2E2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22)
==32539==    by 0x67AC548: __cxa_demangle (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22)
==32539==    by 0x6AB7E2B: ??? (in /usr/lib/x86_64-linux-gnu/libubsan.so.0.0.0)
==32539==    by 0x6AB6E72: ??? (in /usr/lib/x86_64-linux-gnu/libubsan.so.0.0.0)
==32539==    by 0x6A9E74D: ??? (in /usr/lib/x86_64-linux-gnu/libubsan.so.0.0.0)
==32539==    by 0x6A9EC6B: ??? (in /usr/lib/x86_64-linux-gnu/libubsan.so.0.0.0)
==32539==    by 0x6AA3687: ??? (in /usr/lib/x86_64-linux-gnu/libubsan.so.0.0.0)
==32539==    by 0x6AA3A22: __ubsan_handle_dynamic_type_cache_miss (in /usr/lib/x86_64-linux-gnu/libubsan.so.0.0.0)
==32539==    by 0x123A5E: sf::Text::~Text() [clone .lto_priv.35] (Text.hpp:48)
==32539==
==32539== 16 bytes in 1 blocks are definitely lost in loss record 4 of 4
==32539==    at 0x4C2DA5F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==32539==    by 0x4C2FDDF: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==32539==    by 0x67A2FD3: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22)
==32539==    by 0x67AC2E2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22)
==32539==    by 0x67AC548: __cxa_demangle (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22)
==32539==    by 0x6AB7E2B: ??? (in /usr/lib/x86_64-linux-gnu/libubsan.so.0.0.0)
==32539==    by 0x6AB6E72: ??? (in /usr/lib/x86_64-linux-gnu/libubsan.so.0.0.0)
==32539==    by 0x6A9E74D: ??? (in /usr/lib/x86_64-linux-gnu/libubsan.so.0.0.0)
==32539==    by 0x6A9F1FA: ??? (in /usr/lib/x86_64-linux-gnu/libubsan.so.0.0.0)
==32539==    by 0x6AA3687: ??? (in /usr/lib/x86_64-linux-gnu/libubsan.so.0.0.0)
==32539==    by 0x6AA3A22: __ubsan_handle_dynamic_type_cache_miss (in /usr/lib/x86_64-linux-gnu/libubsan.so.0.0.0)
==32539==    by 0x123A5E: sf::Text::~Text() [clone .lto_priv.35] (Text.hpp:48)
==32539==
==32539== LEAK SUMMARY:
==32539==    definitely lost: 64 bytes in 4 blocks
==32539==    indirectly lost: 0 bytes in 0 blocks
==32539==      possibly lost: 0 bytes in 0 blocks
==32539==    still reachable: 0 bytes in 0 blocks
==32539==         suppressed: 0 bytes in 0 blocks
==32539==
==32539== For counts of detected and suppressed errors, rerun with: -v
==32539== Use --track-origins=yes to see where uninitialised values come from
==32539== ERROR SUMMARY: 17 errors from 8 contexts (suppressed: 0 from 0)
 

peut être que les options sanitize se trompent... :/

 

anything