crownengine / crown

The flexible game engine.
https://www.crownengine.org
Other
2.15k stars 154 forks source link

Crown fails an assertion #52

Closed robstolarz closed 8 years ago

robstolarz commented 8 years ago

Arch Linux 4.3.3, GCC 5.3.0

[rob@Archie][~/dev/crown/build/linux64/bin]% gdb ./crown-debug-64
<snip gdb boot prelude>
Reading symbols from ./crown-debug-64...done.
(gdb) r
Starting program: /home/rob/dev/crown/build/linux64/bin/crown-debug-64
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7ffff33f0700 (LWP 31049)]
Initializing Crown Engine 0.1.13...

Assertion failed: s != NULL
        s must be not null

        In: ../../../src/core/strings/dynamic_string.h:85
Stacktrace:
        [1] /home/rob/dev/crown/build/linux64/bin/crown-debug-64() [0x4f7b59]
        [2] /home/rob/dev/crown/build/linux64/bin/crown-debug-64: (crown::error::abort(char const*, int, char const*, ...)
        [3] /home/rob/dev/crown/build/linux64/bin/crown-debug-64: (crown::DynamicString::DynamicString(char const*, crown::Allocator&))+0x4c in /home/rob/dev/crown/build/projects/linux/../../../src/core/strings/dynamic_string.h:86
        [4] /home/rob/dev/crown/build/linux64/bin/crown-debug-64: (crown::DiskFilesystem::DiskFilesystem(char const*))+0x47 in /home/rob/dev/crown/build/projects/linux/../../../src/core/filesystem/disk_filesystem.cpp:29
        [5] /home/rob/dev/crown/build/linux64/bin/crown-debug-64: (crown::Device::init())+0x82 in /home/rob/dev/crown/build/projects/linux/../../../src/device.cpp:84 (discriminator 1)
        [6] /home/rob/dev/crown/build/linux64/bin/crown-debug-64: (crown::init(crown::DeviceOptions const&))+0x7b in /home/rob/dev/crown/build/projects/linux/../../../src/device.cpp:474 (discriminator 4)
        [7] /home/rob/dev/crown/build/linux64/bin/crown-debug-64: (crown::func(void*))+0x23 in /home/rob/dev/crown/build/projects/linux/../../../src/main/main_linux.cpp:342
        [8] /home/rob/dev/crown/build/linux64/bin/crown-debug-64: (crown::Thread::run())+0x36 in /home/rob/dev/crown/build/projects/linux/../../../src/core/thread/thread.h:112
        [9] /home/rob/dev/crown/build/linux64/bin/crown-debug-64: (crown::Thread::thread_proc(void*))+0x18 in /home/rob/dev/crown/build/projects/linux/../../../src/core/thread/thread.h:118
        [10] /usr/lib/libpthread.so.0: ()+0x74a4 in ??:0
        [11] /usr/lib/libc.so.6: (clone)+0x6d in ??:0
[Thread 0x7ffff33f0700 (LWP 31049) exited]
[Inferior 1 (process 31045) exited with code 01]
dbartolini commented 8 years ago

Build in debug mode and: https://github.com/taylor001/crown#samples

robstolarz commented 8 years ago
[rob@Archie][~/dev/crown/build/linux64/bin]% ./crown-debug-64 --source-dir 00-hello-world --bundle-dir /tmp/bundle --compile --platform linux --continue
Initializing Crown Engine 0.1.13...

Assertion failed: _file != NULL
        fopen: errno = 2

        In: ../../../src/core/filesystem/os_file.h:50
Stacktrace:
        [1] ./crown-debug-64() [0x4f7b59]
        [2] ./crown-debug-64: (crown::error::abort(char const*, int, char const*, ...))+0xa8 in /home/rob/dev/crown/build/projects/linux/../../../src/core/error/error.cpp:31
        [3] ./crown-debug-64: (crown::OsFile::open(char const*, crown::FileOpenMode::Enum))+0x72 in /home/rob/dev/crown/build/projects/linux/../../../src/core/filesystem/os_file.h:62
        [4] ./crown-debug-64: (crown::DiskFile::open(char const*, crown::FileOpenMode::Enum))+0x2d in /home/rob/dev/crown/build/projects/linux/../../../src/core/filesystem/disk_file.cpp:26
        [5] ./crown-debug-64: (crown::DiskFilesystem::open(char const*, crown::FileOpenMode::Enum))+0x11f in /home/rob/dev/crown/build/projects/linux/../../../src/core/filesystem/disk_filesystem.cpp:41 (discriminator 4)
        [6] ./crown-debug-64: (crown::ResourceLoader::run())+0x199 in /home/rob/dev/crown/build/projects/linux/../../../src/resource/resource_loader.cpp:91
        [7] ./crown-debug-64: (crown::ResourceLoader::thread_proc(void*))+0x18 in /home/rob/dev/crown/build/projects/linux/../../../src/resource/resource_loader.h:60
        [8] ./crown-debug-64: (crown::Thread::run())+0x36 in /home/rob/dev/crown/build/projects/linux/../../../src/core/thread/thread.h:112
        [9] ./crown-debug-64: (crown::Thread::thread_proc(void*))+0x18 in /home/rob/dev/crown/build/projects/linux/../../../src/core/thread/thread.h:118
        [10] /usr/lib/libpthread.so.0: ()+0x74a4 in ??:0
        [11] /usr/lib/libc.so.6: (clone)+0x6d in ??:0

also

[rob@Archie][~/dev/crown/build/linux64/bin]% ./crown-debug-64 --source-dir ../../../samples/00-hello-world --bundle-dir /tmp/bundle --compile --platform linux --continue
a14e8dfa2cd117e2-9dea40fdc2245efc <= lua/game.lua

Assertion failed: _file != NULL
        fopen: errno = 2

        In: ../../../src/core/filesystem/os_file.h:50
Stacktrace:
        [1] ./crown-debug-64() [0x4f7b59]
        [2] ./crown-debug-64: (crown::error::abort(char const*, int, char const*, ...))+0xa8 in /home/rob/dev/crown/build/projects/linux/../../../src/core/error/error.cpp:31
        [3] ./crown-debug-64: (crown::OsFile::open(char const*, crown::FileOpenMode::Enum))+0x72 in /home/rob/dev/crown/build/projects/linux/../../../src/core/filesystem/os_file.h:62
        [4] ./crown-debug-64: (crown::DiskFile::open(char const*, crown::FileOpenMode::Enum))+0x2d in /home/rob/dev/crown/build/projects/linux/../../../src/core/filesystem/disk_file.cpp:26
        [5] ./crown-debug-64: (crown::DiskFilesystem::open(char const*, crown::FileOpenMode::Enum))+0x11f in /home/rob/dev/crown/build/projects/linux/../../../src/core/filesystem/disk_filesystem.cpp:41 (discriminator 4)
        [6] ./crown-debug-64: (crown::CompileOptions::read(char const*))+0x4e in /home/rob/dev/crown/build/projects/linux/../../../src/compilers/compile_options.h:50
        [7] ./crown-debug-64: (crown::lua_resource::compile(char const*, crown::CompileOptions&))+0x1de in /home/rob/dev/crown/build/projects/linux/../../../src/resource/lua_resource.cpp:59
        [8] ./crown-debug-64: (crown::BundleCompiler::compile(crown::StringId64, char const*, crown::CompileOptions&))+0x92 in /home/rob/dev/crown/build/projects/linux/../../../src/compilers/bundle_compiler.cpp:176
        [9] ./crown-debug-64: (crown::BundleCompiler::compile(char const*, char const*, char const*))+0x232 in /home/rob/dev/crown/build/projects/linux/../../../src/compilers/bundle_compiler.cpp:116
        [10] ./crown-debug-64: (crown::BundleCompiler::compile_all(char const*))+0x20d in /home/rob/dev/crown/build/projects/linux/../../../src/compilers/bundle_compiler.cpp:151
        [11] ./crown-debug-64: (crown::bundle_compiler::main(bool, bool, char const*))+0x37 in
/home/rob/dev/crown/build/projects/linux/../../../src/compilers/bundle_compiler.cpp:221
        [12] ./crown-debug-64: (main)+0xcd in /home/rob/dev/crown/build/projects/linux/../../../src/main/main_linux.cpp:604
        [13] /usr/lib/libc.so.6: (__libc_start_main)+0xf0 in ??:0
        [14] ./crown-debug-64: (_start)+0x29 in ??:?

It's not quite clear what destination and bundle paths are.

dbartolini commented 8 years ago

Source and bundle paths must be absolute, try something like:

--source-dir /path/to/samples/00-hello-world --bundle-dir /tmp/bundle

Crown acts as a compiler, it pulls data from source dir, compiles it and puts binary blobs into bundle dir.

robstolarz commented 8 years ago

Running ./crown-debug-64 --source-dir /home/rob/dev/crown/samples/00-hello-world --bundle-dir /tmp/bundle --compile --platform linux --continue gives http://sprunge.us/HagS .

dbartolini commented 8 years ago

What's the output of glxinfo | grep OpenGL? It looks like you are missing proper graphics driver.

robstolarz commented 8 years ago
[rob@Archie][~]% glxinfo | grep OpenGL
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  153 (GLX)
  Minor opcode of failed request:  24 (X_GLXCreateNewContext)
  Value in failed request:  0x0
  Serial number of failed request:  47
  Current serial number in output stream:  48

It appears something truly evil is happening with OpenGL. It seems to be Skylake and Nvidia's fault, not yours. Seems like the only crash issue was giving it relative paths. I'll try and fix this, if I get a new issue I'll file it separately. Thanks!

robstolarz commented 8 years ago

Yep, it runs correctly now.