[SOLVED] Error making debug build (master) / debug build crashing at startup


it is not possible to build a debug build of master branch using

make debug NPROCS=16

on up-to-date manjaro linux (release builds just fine). Compile output with error message:

[ 99%] Built target bf_blenkernel 
In file included from /usr/include/c++/12.2.1/cassert:44, 
                from /home/mick/blender-git/blender/intern/cycles/device/../util/debug.h:7, 
                from /home/mick/blender-git/blender/intern/cycles/device/../device/queue.h:9, 
                from /home/mick/blender-git/blender/intern/cycles/device/device.cpp:10: 
/home/mick/blender-git/blender/intern/cycles/device/device.cpp: In member function ‘virtual ccl::GPUDevice::Mem* ccl::GPUDevice::generic_alloc(ccl::device_memory&, size_t)’: 
/home/mick/blender-git/blender/intern/cycles/device/device.cpp:651:37: error: cannot bind non-const lvalue reference of type ‘void*&’ to an rvalue of type ‘void*’ 
 651 |       assert(transform_host_pointer(&device_pointer, shared_pointer)); 
     |                                     ^~~~~~~~~~~~~~~ 
In file included from /home/mick/blender-git/blender/intern/cycles/device/device.cpp:9: 
/home/mick/blender-git/blender/intern/cycles/device/../device/device.h:394:46: note:   initializing argument 1 of ‘virtual bool ccl::GPUDevice::transform_host_pointer(void*&, void*&)’ 
 394 |   virtual bool transform_host_pointer(void *&device_pointer, void *&shared_pointer) = 0; 
     |                                       ~~~~~~~^~~~~~~~~~~~~~ 
make[3]: *** [intern/cycles/device/CMakeFiles/cycles_device.dir/build.make:76: intern/cycles/device/CMakeFiles/cycles_device.dir/device.cpp.o] Error 1 
make[3]: *** Waiting for unfinished jobs.... 
make[2]: *** [CMakeFiles/Makefile2:3589: intern/cycles/device/CMakeFiles/cycles_device.dir/all] Error 2 
make[1]: *** [Makefile:166: all] Error 2 
make: *** [GNUmakefile:364: all] Error 2

Please help.

This should now be fixed as a few hours ago.

Thanks, it builds now, but it crashes on startup without backtrace (release build runs fine). I made a clean build and tried --factory-startup to no avail.

Blender successfully built, run from: /home/mick/blender-git/build_linux_debug/bin/blender 

Writing: blender.crash.txt 
Segmentation fault (core dumped) 

cat blender.crash.txt 

# backtrace 

# Python backtrace

you’d have to make install at least once so “things” get copied to your bin folder.

You mean running make install from /home/mick/blender-git/build_linux_debug/ ?
I did that but I get the same output as before, segfault with empty backtrace.

sorry, it looked like you were running make from the build folder, make from the source folder will do this for you. Loading up blender in gdb and see where it’s crashing is likely your best bet at this point

1 Like

Okay, this was gdb output:

Thread 1 "blender" received signal SIGSEGV, Segmentation fault. 
0x00000000035dcbe2 in __gnu_cxx::__normal_iterator<GHOST_TimerTask* const*, std::vector<GHOST_TimerTask*, std::allocator<GHOST_TimerTask*> > >::__normal_iterator (this=0x7fffffffd2d0, __i=<error reading variable: Cannot access memory at
address 0x7>) at /usr/include/c++/12.2.1/bits/stl_iterator.h:1073 
1073          : _M_current(__i) { }

Updated the source, rebuilt and it runs - seems like ca183993a5d50bceb43e1a91b6aeb929d1311e2b Fix freeing uninitialized pointer in GHOST/Wayland + X11 fallback has solved the issue. Thank you!