You are not logged in.

#1 2021-09-19 22:37:32

ltsdw
Member
Registered: 2020-04-20
Posts: 73

[Solved] 0ad segfaulting under new created user

The game runs fine under my main user, but under my other user exclusive for gaming it segfaults, it's probably a permission issue I think, but I don't know what the game wants, my user is at the groups games, video and audio (things like, wine, glxgears, gfxbench, multimedia/video/audio, it's all working under this user).

Last edited by ltsdw (2021-09-21 13:53:23)

Offline

#2 2021-09-20 10:13:05

ponyrider
Member
Registered: 2014-11-18
Posts: 112

Re: [Solved] 0ad segfaulting under new created user

is the Proton version to blame? I'm just assuming you are running this with steam ?

PROTON_LOG=1 %command%

run the game with that command and post back?

Offline

#3 2021-09-20 10:45:04

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [Solved] 0ad segfaulting under new created user

ltsdw wrote:

...my user is at the groups ... video and audio...

Why?
https://wiki.archlinux.org/title/Users_ … emd_groups


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#4 2021-09-20 10:54:18

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: [Solved] 0ad segfaulting under new created user

0ad & Oad-data are in community repo, no need for steam / proton or any other emulation.

ltsdw, please post the output of starting /usr/bin/0ad from terminal for both users.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#5 2021-09-20 11:27:42

ltsdw
Member
Registered: 2020-04-20
Posts: 73

Re: [Solved] 0ad segfaulting under new created user

audio because I configured pulse to work as it's working right now

...
load-module module-native-protocol-unix auth-group=audio socket=/tmp/pulse-server
...

and video for

...
Access to video capture devices, 2D/3D hardware acceleration
...

Lone_wolf wrote:

ltsdw, please post the output of starting /usr/bin/0ad from terminal for both users.

output with my regular user:

TIMER| InitVfs: 233.022 us
Writing the mainlog at /home/little/.config/0ad/logs/mainlog.html
TIMER| CONFIG_Init: 2.88291 ms
[ALSOFT] (EE) Failed to set real-time priority for thread: Operation not permitted (1)
[ALSOFT] (EE) Failed to set real-time priority for thread: Operation not permitted (1)
Sound: AlcInit success, using OpenAL Soft
UserReport written to /home/little/.config/0ad/logs/userreport_hwdetect.txt
TIMER| RunHardwareDetection: 19.1772 ms
TIMER| write_sys_info: 16.5726 ms
TIMER| InitRenderer: 13.1351 ms
TIMER| ps_console: 2.85965 ms
TIMER| ps_lang_hotkeys: 1.50522 ms
TIMER| common/modern/setup.xml: 121.444 us
TIMER| common/modern/styles.xml: 105.124 us
TIMER| common/modern/sprites.xml: 1.29091 ms
TIMER| common/global.xml: 356.498 us
TIMER| common/setup.xml: 208.158 us
TIMER| common/sprites.xml: 493.98 us
TIMER| common/styles.xml: 102.702 us
TIMER| pregame/backgrounds/: 289.852 us
TIMER| pregame/sprites.xml: 124.145 us
TIMER| pregame/styles.xml: 24.275 us
TIMER| pregame/mainmenu.xml: 34.0401 ms
TIMER| common/modern/setup.xml: 111.462 us
TIMER| common/modern/styles.xml: 99.185 us
TIMER| common/modern/sprites.xml: 1.11652 ms
TIMER| common/global.xml: 248.285 us
TIMER| common/sprites.xml: 396.605 us
TIMER| splashscreen/setup.xml: 29.709 us
TIMER| splashscreen/splashscreen.xml: 19.996 ms
TIMER| common/modern/setup.xml: 106.337 us
TIMER| common/modern/styles.xml: 177.282 us
TIMER| common/modern/sprites.xml: 1.12041 ms
TIMER| msgbox/msgbox.xml: 13.4132 ms
TIMER| shutdown TexMan: 0.849 us
TIMER| shutdown Renderer: 402.017 us
TIMER| shutdown SDL: 37.2512 ms
TIMER| shutdown UserReporter: 409.442 us
TIMER| shutdown ConfigDB: 604.716 us
TIMER| resource modules: 194.3 ms
TIMER TOTALS (9 clients)
-----------------------------------------------------
  tc_pool_alloc: 71.166 kc (50x)
  tc_png_decode: 4196.8 kc (2x)
  tc_dds_transform: 48.157 kc (14x)
  tc_transform: 656.129 kc (6x)
  tc_plain_transform: 564.458 kc (6x)
  tc_ShaderGLSLLink: 1813.93 kc (1x)
  tc_ShaderGLSLCompile: 8701.97 kc (2x)
  tc_ShaderValidation: 991.263 kc (2x)
  xml_validation: 111.559 kc (1x)
-----------------------------------------------------
TIMER| shutdown misc: 255.053 us

and the output with my other user:

TIMER| InitVfs: 288.306 us
Writing the mainlog at /home/mg_user/.config/0ad/logs/mainlog.html
TIMER| CONFIG_Init: 2.80293 ms
[ALSOFT] (EE) Failed to set real-time priority for thread: Operation not permitted (1)
[ALSOFT] (EE) Failed to set real-time priority for thread: Operation not permitted (1)
Sound: AlcInit success, using OpenAL Soft
Segmentation fault

Offline

#6 2021-09-20 12:00:25

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: [Solved] 0ad segfaulting under new created user

Writing the mainlog at /home/mg_user/.config/0ad/logs/mainlog.html

contents of that file ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#7 2021-09-20 12:37:53

ltsdw
Member
Registered: 2020-04-20
Posts: 73

Re: [Solved] 0ad segfaulting under new created user

Lone_Wolf wrote:

contents of that file ?

mainlog.html

Offline

#8 2021-09-20 13:02:31

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [Solved] 0ad segfaulting under new created user

Did you miss...

Wiki wrote:

However, note that adding users to the groups can even cause some functionality to break (for example, the audio group will break fast user switching and allows applications to block software mixing).


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#9 2021-09-20 13:10:58

ltsdw
Member
Registered: 2020-04-20
Posts: 73

Re: [Solved] 0ad segfaulting under new created user

Slithery wrote:

Did you miss...

Wiki wrote:

However, note that adding users to the groups can even cause some functionality to break (for example, the audio group will break fast user switching and allows applications to block software mixing).

but if I don't add my user to certain groups I don't get certain functionalities, like if I don't add my user to audio group, I don't get audio. It's a trade off that's worth paying for, right now the only thing not working right is 0ad.

Offline

#10 2021-09-20 15:45:13

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,427

Re: [Solved] 0ad segfaulting under new created user

Offline

#11 2021-09-20 16:35:59

ltsdw
Member
Registered: 2020-04-20
Posts: 73

Re: [Solved] 0ad segfaulting under new created user

V1del wrote:

Post the coredump: https://wiki.archlinux.org/title/Core_d … _core_dump

I don't know if I did right (no core dump was generated automatically), so I used gdb, but the file had 3GB so I tried this here:

gdb pyrogenesis core.86692 
GNU gdb (GDB) 11.1
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-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
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 pyrogenesis...
(No debugging symbols found in pyrogenesis)

warning: Can't open file /memfd:pulseaudio (deleted) during file-backed mapping note processing
[New LWP 86692]
[New LWP 86697]
[New LWP 86698]
[New LWP 86699]
[New LWP 86700]
[New LWP 86701]
[New LWP 86702]
[New LWP 86703]
[New LWP 86704]
[New LWP 86706]
[New LWP 86707]
[New LWP 86708]
[New LWP 86709]
[New LWP 86710]
[New LWP 86711]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Core was generated by `/usr/bin/pyrogenesis'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007ffff7e8e262 in ?? () from /usr/lib/libSDL2-2.0.so.0
[Current thread is 1 (Thread 0x7ffff3447d80 (LWP 86692))]
(gdb) where 
#0  0x00007ffff7e8e262 in ?? () from /usr/lib/libSDL2-2.0.so.0
#1  0x00007ffff7e8cb51 in ?? () from /usr/lib/libSDL2-2.0.so.0
#2  0x00007ffff7e6f4b2 in ?? () from /usr/lib/libSDL2-2.0.so.0
#3  0x00007ffff7e767d9 in ?? () from /usr/lib/libSDL2-2.0.so.0
#4  0x00007ffff7e407ac in ?? () from /usr/lib/libSDL2-2.0.so.0
#5  0x00007ffff7da8318 in ?? () from /usr/lib/libSDL2-2.0.so.0
#6  0x0000555555824488 in ?? ()
#7  0x00005555556005b0 in ?? ()
#8  0x00005555555f18dc in ?? ()
#9  0x00007ffff5f4db25 in __libc_start_main () from /usr/lib/libc.so.6
#10 0x00005555555fd0be in ?? ()

there's that line:

warning: Can't open file /memfd:pulseaudio (deleted) during file-backed mapping note processing

but I think it is, as it says, just a warning.

Last edited by ltsdw (2021-09-20 16:37:45)

Offline

#12 2021-09-21 07:01:40

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,427

Re: [Solved] 0ad segfaulting under new created user

From a glance SDL is primarily used for input/the window. What are you doing for granting access to your xorg session/input devices to the other user? To make real sense of the backtrace you'll need to compile SDL2 with debug symbols: https://wiki.archlinux.org/title/Debugg … ing_traces

Also regarding the audio/pulse passthrough, the "audio" group is basically a keyword that allows much more than just passing pulse clients to pulse due to various software assumptions, consider making a pulse group or so that will only be applicable to this socket.

Also what's the goal here? If you want actual sandboxing, using something tailored like firejail is likely to be more secure AND less of a hassle than trying to properly do this with different users alone. What are you trying to prevent? A game reading/deleting/modifying your $HOME dir?

Last edited by V1del (2021-09-21 09:24:02)

Offline

#13 2021-09-21 13:15:40

ltsdw
Member
Registered: 2020-04-20
Posts: 73

Re: [Solved] 0ad segfaulting under new created user

V1del wrote:

From a glance SDL is primarily used for input/the window. What are you doing for granting access to your xorg session/input devices to the other user?

I did nothing too fancy, a GUI complained it couldn't open display, so I simple exported DISPLAY, and since then everything else was cool.

recompiling sld2 with debug options.

V1del wrote:

Also regarding the audio/pulse passthrough, the "audio" group is basically a keyword that allows much more than just passing pulse clients to pulse due to various software assumptions, consider making a pulse group or so that will only be applicable to this socket.

Ok, noted, will do that.

V1del wrote:

Also what's the goal here? If you want actual sandboxing, using something tailored like firejail is likely to be more secure AND less of a hassle than trying to properly do this with different users alone. What are you trying to prevent? A game reading/deleting/modifying your $HOME dir?

I wouldn't say sandboxing, I just got tired of the cluttering of dot files and other stuff/mime-type of wine and friends. So I decided to separate work stuff from gaming stuff.

Last edited by ltsdw (2021-09-21 13:26:26)

Offline

#14 2021-09-21 13:46:26

ltsdw
Member
Registered: 2020-04-20
Posts: 73

Re: [Solved] 0ad segfaulting under new created user

recompiled sdl with option=(debug !strip). pyrogenesis doesn't have debug symbols though.

now gdb shows something like:

(gdb) where
#0  FcitxCreateInputContext (ic_path=0x7fffffffbd38, appname=0x555557496e10 "pyrogenesis", dbus=0x0)
    at /usr/src/debug/SDL2-2.0.16/src/core/linux/SDL_fcitx.c:224
#1  FcitxClientCreateIC (client=0x7ffff7f19880 <fcitx_client>) at /usr/src/debug/SDL2-2.0.16/src/core/linux/SDL_fcitx.c:257
#2  SDL_Fcitx_Init () at /usr/src/debug/SDL2-2.0.16/src/core/linux/SDL_fcitx.c:310
#3  0x00007ffff7e8c709 in SDL_IME_Init () at /usr/src/debug/SDL2-2.0.16/src/core/linux/SDL_ime.c:91
#4  0x00007ffff7e6eb0a in X11_InitKeyboard (_this=_this@entry=0x55555747f680) at /usr/src/debug/SDL2-2.0.16/src/video/x11/SDL_x11keyboard.c:407
#5  0x00007ffff7e75f69 in X11_VideoInit (_this=0x55555747f680) at /usr/src/debug/SDL2-2.0.16/src/video/x11/SDL_x11video.c:449
#6  0x00007ffff7e4181c in SDL_VideoInit_REAL (driver_name=driver_name@entry=0x0) at /usr/src/debug/SDL2-2.0.16/src/video/SDL_video.c:545
#7  0x00007ffff7da6328 in SDL_InitSubSystem_REAL (flags=1064993) at /usr/src/debug/SDL2-2.0.16/src/SDL.c:223
#8  0x0000555555824488 in ?? ()
#9  0x00005555556005b0 in ?? ()
#10 0x00005555555f18dc in ?? ()
#11 0x00007ffff5f4bb25 in __libc_start_main () from /usr/lib/libc.so.6
#12 0x00005555555fd0be in ?? ()

Edit:
OK, got it, fcitx was to blame, I was exporting SDL_IM_MODULE=fcitx. All fine now, thank you all!

Last edited by ltsdw (2021-09-21 13:52:49)

Offline

#15 2021-09-21 14:00:45

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,427

Re: [Solved] 0ad segfaulting under new created user

The crash is in SDL and apparently in the FCTIX integration of SDL which tries to talk to the fctix defined in your xorg session. I'd say quick fix for that is exposing your DBUS_SESSION_BUS_ADDRESS to the secondary user, or disabling fctix integration by exporting SDL_IM_MODULE=false or something (value doesn't matter as long as it  isn't fctix).

Edit: Ah you noticed

Last edited by V1del (2021-09-21 14:01:30)

Offline

Board footer

Powered by FluxBB