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

Segmentation fault for tiles with Arch Linux 4.8.7-1/Mesa DRI Intel HD 520 #19285

Closed
chrzyki opened this issue Nov 14, 2016 · 18 comments
Closed
Labels
<Crash / Freeze> Fatal bug that results in hangs or crashes. SDL: Tiles / Sound Tiles visual interface and sounds.

Comments

@chrzyki
Copy link

chrzyki commented Nov 14, 2016

This might not be related to Cataclysm, at all, but I've only observed it with CDDA for now. Trying to run a freshly built (8943e1e) CDDA (Tiles! Console works!) results in a segmentation fault.

Stack trace attached.

st.txt

@Zireael07
Copy link
Contributor

How much RAM do you have?

#12 0x00000000004e56bb in cata_tiles::load_tileset (this=this@entry=0x33f48e0, img_path="gfx//ChestHoleTileset/fallback.png", R=R@entry=-1, G=G@entry=-1, B=B@entry=-1,
sprite_width=sprite_width@entry=24, sprite_height=24) at src/cata_tiles.cpp:376
#13 0x00000000004ef4db in cata_tiles::load_tilejson_from_file (this=this@entry=0x33f48e0, tileset_dir="gfx//ChestHoleTileset", f=...,
image_path="gfx//ChestHoleTileset/tiles.png") at src/cata_tiles.cpp:504
#14 0x00000000004f08ef in cata_tiles::load_tilejson (this=this@entry=0x33f48e0, tileset_root="gfx//ChestHoleTileset", json_conf="tile_config.json",
image_path="tiles.png") at src/cata_tiles.cpp:450
#15 0x00000000004f12b0 in cata_tiles::init (this=0x33f48e0) at src/cata_tiles.cpp:165
#16 0x00000000004445af in curses_init () at src/sdltiles.cpp:1639
#17 0x0000000000a76184 in initscr () at src/cursesport.cpp:49
#18 0x0000000000a7dc3e in main (argc=0, argv=0x7fffffffe740) at src/main.cpp:417

Related to #19171? At the very least, something to do with loading tilesets...

@BrettDong
Copy link
Member

#0  0x00007ffff64d6c1c in __memset_avx2_unaligned_erms () from /usr/lib/libc.so.6
#1  0x00007fffefb1215a in ?? () from /usr/lib/xorg/modules/dri/i965_dri.so
#2  0x00007fffefb12d0b in ?? () from /usr/lib/xorg/modules/dri/i965_dri.so
#3  0x00007fffefb12419 in ?? () from /usr/lib/xorg/modules/dri/i965_dri.so
#4  0x00007fffefb1b598 in ?? () from /usr/lib/xorg/modules/dri/i965_dri.so
#5  0x00007fffefb1a57d in ?? () from /usr/lib/xorg/modules/dri/i965_dri.so
#6  0x00007fffefb1b296 in ?? () from /usr/lib/xorg/modules/dri/i965_dri.so
#7  0x00007fffef8647e7 in ?? () from /usr/lib/xorg/modules/dri/i965_dri.so
#8  0x00007fffef8655e0 in ?? () from /usr/lib/xorg/modules/dri/i965_dri.so
#9  0x00007ffff78cf064 in ?? () from /usr/lib/libSDL2-2.0.so.0
#10 0x00007ffff78c81c3 in ?? () from /usr/lib/libSDL2-2.0.so.0
#11 0x00007ffff78c849b in ?? () from /usr/lib/libSDL2-2.0.so.0
#12 0x00000000004e56bb in cata_tiles::load_tileset (this=this@entry=0x33f48e0, img_path="gfx//ChestHoleTileset/fallback.png", R=R@entry=-1, G=G@entry=-1, B=B@entry=-1, 

Seems the graphics driver is also suspicious...

@BrettDong
Copy link
Member

Does Cataclysm launch successfully on another Linux Kernel version? Does it work with Wayland?

@chrzyki
Copy link
Author

chrzyki commented Nov 14, 2016

The graphics driver indeed does look suspicious. Sorry if this is unrelated to CDDA. Memory at the time of running/segfault:

Mem: 7.7G (total) 771M (used) 6.2G (free) 188M (shared) 692M (buff/cache) 6.5G (available)

I'll try Wayland when I get home!

@chrzyki
Copy link
Author

chrzyki commented Nov 15, 2016

Unfortunately, I get the exact same behaviour/crash/stack trace for Wayland/Weston.

@illi-kun illi-kun added (S1 - Need confirmation) Report waiting on confirmation of reproducibility <Crash / Freeze> Fatal bug that results in hangs or crashes. labels Nov 15, 2016
@BrettDong
Copy link
Member

Would it work if you change default tile set in options/config.json: ?

    {
        "info" : "Choose the tileset you want to use.",
        "default" : "Default: ChestHole - Values: blockhead, ChestHole16, ChestHole32, ChestHole_iso, ChestHole, ChestHoleTileset_iso, deon, HitButton_iso, hoder, MShock24Modded, MShock32Modded, retroascii, retrodays10, retrodays20, Boardgame-Style@, tsu",
        "name" : "TILES",
        "value" : "ChestHole"
    },

I guess it's something related to the graphics driver, but it would be nice if we could do something to avoid the crash.

@chrzyki
Copy link
Author

chrzyki commented Nov 16, 2016

Huh. Changing that from ChestHole to deon (randomly picked) fixes the problem and lets me run the game. I can test the other tilesets later, if you want me to!

@Zireael07
Copy link
Contributor

I think ChestHole takes the most memory of all tilesets, true or false?

@mutability
Copy link
Contributor

I see a similar crash on my Ubuntu 16.04 laptop:

#0  __memset_avx2 () at ../sysdeps/x86_64/multiarch/memset-avx2.S:135
#1  0x00007fffed24a26a in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#2  0x00007fffed24adfb in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#3  0x00007fffed24a532 in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#4  0x00007fffed253695 in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#5  0x00007fffed25266d in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#6  0x00007fffed253386 in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#7  0x00007fffecfc8ef7 in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#8  0x00007fffecfc9d00 in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#9  0x00007ffff78f4850 in ?? () from /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0
#10 0x00007ffff78edbeb in ?? () from /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0
#11 0x00007ffff78edf0b in ?? () from /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0
#12 0x000000000048e17f in cata_tiles::load_tileset (this=this@entry=0x2b89650, img_path="gfx//ChestHole32Tileset/fallback.png", R=R@entry=-1, G=G@entry=-1, B=B@entry=-1, sprite_width=32, 
    sprite_height=32) at src/cata_tiles.cpp:396
#13 0x0000000000492336 in cata_tiles::load_tilejson_from_file (this=this@entry=0x2b89650, tileset_dir="gfx//ChestHole32Tileset", f=..., image_path="gfx//ChestHole32Tileset/tiles.png")
    at src/cata_tiles.cpp:504
#14 0x00000000004927b5 in cata_tiles::load_tilejson (this=this@entry=0x2b89650, tileset_root="gfx//ChestHole32Tileset", json_conf="tile_config.json", image_path="tiles.png") at src/cata_tiles.cpp:450
#15 0x0000000000492da4 in cata_tiles::init (this=0x2b89650) at src/cata_tiles.cpp:165
#16 0x0000000000987565 in curses_init () at src/sdltiles.cpp:1645
#17 0x000000000071bf0f in initscr () at src/cursesport.cpp:49
#18 0x000000000041ca79 in main (argc=<optimised out>, argv=<optimised out>) at src/main.cpp:417

@BrettDong
Copy link
Member

What might be the cause in your opinion? Related to RAM, video memory, or hardware?

@mutability
Copy link
Contributor

I would guess it is texture-memory-related, perhaps either SDL or the intel driver not gracefully handling running out of texture space; it is failing in a SDL_CreateTextureFromSurface call.

FWIW with the SDL_gpu changes applied I don't get a failure on the same hardware.

@mutability
Copy link
Contributor

From some experimentation the crash seems to be triggered by the number of textures, rather than just outright texture size. So CDDA should reduce the number of individual textures it creates to work around it.

@codemime codemime added SDL: Tiles / Sound Tiles visual interface and sounds. and removed (S1 - Need confirmation) Report waiting on confirmation of reproducibility labels Jan 6, 2017
@chrzyki
Copy link
Author

chrzyki commented Oct 5, 2017

Did not the experience the issue with a recently compiled version. Closing this.

@chrzyki chrzyki closed this as completed Oct 5, 2017
@mutability
Copy link
Contributor

mutability commented Oct 5, 2017

This continues to be an issue as at aa9a300 (yes, it's been broken for almost a year now). Please reopen.

(gdb) run
Starting program: /home/oliver/git/Cataclysm-DDA/cataclysm-tiles 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffefb02700 (LWP 6693)]
[New Thread 0x7fffe45f8700 (LWP 6694)]
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT
Failed to map mcs buffer into GTT

Thread 1 "cataclysm-tiles" received signal SIGSEGV, Segmentation fault.
0x00007ffff6df2bb8 in main_arena () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0  0x00007ffff6df2bb8 in main_arena () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007fffed45cedc in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#2  0x00007fffed466244 in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#3  0x00007fffed1cd7ca in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#4  0x00007fffed1d5c21 in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#5  0x00007fffed1d5f3c in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#6  0x00007fffed1d6d97 in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#7  0x00007ffff7b1f720 in ?? () from /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0
#8  0x00007ffff7b1b94c in ?? () from /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0
#9  0x00007ffff7b1c11e in ?? () from /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0
#10 0x00000000004c2198 in cata_tiles::load_tileset (this=this@entry=0x345d7a0, img_path="gfx//ChestHoleTileset/fallback.png", R=R@entry=-1, G=G@entry=-1, B=B@entry=-1, 
    sprite_width=sprite_width@entry=24, sprite_height=24) at src/cata_tiles.cpp:416
#11 0x00000000004ceb00 in cata_tiles::load_tilejson_from_file (this=this@entry=0x345d7a0, tileset_dir="gfx//ChestHoleTileset", f=..., image_path="gfx//ChestHoleTileset/tiles.png")
    at src/cata_tiles.cpp:524
#12 0x00000000004d00a6 in cata_tiles::load_tilejson (this=this@entry=0x345d7a0, tileset_root="gfx//ChestHoleTileset", json_conf="tile_config.json", image_path="tiles.png") at src/cata_tiles.cpp:470
#13 0x00000000004d09f7 in cata_tiles::init (this=0x345d7a0) at src/cata_tiles.cpp:193
#14 0x000000000116b6af in curses_init () at src/sdltiles.cpp:1527
#15 0x0000000000b394e8 in initscr () at src/cursesport.cpp:49
#16 0x00000000010bb41e in main (argc=<optimised out>, argv=0x7fffffffdf20) at src/main.cpp:418

@chrzyki
Copy link
Author

chrzyki commented Oct 5, 2017

Huh, I tried very hard to reproduce that but didn't manage. Sorry & reopened.

@chrzyki chrzyki reopened this Oct 5, 2017
@BrettDong
Copy link
Member

Probably related to hardware, OS version, software package version, graphics driver version, etc. so when you're not experiencing the issue anymore, perhaps someone else is still able to reproduce it on his/her computer.

@chrzyki
Copy link
Author

chrzyki commented Oct 6, 2017

You are absolutely right, sorry about that.

@Leland
Copy link
Contributor

Leland commented Feb 20, 2018

Dupe of #21317

@Leland Leland closed this as completed Feb 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Crash / Freeze> Fatal bug that results in hangs or crashes. SDL: Tiles / Sound Tiles visual interface and sounds.
Projects
None yet
Development

No branches or pull requests

7 participants