Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault when using imgui example with c backend (default for nimble build) #86

Open
hansfbaier opened this issue Aug 19, 2022 · 3 comments

Comments

@hansfbaier
Copy link

$ ./software 
Traceback (most recent call last)
/devel/HDL/src/kintex-mandelbrot/software/src/software.nim(78) software
/devel/HDL/src/kintex-mandelbrot/software/src/software.nim(38) main
/home/jack/.nimble/pkgs/nimgl-1.3.2/nimgl/imgui/impl_opengl.nim(147) igOpenGL3NewFrame
/home/jack/.nimble/pkgs/nimgl-1.3.2/nimgl/imgui/impl_opengl.nim(139) igOpenGL3CreateDeviceObjects
/home/jack/.nimble/pkgs/nimgl-1.3.2/nimgl/imgui/impl_opengl.nim(66) igOpenGL3CreateFontsTexture
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
[1]    25401 segmentation fault (core dumped)  ./software
  • Please provide the steps to reproduce and if possible a minimal demo of the problem
    *install cimgui from https://github.com/cimgui/cimgui.git to /usr/local/lib

  • What is the expected behaviour?
    application runs successfully

  • Please tell us about your environment

    • Version: [ 0.3.6 ]
    • OS: [ Linux ]
    • Bindings: [ ImGui ]
    • Backend: [ C ]
    • Nim Version: [ 1.6.6 ]
    • Compiler used: [ GCC ]
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, docs.gl, documentation etc)

@xrfez
Copy link

xrfez commented Oct 27, 2022

Source language of ImGui is C++, since Nim is able to compile both to C
and C++ you can select which compile target you wish to use. Note that to use
the C backend you must supply a cimgui <https://github.com/cimgui/cimgui>_
dynamic library file.

Compilation of cimgui

@hansfbaier
Copy link
Author

Yes I did supply the dynamic library.
But I worked around the issue by using nim's c++ backend,
then there is no segfault.
So for me the issue is not urgent, because I have a working solution.

@xrfez
Copy link

xrfez commented Jan 6, 2023

There is a way to static link with the c backend.

nimgl/imgui#9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants