Skip to content
This repository has been archived by the owner on Jan 7, 2023. It is now read-only.

Segmentation fault in test using GLFW #47

Closed
leonsal opened this issue Jun 5, 2019 · 2 comments
Closed

Segmentation fault in test using GLFW #47

leonsal opened this issue Jun 5, 2019 · 2 comments

Comments

@leonsal
Copy link

leonsal commented Jun 5, 2019

I am trying to run tests with fastuidraw using GLFW.
I have based my test runner on this document.
The platform is Linux Mint with gcc 7.4.0, glfw-3.2 and fastuidraw 1.0.
The test seg faults apparently inside PainterSurfaceGL::blit_surface();
Please see the test code here.
Any hints would be appreciated.

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff710fd49 in fastuidraw::gl::PainterSurfaceGL::dimensions (this=0x5555559f87b0) at src/fastuidraw/gl_backend/painter_engine_gl.cpp:358
358 get_implement(fastuidraw::gl::PainterSurfaceGL,
(gdb) backtrace
#0 0x00007ffff710fd49 in fastuidraw::gl::PainterSurfaceGL::dimensions (this=0x5555559f87b0) at src/fastuidraw/gl_backend/painter_engine_gl.cpp:358
#1 0x00007ffff710fbe3 in fastuidraw::gl::PainterSurfaceGL::blit_surface (this=0x5555559f87b0, filter=9728) at src/fastuidraw/gl_backend/painter_engine_gl.cpp:326
#2 0x000055555555a3b7 in Runner::renderLoop (this=0x7fffffffdd50) at /home/leonel/s/fastuidraw_tests/runner.cpp:107
#3 0x000055555555ac3b in main (argc=1, argv=0x7fffffffde78) at /home/leonel/s/fastuidraw_tests/rects.cpp:23

@krogueintel
Copy link
Contributor

Run the application in debug, ie build against the debug libraries of FastUIDraw; from there check the value of both this and m_d; my current suspicion is that the reference counted pointer was not assigned to a object created with FASTUIDRAWnew; in your rects.cpp add an assert() passing the reference_counted_ptr you are using.

@leonsal
Copy link
Author

leonsal commented Jun 5, 2019

You were right. I used naked pointers for mPainterEngine and mSurface instead of reference counted pointers. Is working now. Thanks !

@leonsal leonsal closed this as completed Jun 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants