Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rendering Segfault #3046

Closed
0x6273 opened this issue Oct 29, 2021 · 5 comments
Closed

Rendering Segfault #3046

0x6273 opened this issue Oct 29, 2021 · 5 comments
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior C-Dependencies A change to the crates that Bevy depends on

Comments

@0x6273
Copy link

0x6273 commented Oct 29, 2021

Bevy version

main

Operating system & version

Gentoo, with musl libc

What you did

cargo run --example clear_color

What you expected to happen

The example shouldn't segfault.

What actually happened

It immediately segfaults.

Additional information

The hello_world example works, presumably because it doesn't render anything. But the other examples I've tried all segfault, including the _pipelined examples on the pipelined-rendering branch.

gdb target/debug/examples/clear_color
GNU gdb (Gentoo 10.2 vanilla) 10.2
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-gentoo-linux-musl".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from target/debug/examples/clear_color...
r
warning: Missing auto-load script at offset 0 in section .debug_gdb_scripts
of file /home/user/Projects/bevy/target/debug/examples/clear_color.
Use `info auto-load python-scripts [REGEXP]' to list them.
(gdb) r
Starting program: /home/user/Projects/bevy/target/debug/examples/clear_color

Program received signal SIGSEGV, Segmentation fault.
0x000000000039e446 in ?? ()
(gdb) bt
#0  0x000000000039e446 in ?? ()
#1  0x00007ffff5395000 in _GLOBAL__sub_I_GlslangToSpv.cpp ()
#2  0x00007ffff74ef529 in libc_start_init ()
#3  0x00007ffff53974a0 in ?? ()
#4  0x00007ffff74ef54e in libc_start_main_stage2 ()
#5  0x00007ffff74ef531 in libc_start_init ()
#6  0x0000000000000000 in ?? ()
@0x6273 0x6273 added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Oct 29, 2021
@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen C-Dependencies A change to the crates that Bevy depends on and removed S-Needs-Triage This issue needs to be labelled labels Oct 29, 2021
@mockersf
Copy link
Member

it seems to be crashing when calling https://github.com/cart/glsl-to-spirv

@0x6273
Copy link
Author

0x6273 commented Oct 29, 2021

Discord thread

@cart
Copy link
Member

cart commented Oct 29, 2021

Update from that thread: this should hopefully be resolved once we merge the new renderer and remove the old renderer.

@0x6273
Copy link
Author

0x6273 commented Oct 29, 2021

I found a workaround. Here is what I had to do:

  1. git checkout pipelined-rendering
  2. apply this patch:
diff --git a/crates/bevy_internal/Cargo.toml b/crates/bevy_internal/Cargo.toml
index f2df1808..0b585854 100644
--- a/crates/bevy_internal/Cargo.toml
+++ b/crates/bevy_internal/Cargo.toml
@@ -19,8 +19,8 @@ trace = [ "bevy_app/trace", "bevy_ecs/trace", "bevy_render2/trace" ]
 trace_chrome = [ "bevy_log/tracing-chrome" ]
 
 # Image format support for texture loading (PNG and HDR are enabled by default)
-hdr = ["bevy_render/hdr", "bevy_render2/hdr" ]
-png = ["bevy_render/png", "bevy_render2/png" ]
+hdr = ["bevy_render2/hdr" ]
+png = ["bevy_render2/png" ]
 dds = ["bevy_render/dds", "bevy_render2/dds" ]
 tga = ["bevy_render/tga", "bevy_render2/tga" ]
 jpeg = ["bevy_render/jpeg", "bevy_render2/jpeg" ]
  1. run with RUSTFLAGS=-Ctarget-feature=-crt-static cargo run --no-default-features --features "bevy_audio,bevy_core_pipeline,bevy_dynamic_plugin,bevy_gilrs,bevy_gltf2,bevy_sprite2,bevy_render2,bevy_pbr2,bevy_winit,png,hdr,mp3,x11" --example clear_color_pipelined

@0x6273
Copy link
Author

0x6273 commented Dec 14, 2021

#3312 seems to have fixed this. I can run the examples on the main branch now, with just cargo run --example.

@0x6273 0x6273 closed this as completed Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior C-Dependencies A change to the crates that Bevy depends on
Projects
None yet
Development

No branches or pull requests

4 participants