[Bf-cycles] Seg fault on windows only in goxel integration

Guillaume Chereau guillaume at noctua-software.com
Sun Apr 22 08:47:13 CEST 2018


Hello all,

I integrated cycles to goxel voxel editor, and it seems to work fine on
both linux and osx.

Today I tried to compile on windows (with msys).  After some minor
changes I could get a build, but I get a segmentation fault at runtime.

I suspect a thread synchronization bug, since I am not sure at all what
is the proper way to lock the mutex to avoid bugs.

Is there some doc to explain the internal of cycles and the roles of
each mutex?

In my implementation I do the following in my rendering loop.

    - If the scene has changed or if its the first time.
        - Delete the session if there is one.
        - Create a new session and start it.
        - Wait for session->ready_to_reset().
        - Lock session->scene->mutex and create the scene, then unlock.
        - call session->reset
    - Acquire the session display_mutex.
    - Check for session->display->draw_ready().
    - Copy the session display rgba_byte buffer into my own rendering
      buffer.

The full code is on github:
    https://github.com/guillaumechereau/goxel/blob/master/src/cycles.cpp

The seg fault I get is from camera.cpp, in the camera constructor when I
create the scene:
    motion.pre = transform_identity()

The fact that this only happens when I do a release build on windows
(not my primary working env), is making this quite hard to debug!  In
last resort I turn to the cycles community hopping that someone can
give me some hints on how to fix this.

Best regards,
Guillaume


More information about the Bf-cycles mailing list