INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: MC25 segfaults after a few seconds in Ubuntu Bionic container  (Read 2326 times)

BryanC

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2554
MC25 segfaults after a few seconds in Ubuntu Bionic container
« on: December 24, 2019, 09:18:13 am »

MC25 is segfaulting on me after running a few seconds in an Ubuntu Bionic based container running an X server with openbox on DISPLAY=:1. The .deb package installs all of its dependencies just fine. On first run MC successfully creates the .jriver directory in my home directory and populates it:

Code: [Select]
root@5c0873aa1f73:/# tree /config/.jriver/
/config/.jriver/
├── Cache
│   └── Sort Character Table v5 (0x3) (0x0).dat
├── Lock
│   └── JRiver Settings File Lock
└── Media Center 25
    ├── Data
    ├── Settings
    │   ├── Machine Settings.ini
    │   └── User Settings.ini
    ├── Skins
    │   ├──*snip*
    └── Temp

76 directories, 1796 files

Running process list prior to starting mediacenter25:
Code: [Select]
root@5c0873aa1f73:/# ps aux
USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root           1  0.0  0.0    200     4 pts/0    Ss   10:03   0:00 s6-svscan -t0 /var/run/s6/services
root          26  0.0  0.0    188     8 pts/0    S    10:03   0:00 foreground  if   /etc/s6/init/init-stage2-redirfd   foreground    if     if      s6-echo      -n
root          27  0.0  0.0    200     4 pts/0    S    10:03   0:00 s6-supervise s6-fdholderd
root          38  0.0  0.0    184     4 pts/0    S    10:03   0:00 foreground  s6-setsid  -gq  --  with-contenv  backtick  -D  0  -n  S6_LOGGING   printcontenv   S
root         379  0.0  0.0    200     4 pts/0    S    10:03   0:00 s6-supervise Xorg
root         380  0.0  0.0    200     4 pts/0    S    10:03   0:00 s6-supervise guacamole
root         382  0.0  0.0    200     4 pts/0    S    10:03   0:00 s6-supervise xclipboard
root         383  0.0  0.0    200     4 pts/0    S    10:03   0:00 s6-supervise xrdp
root         385  0.0  0.0    200     4 pts/0    S    10:03   0:00 s6-supervise openbox
root         386  0.0  0.0    200     4 pts/0    S    10:03   0:00 s6-supervise xrdp-chansrv
root         387  0.0  0.0    200     4 pts/0    S    10:03   0:00 s6-supervise guacd
root         391  0.0  0.2 878692 40800 ?        Ssl  10:03   0:00 /usr/lib/xorg/Xorg :1 -displayfd 3 -config /etc/X11/xrdp/xorg.conf -noreset -nolisten tcp
tomcat8      392  2.9  2.2 8948404 363132 ?      Ssl  10:03   0:12 /usr/lib/jvm/default-java/bin/java -Djava.util.logging.config.file=/var/lib/tomcat8/conf/logging
abc          393  0.0  0.0  49036  4360 ?        Ss   10:03   0:00 /usr/bin/xclipboard
root         394  0.0  0.0  25252  5044 ?        Ss   10:03   0:00 /usr/sbin/xrdp --nodaemon
abc          395  0.0  0.0 191636 15296 ?        Ss   10:03   0:00 /usr/bin/openbox --startup /usr/lib/x86_64-linux-gnu/openbox-autostart OPENBOX
abc          396  0.0  0.0 124764  3064 ?        Ssl  10:03   0:00 /usr/sbin/xrdp-chansrv
root         398  0.0  0.0 152004 13784 ?        Ss   10:03   0:00 /usr/sbin/guacd -f -b 127.0.0.1 -l 4822
root         418  0.0  0.0      0     0 ?        Z    10:03   0:00 [s6-notifyonchec] <defunct>
root         427  0.0  0.0  20176  3852 pts/0    S    10:03   0:00 /bin/bash
root        8017  0.0  0.0  36068  3416 pts/0    R+   10:10   0:00 ps aux

LDD:
Code: [Select]
root@5a62f610f57f:/config/.jriver# ldd -d /usr/bin/mediacenter25
linux-vdso.so.1 (0x00007ffd08ba2000)
libcryptlib.so => /usr/lib/jriver/Media Center 25/libcryptlib.so (0x00007f30c9e91000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f30c9c72000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f30c9a6a000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f30c9866000)
libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f30c965f000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f30c9327000)
libXrandr.so.2 => /usr/lib/x86_64-linux-gnu/libXrandr.so.2 (0x00007f30c911c000)
libGL.so.1 => /usr/lib/x86_64-linux-gnu/libGL.so.1 (0x00007f30c8e90000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f30c8b07000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f30c8769000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f30c8551000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f30c8160000)
/lib64/ld-linux-x86-64.so.2 (0x00007f30ca42d000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f30c7f38000)
libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f30c7d26000)
libXrender.so.1 => /usr/lib/x86_64-linux-gnu/libXrender.so.1 (0x00007f30c7b1c000)
libGLX.so.0 => /usr/lib/x86_64-linux-gnu/libGLX.so.0 (0x00007f30c78eb000)
libGLdispatch.so.0 => /usr/lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007f30c7635000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f30c7431000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f30c722b000)
libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f30c7016000)

I'm not sure what else I can provide that can help you here.  I can test debug builds if necessary. My next step would be to port the base image I'm using from Ubuntu to Debian, but I would lose upstream update support unless I create a build system, which is not something I really want to do. The Apache Guacamole/Tomcat setup is finicky enough that it may require rewriting the Dockerfile for Debian from scratch.
Logged

max096

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 358
Re: MC25 segfaults after a few seconds in Ubuntu Bionic container
« Reply #1 on: December 24, 2019, 12:47:35 pm »

Quote
I'm not sure what else I can provide that can help you here.

The dockerfile would ofc be helpful.

Since you are using openbox (like my docker image) you'll also run into a problem where if you minimize JRiver it's gone and you can't really bring it back.
I solved that with a service script that brings the last window you opened to the top of all windows whenever the Window changes.
https://gitlab.shio.at/max/jrivermc-docker/tree/master/rootfs/etc/services.d/xpropspy

Feel free to copy whatever you need.

You could ofc have a more complete desktop with openbox too, but im not sure if youd want that for just jriver and nothing else.
Logged

BryanC

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2554
Re: MC25 segfaults after a few seconds in Ubuntu Bionic container
« Reply #2 on: December 24, 2019, 03:17:49 pm »

I'm using the linuxserver.io's guacgui base image:

Code: [Select]
FROM lsiobase/guacgui

ARG jriver_tag=latest
ARG jriver_release=25
ENV jriver_release=${jriver_release}

RUN apt-get update \
 && apt-get install -y gnupg2

# Add JRiver packages to apt-get
RUN curl "http://dist.jriver.com/mediacenter@jriver.com.gpg.key" | apt-key add - \
 && curl "http://dist.jriver.com/${jriver_tag}/mediacenter/mediacenter${jriver_release}.list" -o /etc/apt/sources.list.d/mediacenter${jriver_release}.list \

# Install JRiver MC
 && apt-get update \
 && apt-get install -y mediacenter${jriver_release} \
 && rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/*

# copy service file
COPY /root /

# set display
ENV DISPLAY=:1

# ports and volumes
EXPOSE 3389 8080
EXPOSE 52199 1900/udp
VOLUME ["/config"]

The service file (/etc/services.d/mediacenter/run):
Code: [Select]
#!/bin/execlineb -P

# Redirect stderr to stdout.
fdmove -c 2 1

# Wait until openbox is running
if { s6-svwait -t 10000 -U /var/run/s6/services/openbox/ }
# Wait until guacamole is running
if { s6-svwait -t 10000 -U /var/run/s6/services/guacamole/ }

# Drop privileges and set env
s6-setuidgid abc
s6-env DISPLAY=:1 HOME=/config

# Execute mediacenter
/usr/bin/mediacenter${jriver_release}

It could certainly be caused by podman on Fedora 31, I have not tried with Docker/VM. I've had nothing but headaches with the cgroupsv2 migration.
Logged

BryanC

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2554
Re: MC25 segfaults after a few seconds in Ubuntu Bionic container
« Reply #3 on: December 24, 2019, 04:15:35 pm »

The dockerfile would ofc be helpful.

Since you are using openbox (like my docker image) you'll also run into a problem where if you minimize JRiver it's gone and you can't really bring it back.
I solved that with a service script that brings the last window you opened to the top of all windows whenever the Window changes.
https://gitlab.shio.at/max/jrivermc-docker/tree/master/rootfs/etc/services.d/xpropspy

Feel free to copy whatever you need.

You could ofc have a more complete desktop with openbox too, but im not sure if youd want that for just jriver and nothing else.

I just tried running your image in a fresh F31 VM using podman 1.6.2 and I still cannot get MC to run. I'm going to assume that this is podman related although the container seems to be running fine (aside from the MC service not starting).

Code: [Select]
$ podman run \
>     --rm \
>     --name=jrivermc25 \
>     --net=bridge \
>     -p 5800:5800 \
>     -v config:/config:rw \
>     -e VNC_PASSWORD=12345 \
>     -e ENABLE_SIGNATURE=0 \
>     shiomax/jrivermc25
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-app-niceness.sh: executing...
[cont-init.d] 00-app-niceness.sh: exited 0.
[cont-init.d] 00-app-script.sh: executing...
[cont-init.d] 00-app-script.sh: exited 0.
[cont-init.d] 00-app-user-map.sh: executing...
[cont-init.d] 00-app-user-map.sh: exited 0.
[cont-init.d] 00-clean-logmonitor-states.sh: executing...
[cont-init.d] 00-clean-logmonitor-states.sh: exited 0.
[cont-init.d] 00-clean-tmp-dir.sh: executing...
[cont-init.d] 00-clean-tmp-dir.sh: exited 0.
[cont-init.d] 00-set-app-deps.sh: executing...
[cont-init.d] 00-set-app-deps.sh: exited 0.
[cont-init.d] 00-set-home.sh: executing...
[cont-init.d] 00-set-home.sh: exited 0.
[cont-init.d] 00-take-config-ownership.sh: executing...
[cont-init.d] 00-take-config-ownership.sh: exited 0.
[cont-init.d] 00-xdg-runtime-dir.sh: executing...
[cont-init.d] 00-xdg-runtime-dir.sh: exited 0.
[cont-init.d] 10-certs.sh: executing...
[cont-init.d] 10-certs.sh: exited 0.
[cont-init.d] 10-cjk-font.sh: executing...
[cont-init.d] 10-cjk-font.sh: exited 0.
[cont-init.d] 10-nginx.sh: executing...
[cont-init.d] 10-nginx.sh: exited 0.
[cont-init.d] 10-vnc-password.sh: executing...
stored passwd in file: /root/.vncpass
[cont-init.d] 10-vnc-password.sh: exited 0.
[cont-init.d] 10-web-index.sh: executing...
[cont-init.d] 10-web-index.sh: exited 0.
[cont-init.d] 11-max-popups.sh: executing...
[cont-init.d] 11-max-popups.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] starting s6-fdholderd...
[services.d] starting nginx...
[services.d] starting xpropspy...
[nginx] starting...
[services.d] starting xvfb...
xprop:  unable to open display ':0'
./run: 10: ./run: ps: not found
[xvfb] starting...
[services.d] starting statusmonitor...
[services.d] starting openbox...
[statusmonitor] no file to monitor: disabling service...
s6-svwait: fatal: unable to s6_svstatus_read: No such file or directory
[services.d] starting certsmonitor...
[openbox] starting...
[services.d] starting logmonitor...
[logmonitor] no file to monitor: disabling service...
[services.d] starting x11vnc...
[services.d] starting app...
[certsmonitor] disabling service: secure connection not enabled.
[x11vnc] starting...
[app] starting JRiver MediaCenter 25...
24/12/2019 22:10:08 passing arg to libvncserver: -rfbport
24/12/2019 22:10:08 passing arg to libvncserver: 5900
24/12/2019 22:10:08 passing arg to libvncserver: -rfbportv6
24/12/2019 22:10:08 passing arg to libvncserver: -1
24/12/2019 22:10:08 passing arg to libvncserver: -httpportv6
24/12/2019 22:10:08 passing arg to libvncserver: -1
24/12/2019 22:10:08 passing arg to libvncserver: -desktop
24/12/2019 22:10:08 passing arg to libvncserver: JRiver MediaCenter 25
24/12/2019 22:10:08 passing arg to libvncserver: -rfbauth
24/12/2019 22:10:08 passing arg to libvncserver: /root/.vncpass
24/12/2019 22:10:08 x11vnc version: 0.9.14 lastmod: 2015-11-14  pid: 806
[services.d] done.
24/12/2019 22:10:08 Using X display :0
24/12/2019 22:10:08 rootwin: 0x43 reswin: 0x400001 dpy: 0x8b1249a0
24/12/2019 22:10:08
24/12/2019 22:10:08 ------------------ USEFUL INFORMATION ------------------
24/12/2019 22:10:08 X DAMAGE available on display, using it for polling hints.
24/12/2019 22:10:08   To disable this behavior use: '-noxdamage'
24/12/2019 22:10:08
24/12/2019 22:10:08   Most compositing window managers like 'compiz' or 'beryl'
24/12/2019 22:10:08   cause X DAMAGE to fail, and so you may not see any screen
24/12/2019 22:10:08   updates via VNC.  Either disable 'compiz' (recommended) or
24/12/2019 22:10:08   supply the x11vnc '-noxdamage' command line option.
24/12/2019 22:10:08 X COMPOSITE available on display, using it for window polling.
24/12/2019 22:10:08   To disable this behavior use: '-noxcomposite'
24/12/2019 22:10:08
24/12/2019 22:10:08 Wireframing: -wireframe mode is in effect for window moves.
24/12/2019 22:10:08   If this yields undesired behavior (poor response, painting
24/12/2019 22:10:08   errors, etc) it may be disabled:
24/12/2019 22:10:08    - use '-nowf' to disable wireframing completely.
24/12/2019 22:10:08    - use '-nowcr' to disable the Copy Rectangle after the
24/12/2019 22:10:08      moved window is released in the new position.
24/12/2019 22:10:08   Also see the -help entry for tuning parameters.
24/12/2019 22:10:08   You can press 3 Alt_L's (Left "Alt" key) in a row to
24/12/2019 22:10:08   repaint the screen, also see the -fixscreen option for
24/12/2019 22:10:08   periodic repaints.
24/12/2019 22:10:08 GrabServer control via XTEST.
24/12/2019 22:10:08
24/12/2019 22:10:08 Scroll Detection: -scrollcopyrect mode is in effect to
24/12/2019 22:10:08   use RECORD extension to try to detect scrolling windows
24/12/2019 22:10:08   (induced by either user keystroke or mouse input).
24/12/2019 22:10:08   If this yields undesired behavior (poor response, painting
24/12/2019 22:10:08   errors, etc) it may be disabled via: '-noscr'
24/12/2019 22:10:08   Also see the -help entry for tuning parameters.
24/12/2019 22:10:08   You can press 3 Alt_L's (Left "Alt" key) in a row to
24/12/2019 22:10:08   repaint the screen, also see the -fixscreen option for
24/12/2019 22:10:08   periodic repaints.
24/12/2019 22:10:08
24/12/2019 22:10:08 XKEYBOARD: number of keysyms per keycode 7 is greater
24/12/2019 22:10:08   than 4 and 51 keysyms are mapped above 4.
24/12/2019 22:10:08   Automatically switching to -xkb mode.
24/12/2019 22:10:08   If this makes the key mapping worse you can
24/12/2019 22:10:08   disable it with the "-noxkb" option.
24/12/2019 22:10:08   Also, remember "-remap DEAD" for accenting characters.
24/12/2019 22:10:08
24/12/2019 22:10:08 X FBPM extension not supported.
24/12/2019 22:10:08 X display is not capable of DPMS.
24/12/2019 22:10:08 --------------------------------------------------------
24/12/2019 22:10:08
24/12/2019 22:10:08 Default visual ID: 0x21
24/12/2019 22:10:08 Read initial data from X display into framebuffer.
24/12/2019 22:10:08 initialize_screen: fb_depth/fb_bpp/fb_Bpl 24/32/5120
24/12/2019 22:10:08
24/12/2019 22:10:08 X display :0 is 32bpp depth=24 true color
24/12/2019 22:10:08
24/12/2019 22:10:08 Listening for VNC connections on TCP port 5900
24/12/2019 22:10:08
24/12/2019 22:10:08 Xinerama is present and active (e.g. multi-head).
24/12/2019 22:10:08 Xinerama: number of sub-screens: 1
24/12/2019 22:10:08 Xinerama: no blackouts needed (only one sub-screen)
24/12/2019 22:10:08
24/12/2019 22:10:08 fb read rate: 1149 MB/sec
24/12/2019 22:10:08 fast read: reset -wait  ms to: 10
24/12/2019 22:10:08 fast read: reset -defer ms to: 10
24/12/2019 22:10:08 The X server says there are 10 mouse buttons.
24/12/2019 22:10:08 screen setup finished.
24/12/2019 22:10:08

The VNC desktop is:      2aef1006093e:0
PORT=5900

******************************************************************************
Have you tried the x11vnc '-ncache' VNC client-side pixel caching feature yet?

The scheme stores pixel data offscreen on the VNC viewer side for faster
retrieval.  It should work with any VNC viewer.  Try it by running:

    x11vnc -ncache 10 ...

One can also add -ncache_cr for smooth 'copyrect' window motion.
More info: http://www.karlrunge.com/x11vnc/faq.html#faq-client-caching

[app] starting JRiver MediaCenter 25...
[app] starting JRiver MediaCenter 25...
[app] starting JRiver MediaCenter 25...
[app] starting JRiver MediaCenter 25...
[app] starting JRiver MediaCenter 25...
[app] starting JRiver MediaCenter 25...
[app] starting JRiver MediaCenter 25...

I then kill it and everything shuts down gracefully.

What's weird is if I create a simple container with xterm using jlesage's base image, it runs perfectly fine! I can access xterm via port 5800 in my web browser. It just seems that MC will not run for some reason.
Logged

max096

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 358
Re: MC25 segfaults after a few seconds in Ubuntu Bionic container
« Reply #4 on: December 24, 2019, 05:00:52 pm »

It sadly does not work in podman. You have to disable systemd in the podman command as it assumes youre using systemd (inside the container) and symlinks some things into the container by default that clash with s6overlay.

Code: [Select]
--systemd=true|false|always
    Run container in systemd mode. The default is true.

Thatīs the flag i mean for podman run. If you set that to false it (almost) works. Iīm not sure yet why it does not. Iīll try to figure that out at some point.

With docker the image works fine.

You could try your image in docker too. Maybe it works there as well. I know they say you can simply alias podman to docker and use it as if you where using docker and everything is supposed to work. My experience with that has been pretty hit and miss.
Logged

BryanC

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2554
Re: MC25 segfaults after a few seconds in Ubuntu Bionic container
« Reply #5 on: December 24, 2019, 05:45:06 pm »

My experience with that has been pretty hit and miss.

So far I've missed far more than I've hit. I've lost a solid two weeks trying to deal with podman issues across my entire workflow. The biggest problem is that you never know what won't work ahead of time (I'm on my third bugzilla report atm) because they refuse to acknowledge the fact that podman is not a drop-in replacement. If at the very least they published a list of compatible base images it would save a lot of time. They really screwed up by forcing cgroups v2 into F31. It's such an obvious power play to move users away from Docker, but they forgot to ship an alternative that actually works to offset the broken compatibility. And for some reason they are set on sticking with libpod 1.6.2 in F31 (probably because they know that updating podman within a release cycle is extremely risky based on the major changes they have had to make in the interim to restore basic functionality). I've had podman crash my entire system numerous times, which has not happened since F18 despite being the "safe" rootless container implementation. For the first time in nearly a decade I feel like the stereotypical RHEL beta tester.

And since I was always taught to end on a positive, Toolbox is a pretty nice tool for users (considering it is optional).
Logged

max096

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 358
Re: MC25 segfaults after a few seconds in Ubuntu Bionic container
« Reply #6 on: December 26, 2019, 06:57:43 pm »

GDB also wasnīt very helpful. Iīm sitting at the same segfault (probably? hopefully?) that you are.

Code: [Select]
root@a5fd92bdfc33:/# gdb mediacenter25
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 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-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://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 mediacenter25...(no debugging symbols found)...done.
(gdb) run
Starting program: /usr/bin/mediacenter25
warning: Error disabling address space randomization: Operation not permitted
During startup program terminated with signal SIGSEGV, Segmentation fault.
(gdb) bt
No stack.

Not very helpful. No stack. Dies on startup. I was very sceptical of this giving me anything but jibberish anyways (given that jriver isnīt exactly open source, probably no one could read whatever it outputs). But it does not even do jibberish.

I also just installed nautilus into the otherwise identical JRiver image and started that instead of JRiver.
And no one behold there was nautilus. Exact same image. JRiver still installed actually, just started nautilus instead.

I think we are just not getting JRiver to run in podman for the time being.  :-\

And trying to build it with buildah instead I did not even get this far. It told me it cannot find sh every script it ran (after building 'successfully' when running the result with podman).
Logged
Pages: [1]   Go Up