Gigoteur / UnicornConsole

Unicorn Console: create quick fantasy game in Rust/Python/Lua/Rhai/Wasm !
MIT License
905 stars 47 forks source link

fatal runtime error: stack overflow on OSX 10.10.5 #30

Closed iezed closed 7 years ago

iezed commented 7 years ago

Hi, I compiled PX8 with this features : PX8_SCREEN_WIDTH=256 PX8_SCREEN_HEIGHT=256 cargo build --features="cpython lua" --release , on ubuntu and osx. In ubuntu i can run the samples, but on osx I have this error : thread 'main' has overflowed its stack fatal runtime error: stack overflow Abort trap: 6. With this examples : ./target/release/px8 -s 4 ./demos/demos.py it's ok, but with this : ./target/release/px8 -s 4 ./demos/pong/pong.px8 it's not. Thanks, and sorry for my english. :)

hallucino commented 7 years ago

Could you try with: cargo build --features="cpython lua" --release

without the changement of the screen size ?

iezed commented 7 years ago

I've done, cargo clean and cargo build --features="cpython lua" --release and now don't run nothing. Maybe the problem can be this ? /Library/Frameworks/Python.framework/Versions/3.5/Python, I did not install python3 from homebrew but from dmg.

iezed commented 7 years ago

I set export DYLD_FALLBACK_LIBRARY_PATH=/Library/Frameworks/Python.framework/Versions/3.5/lib this way, and it does not change anything.

hallucino commented 7 years ago

I'm not sure to understand.

What is the output of:

cargo build --release --features "cpython lua"
./target/release/px8 -s 4 ./demos/pong/pong.px8
iezed commented 7 years ago

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x00007fff85bb3286 pthread_kill + 10 1 libsystem_c.dylib 0x00007fff879a19a3 abort + 129 2 px8 0x0000000103641be9 std::sys::imp::abort_internal + 9 3 px8 0x0000000103640bb3 std::sys_common::util::abort + 131 4 px8 0x00000001036419b9 std::sys::imp::stack_overflow::imp::signal_handler + 1065 (stack_overflow.rs:112) 5 libsystem_platform.dylib 0x00007fff935e8f1a _sigtramp + 26 6 libsystem_platform.dylib 0x00007fff935e5420 _platform_memmove$VARIANT$Nehalem + 224 7 px8 0x0000000103355139 px8::gfx::{{impl}}::new + 185 (mod.rs:416) 8 px8 0x00000001033650ac px8::px8::{{impl}}::new + 76 (mod.rs:423) 9 px8 0x000000010334a475 px8::frontend::{{impl}}::init + 3861 (mod.rs:133) 10 px8 0x00000001033834b2 px8::start_px8 + 274 (main.rs:209) 11 px8 0x0000000103382b1d px8::main + 7277 (main.rs:204) 12 px8 0x00000001036446e6 std::panicking::try::do_call<fn(),()> + 6 (panicking.rs:456) 13 px8 0x000000010364590b rust_maybe_catch_panic + 27 (lib.rs:106) 14 px8 0x0000000103644e27 std::rt::lang_start::hd19f94db0c6a490e + 391 (rt.rs:57) 15 px8 0x00000001033c077a main + 42 16 libdyld.dylib 0x00007fff8dfc85c9 start + 1

hallucino commented 7 years ago

Could you run the example with '-v' please ?

iezed commented 7 years ago

[2017-05-03][10:25:05][INFO] [Frontend] SDL2 init [2017-05-03][10:25:05][INFO] [Frontend] SDL2 Video init [2017-05-03][10:25:05][INFO] [Frontend] SDL2 event pump [2017-05-03][10:25:05][INFO] [Frontend] creating renderer [2017-05-03][10:25:05][INFO] [SDL] Creating window fullscreen=false opengl=false

thread 'main' has overflowed its stack fatal runtime error: stack overflow Abort trap: 6

hallucino commented 7 years ago

I don't know the problem here. Could you try with a fresh installation and try to run the current demo ?

hallucino commented 7 years ago

Hi,

could you try with a latest sync ?

iezed commented 7 years ago

Hi, Nothing has changed. Just px is fine, when I try to run an example, I have runtime error. schermata 2017-05-13 alle 10 34 05

hallucino commented 7 years ago

could you try to run: cargo run --features "cpython lua" --release --example helloworld -- -s 4

and paste the results ?

iezed commented 7 years ago

It works :)

[2017-05-13][21:59:51][INFO] [Frontend] SDL2 init [2017-05-13][21:59:51][INFO] [Frontend] SDL2 Video init [2017-05-13][21:59:52][INFO] [Frontend] SDL2 event pump [2017-05-13][21:59:52][INFO] [Frontend] creating renderer [2017-05-13][21:59:52][INFO] [SDL] Creating window fullscreen=false opengl=true [2017-05-13][21:59:52][INFO] [SDL] Creating renderer [2017-05-13][21:59:52][INFO] [SDL] Creating texture [2017-05-13][21:59:52][INFO] [Frontend] SDL2 audio [2017-05-13][21:59:52][INFO] [Frontend] initialise controllers [2017-05-13][21:59:52][INFO] [Frontend] Init Controllers [2017-05-13][21:59:52][INFO] [Frontend] Loading the database of Game Controller [2017-05-13][21:59:52][INFO] [Frontend] -> Ok(18) [2017-05-13][21:59:52][INFO] [Frontend][CONTROLLER] 0 joysticks available [2017-05-13][21:59:52][INFO] [Frontend][JOYSTICK] 0 joysticks available [2017-05-13][21:59:52][INFO] [Frontend] initialise PX8 [2017-05-13][21:59:52][INFO] [CARTRIDGE] CartridgeCode [2017-05-13][21:59:52][INFO] [CARTRIDGE] CartridgeGFX [2017-05-13][21:59:52][INFO] [CARTRIDGE] CartridgeMap [2017-05-13][21:59:52][INFO] [CARTRIDGE] CartridgeGFF [2017-05-13][21:59:52][INFO] [CARTRIDGE] CartridgeMusic

But ./target/release/px8 ./examples/helloworld/helloworld.px8 -s 4 It does not work.

[2017-05-13][22:05:10][INFO] [Frontend] SDL2 init [2017-05-13][22:05:10][INFO] [Frontend] SDL2 Video init [2017-05-13][22:05:10][INFO] [Frontend] SDL2 event pump [2017-05-13][22:05:10][INFO] [Frontend] creating renderer [2017-05-13][22:05:10][INFO] [SDL] Creating window fullscreen=false opengl=false

thread 'main' has overflowed its stack fatal runtime error: s

hallucino commented 7 years ago

Could you try: ./target/release/px8 -s 4 ./examples/helloworld/lua/helloworld.p8

to be sure it is a problem in the python code

iezed commented 7 years ago

Always the same error at execution. cargo run --features "cpython lua" --release --example helloworld -- -s 4 This is the only way to execute on my OSX.

iezed commented 7 years ago

I compiled with the new version of rust, and now is fine. I have no idea why, but with the new version of rust, I have no run-time errors.