Reference counting assertion m_p failed
Closed this issue · 13 comments
Hi,
I build fastuidraw in Linux (Manjaro) and all build processes finished successful but when running demos, all of them failed and write below message to terminal output.
inc/fastuidraw/util/reference_counted.hpp:194: Assertion 'm_p' failed
Aborted (core dumped)
Hi,
I have not been able to replicate this issue at all. I have tried on the following platforms:
- Linux Mint 17.somthing
- Linux Mint 18.0
- Ubuntu 16.04
- MS-Windows 10 with Msys2/Mingw64
At this point, I need a stack trace atleast. Right now, my only hunch is that the demos are trying to open a font from a file, and the path it had selected is not correct for Manjaro. However, a number of demos do not try to open a font (for example gradient-test and image-test). Do those two demos also die the same way?
Gradient-test work fine but image-test open black window and doesn't draw anything.
Hi,
At this point, I need the following data:
What is the behavior of each demo on debug, this includes the following:
- if there are any GL error emitted to stderr (debug builds will print to stderr whenever GL emits an error)
- if after a demo runs a file of the from bad_shader.glsl.X or bad_program.glsl.X is made; these files are made whenever the GL driver cannot compile a glsl shader or link a glsl program. Don't forget to delete these files after running each demo
- if a demo crashes (with an assert failure), I need a stack trace
Lastly, I need to know what is the GL hardware and driver used in your device. The requirements for the hardware are stated in the readme.
One more thing: make sure that the demos are using the .so's that they were built with, i.e. use ldd to check. I've had a situation where a user installed FastUIDraw to their system (typically to /usr/local) and a new version of FastUIDraw as not ABI compatible and the demos used the older .so's when run but where compiled with a new version. There is a make uninstall target, but it requires to know the path (by setting INSTALL_LOCATION) to know where to remove the files.
One more thing, the default for image-test is to use a very, very small image. Run image-test as follows to have it draw large (and ugly) programmer art:
./image-test-GL-debug add_image demo_data/images/1024x1024.png
One can also substitute other images as one sees fit.
Also, make sure your system has SDL2_image in such a way that it can read most image formats (usually this means just making sure that libpeg, libpng are installed as well).
Hi,
./image-test-GL-debug add_image demo_data/images/1024x1024.png command wok without error.
For example I run " ./painter-cells-GL-debug" and application crash and it write below strings to terminal.
Running: "./painter-cells-GL-debug
Glyph Geometry Store: auto selected buffer
inc/fastuidraw/util/reference_counted.hpp:194: Assertion 'm_p' failed
Aborted (core dumped)
I can't find bad_shader.glsl.X or bad_program.glsl.X files in directories.
How can i get stacktrace ?
GL Hardware : ATI Radeon 4000
Driver : Mesa , OpenGL 3
One more thing: make sure that the demos are using the .so's that they were built with, i.e. use ldd to check. I've had a situation where a user installed FastUIDraw to their system (typically to /usr/local) and a new version of FastUIDraw as not ABI compatible and the demos used the older .so's when run but where compiled with a new version. There is a make uninstall target, but it requires to know the path (by setting INSTALL_LOCATION) to know where to remove the files.
I'm sure, demos using correct .so libraries.
Also, make sure your system has SDL2_image in such a way that it can read most image formats (usually this means just making sure that libpeg, libpng are installed as well).
SDL is fully installed on my OS.
To get a stack trace, just launch the program from gdb:
gdb ./painter-cells-GL-debug
Before checking out painter-cells, it is prudent try out simpler demos. The demos to try in increasing order of complexity are:
- gradient-test
- image-test
- glyph-test
- painter-test (*)
- painter-cliprect-test
- painter-clippath-test
- painter-path-test
- painter-glyph-test
- painter-cells
One should view the results of 1, 2, 3, 4 as orthogonal (they test different things). The painter-test does not draw anything to the screen, it merely tries to compile the shaders for the fastuidraw painter.
Can you output the output of glxinfo please? ATI Radeon 4000 is quite ancient card (at 9 years old since release). If the GL version is 3.3 it should work, but I have not had the opportunity to use older ATI/AMD GPU's.
I run samples in your order. 1 , 2 work great but when running 3, reference counting assertion occur.
bt.txt
and glxinfo output.
glxInfo.txt
painter-cells
bt2.txt
other examples work fine.
Hi,
The issue is that demos are making a bad guess where fonts are located (or for that matter a good default font). However, each of the demos has an option to specify a font file; those that do font selection from a "font description" also have an option to set the path. The options are as follows:
-
For glyph-test, painter-cells and painter-path-test, the file to use for a font can be set by specifying the command line option "font". For example, running "./glyph-test-GL-debug font /some/path/font.ttf" will use the font in the file /some/path/font.ttf.
-
For painter-glyph-test, you can have it select a font from fonts in a path or you can tell it to load the font to use from a specific file.
- Use the command line option "font_file" to specify and exact file to use for the font, for example "./painter-glyph-test-GL-debug font_file /some/path/font.ttf" will use the font in the file /some/path/font.ttf" will direct it to use the font in the file /some/path/font.ttf.
- If you wish for it to use font-selection, then you need to specify the path where the system fonts are located using the option "font_path"; for example "./painter-glyph-test-GL-debug font_path /some/path/fonts/" will tell it to look for fonts (path-recursively) in the path /some/path/fonts/
As always, use "-help" on any demo to see more details.
I should add error checking for font loading though so that rather than asserting out, the demo would simple not try to draw letters.
I've push a pair of commits that should stop the crashes. The commits to:
- libFastUIDraw.so: in FontFreeType to have code to handle if passed face generator is unable to produce faces
- Error messages in the demos that draw text if they are unable to load fonts.
Thank you for the bug report (though it would have been nicer if the start of the bug was more precise in naming what demos crashed).
Please let me know if these stop your crashes.
Maybe later, I will try to add to the demos to query the system where the fonts are located rather than relying on the values in Ubuntu based distros.
Please let me know if the issue is solved so that the issue can be closed.
By the way, according to the glxInfo.txt, the GPU in use is NOT an AMD Radeon 4000, but your integrated Sandy Bridge GPU.
Please let me know if the issue is solved so that the issue can be closed.
Hi,
I pull latest repository changes and rebuilds library and demos, all errors goes away and all demos works perfect.
Excellent, issue now closed.