Minimal Cycles standalone application crashes in process initialization #51915

Closed
opened 2017-06-27 21:37:48 +02:00 by Gareth Morgan · 5 comments

System Information
Ubunty 14.04, with GPU, CUDA, and MULTI disabled

Blender Version
Broken: Cycles standalone 5d0d9687ace6b07f42a153db1294669b46fedd15
Worked: (optional)

Short description of error
The very minimal version of cycles_standalone.cpp (attached), that does nothing except create a context, will result in a crash on application start (note the application also has device enumeration code , to avoid a link error, but that code is never executed).

The result, weirdly is a crash in the process initialization function (as in, it never gets to the compiled application code at all, never reaches the start of the main function, and never creates the context object). Looks to be crashing creating a boost condition_variable object.

This is at 5d0d9687ace6b07f42a153db1294669b46fedd15 on Ubunty 14.04, with GPU, CUDA, and MULTI disabled. The full app still works fine (you can replace \src\app\cycles_standalone.cpp with the attached to repro the crash).

Exact steps for others to reproduce the error
Replace \src\app\cycles_standalone.cpp with minimal version pasted below
Compile using cmake+make in the usual manner
Run bin/cycles
See the resulting crash

Program received signal SIGABRT, Aborted.
0x00007ffff6417c37 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56      ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
- 0  0x00007ffff6417c37 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
- 1  0x00007ffff641b028 in __GI_abort () at abort.c:89
#2  0x00007ffff6410bf6 in __assert_fail_base (fmt=0x7ffff65613b8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x326a290 "!ret", file=file@entry=0x326a1d0 "/usr/include/boost/thr
ead/pthread/condition_variable_fwd.hpp", line=line@entry=81, function=function@entry=0x326a800 <boost::condition_variable::~condition_variable()::__PRETTY_FUNCTION__> "boost::condition_variable::~conditi
on_variable()") at assert.c:92
#3  0x00007ffff6410ca2 in __GI___assert_fail (assertion=0x326a290 "!ret", file=0x326a1d0 "/usr/include/boost/thread/pthread/condition_variable_fwd.hpp", line=81, function=0x326a800 <boost::condition_vari
able::~condition_variable()::__PRETTY_FUNCTION__> "boost::condition_variable::~condition_variable()") at assert.c:101
#4  0x0000000003181eb0 in boost::condition_variable::~condition_variable (this=0x37faee0 <ccl::TaskScheduler::queue_cond>, __in_chrg=<optimized out>) at /usr/include/boost/thread/pthread/condition_variab
le_fwd.hpp:81
- 5  0x00007ffff641d1a9 in __run_exit_handlers (status=0, listp=0x7ffff679f6c8 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true) at exit.c:82
- 6  0x00007ffff641d1f5 in __GI_exit (status=<optimized out>) at exit.c:104
#7  0x00007ffff6402f4c in __libc_start_main (main=0x56c148 <main(int, char const**)>, argc=1, argv=0x7fffffffdf48, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffff
fffdf38) at libc-start.c:321
#8  0x000000000056ba7c in _start ()
#include <stdio.h>

- include "render/buffers.h"
- include "render/camera.h"
- include "device/device.h"
- include "render/scene.h"
- include "render/session.h"
- include "render/integrator.h"

- include "util/util_args.h"
- include "util/util_foreach.h"
- include "util/util_function.h"
- include "util/util_logging.h"
- include "util/util_path.h"
- include "util/util_progress.h"
- include "util/util_string.h"
- include "util/util_time.h"
- include "util/util_transform.h"
- include "util/util_version.h"

CCL_NAMESPACE_BEGIN

struct Options {
	Session *session;

	SessionParams session_params;

} options;


static void session_print_status()
{

}


static void session_init()
{

	options.session = new Session(options.session_params);
	*options.session->progress.set_update_callback(function_bind(&session_print_status));*options.session->progress.set_status("foo","bar");

}

static void get_devices()
{

	/* device names */
	string device_names = "";
	string devicename = "CPU";
	bool list = false;

	vector<DeviceType>& types = Device::available_types();

	/* TODO(sergey): Here's a feedback loop happens: on the one hand we want
	 * the device list to be printed in help message, on the other hand logging
	 * is not initialized yet so we wouldn't have debug log happening in the
	 * device initialization.
	 */
	foreach(DeviceType type, types) {
		if(device_names != "")
			device_names += ", ";

		device_names += Device::string_from_type(type);
	}

	

	/* find matching device */
	DeviceType device_type = Device::type_from_string(devicename.c_str());
	vector<DeviceInfo>& devices = Device::available_devices();
	DeviceInfo device_info;
	bool device_available = false;

	foreach(DeviceInfo& device, devices) {
		if(device_type == device.type) {
			options.session_params.device = device;
			device_available = true;
			break;
		}
	}

}

CCL_NAMESPACE_END

using namespace ccl;

int main(int argc, const char **argv)
{
	session_init();

	return 0;
}

**System Information** Ubunty 14.04, with GPU, CUDA, and MULTI disabled **Blender Version** Broken: Cycles standalone 5d0d9687ace6b07f42a153db1294669b46fedd15 Worked: (optional) **Short description of error** The very minimal version of cycles_standalone.cpp (attached), that does nothing except create a context, will result in a crash on application start (note the application also has device enumeration code , to avoid a link error, but that code is never executed). The result, weirdly is a crash in the process initialization function (as in, it never gets to the compiled application code at all, never reaches the start of the main function, and never creates the context object). Looks to be crashing creating a boost condition_variable object. This is at 5d0d9687ace6b07f42a153db1294669b46fedd15 on Ubunty 14.04, with GPU, CUDA, and MULTI disabled. The full app still works fine (you can replace \src\app\cycles_standalone.cpp with the attached to repro the crash). **Exact steps for others to reproduce the error** Replace \src\app\cycles_standalone.cpp with minimal version pasted below Compile using cmake+make in the usual manner Run bin/cycles See the resulting crash ``` Program received signal SIGABRT, Aborted. 0x00007ffff6417c37 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory. (gdb) bt - 0 0x00007ffff6417c37 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 - 1 0x00007ffff641b028 in __GI_abort () at abort.c:89 #2 0x00007ffff6410bf6 in __assert_fail_base (fmt=0x7ffff65613b8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x326a290 "!ret", file=file@entry=0x326a1d0 "/usr/include/boost/thr ead/pthread/condition_variable_fwd.hpp", line=line@entry=81, function=function@entry=0x326a800 <boost::condition_variable::~condition_variable()::__PRETTY_FUNCTION__> "boost::condition_variable::~conditi on_variable()") at assert.c:92 #3 0x00007ffff6410ca2 in __GI___assert_fail (assertion=0x326a290 "!ret", file=0x326a1d0 "/usr/include/boost/thread/pthread/condition_variable_fwd.hpp", line=81, function=0x326a800 <boost::condition_vari able::~condition_variable()::__PRETTY_FUNCTION__> "boost::condition_variable::~condition_variable()") at assert.c:101 #4 0x0000000003181eb0 in boost::condition_variable::~condition_variable (this=0x37faee0 <ccl::TaskScheduler::queue_cond>, __in_chrg=<optimized out>) at /usr/include/boost/thread/pthread/condition_variab le_fwd.hpp:81 - 5 0x00007ffff641d1a9 in __run_exit_handlers (status=0, listp=0x7ffff679f6c8 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true) at exit.c:82 - 6 0x00007ffff641d1f5 in __GI_exit (status=<optimized out>) at exit.c:104 #7 0x00007ffff6402f4c in __libc_start_main (main=0x56c148 <main(int, char const**)>, argc=1, argv=0x7fffffffdf48, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffff fffdf38) at libc-start.c:321 #8 0x000000000056ba7c in _start () ``` ``` #include <stdio.h> - include "render/buffers.h" - include "render/camera.h" - include "device/device.h" - include "render/scene.h" - include "render/session.h" - include "render/integrator.h" - include "util/util_args.h" - include "util/util_foreach.h" - include "util/util_function.h" - include "util/util_logging.h" - include "util/util_path.h" - include "util/util_progress.h" - include "util/util_string.h" - include "util/util_time.h" - include "util/util_transform.h" - include "util/util_version.h" CCL_NAMESPACE_BEGIN struct Options { Session *session; SessionParams session_params; } options; static void session_print_status() { } static void session_init() { options.session = new Session(options.session_params); *options.session->progress.set_update_callback(function_bind(&session_print_status));*options.session->progress.set_status("foo","bar"); } static void get_devices() { /* device names */ string device_names = ""; string devicename = "CPU"; bool list = false; vector<DeviceType>& types = Device::available_types(); /* TODO(sergey): Here's a feedback loop happens: on the one hand we want * the device list to be printed in help message, on the other hand logging * is not initialized yet so we wouldn't have debug log happening in the * device initialization. */ foreach(DeviceType type, types) { if(device_names != "") device_names += ", "; device_names += Device::string_from_type(type); } /* find matching device */ DeviceType device_type = Device::type_from_string(devicename.c_str()); vector<DeviceInfo>& devices = Device::available_devices(); DeviceInfo device_info; bool device_available = false; foreach(DeviceInfo& device, devices) { if(device_type == device.type) { options.session_params.device = device; device_available = true; break; } } } CCL_NAMESPACE_END using namespace ccl; int main(int argc, const char **argv) { session_init(); return 0; } ```
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @Griffin1977

Added subscriber: @Griffin1977

Added subscriber: @mont29

Added subscriber: @mont29

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Bastien Montagne self-assigned this 2017-06-28 10:14:55 +02:00

I do not see the point in forging a 'minimal' version that crashes, when regular code works as expected. Most obvious conclusion here is that your minimal code is missing some mandatory pieces.

In any case, this is a bug tracker, dedicated to handle bugs in latest official releases, not some random issues created by playing around with custom code. You already sent this to ML, which was the right thing to do.

I do not see the point in forging a 'minimal' version that crashes, when regular code works as expected. Most obvious conclusion here is that your minimal code is missing some mandatory pieces. In any case, this is a bug tracker, dedicated to handle bugs in latest official releases, not some random issues created by playing around with custom code. You already sent this to ML, which was the right thing to do.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#51915
No description provided.