FidoProject / Fido

A lightweight C++ machine learning library for embedded electronics and robotics.
http://fidoproject.github.io/
MIT License
439 stars 81 forks source link

Simulator's loading of resources #32

Closed hmwildermuth closed 8 years ago

hmwildermuth commented 8 years ago
==9371== Command: ./tests.o
==9371== 
==9371== Invalid read of size 4
==9371==    at 0x507CBB4: sf::priv::GlxContext::GlxContext(sf::priv::GlxContext*) (in /usr/lib/libsfml-window.so.2.1)
==9371==    by 0x5076B9C: sf::priv::GlContext::globalInit() (in /usr/lib/libsfml-window.so.2.1)
==9371==    by 0x5077482: sf::GlResource::GlResource() (in /usr/lib/libsfml-window.so.2.1)
==9371==    by 0x5079A55: sf::Window::Window() (in /usr/lib/libsfml-window.so.2.1)
==9371==    by 0x4E5C3C5: sf::RenderWindow::RenderWindow() (in /usr/lib/libsfml-graphics.so.2.1)
==9371==    by 0x467A30: Simlink::Simlink() (in /home/travis/build/FidoProject/Fido/tests/tests.o)
==9371==    by 0x45A872: ____C_A_T_C_H____T_E_S_T____8() (in /home/travis/build/FidoProject/Fido/tests/tests.o)
==9371==    by 0x4271CD: Catch::FreeFunctionTestCase::invoke() const (in /home/travis/build/FidoProject/Fido/tests/tests.o)
==9371==    by 0x4132F6: Catch::TestCase::invoke() const (in /home/travis/build/FidoProject/Fido/tests/tests.o)
==9371==    by 0x4261DA: Catch::RunContext::invokeActiveTestCase() (in /home/travis/build/FidoProject/Fido/tests/tests.o)
==9371==    by 0x425E69: Catch::RunContext::runCurrentTest(std::string&, std::string&) (in /home/travis/build/FidoProject/Fido/tests/tests.o)
==9371==    by 0x424810: Catch::RunContext::runTest(Catch::TestCase const&) (in /home/travis/build/FidoProject/Fido/tests/tests.o)
==9371==  Address 0xe0 is not stack'd, malloc'd or (recently) free'd
==9371== 
truell20 commented 8 years ago

@FlyingGraysons This is because I currently load the background and sansation font files using absolute paths. These will only work on my system. The reason it is like that right now is SFML loads files based on current working directory (the directory of the executable) and so the relative path to background.png varies between the running of tests and the running of the library (since their executables are stored in two different dirs).

The problem is documented here: http://en.sfml-dev.org/forums/index.php?topic=7701.0.

hmwildermuth commented 8 years ago

well no matter what the script cd's into the tests/ directory so put the path from there

@truell20

truell20 commented 8 years ago

fixed in f3813aec89b24ab66f770636a6eaa029b7770a83