Cloudef / orbment

Modular Wayland compositor
Other
246 stars 16 forks source link

loliwm instantly exits on vnc #59

Closed CosmicToast closed 9 years ago

CosmicToast commented 9 years ago

The goal is to launch loliwm on a vnc-xdisplay and later view it through that. However, wlc reports that loliwm exits... immediately after it starts (vnc log may be seen here). I can send my xstartup and loliwm startup system if it's needed.

Cloudef commented 9 years ago

Well, the log seems fine. How do you start it?

CosmicToast commented 9 years ago

Loliwm was installed the following way:

mkdir -p ~/.bin/loliwm_prefix && cd ~/.bin/loliwm
git clone (...) src && cd src
mkdir build && cd build
cmake .. && make -j4

This script is then placed into loliwm_prefix: source Symbolically linked into ~/.bin/loliwm

Loliwm is then launched by running "loliwm" (with ~/.bin being in PATH).

I've used this sort of setup for many other self-compiled projects...

Source of xstartup (for vnc): here Source of exports.sh: here (to make programs with support launch through wayland).

ld-cd commented 9 years ago

Do you have suid set on the binary (owner has to be root) On Feb 6, 2015 4:28 PM, "Chloe" notifications@github.com wrote:

Loliwm was installed the following way: mkdir -p ~/.bin/loliwm_prefix && cd ~/.bin/loliwm git clone (...) src && cd src mkdir build && cd build cmake .. && make -j4

This script is then placed into loliwm_prefix: source http://sprunge.us/JJBd Symbolically linked into ~/.bin/loliwm

Loliwm is then launched by running "loliwm" (with ~/.bin being in PATH).

I've used this sort of setup for many other self-compiled projects...

Source of xstartup (for vnc): here http://sprunge.us/bLCj Source of exports.sh: here http://sprunge.us/UHHF (to make programs with support launch through wayland).

— Reply to this email directly or view it on GitHub https://github.com/Cloudef/loliwm/issues/59#issuecomment-73338780.

CosmicToast commented 9 years ago

I have not, but after doing that, result is the same.

ld-cd commented 9 years ago

chmod ug+s should set suid correctly. Did you compile and install wlc separately, if you did it sometimes installs to /usr/local/lib, which isn't always in libdir. Try running loliwm like this "loliwm 2> somefile", and then posting the contents.

CosmicToast commented 9 years ago

If you read the above, it's compiled from git in $HOME/.bin/loliwm_prefix/src and not installed at all. Exact same issue after reapplying suid. Please see the links posted above for the debug output of wlc, how loliwm was installed etc.

ld-cd commented 9 years ago

Sorry i didn't look closely enough at your post. It says parent exited in the log, that might mean vnc or sh stopped.

CosmicToast commented 9 years ago

The parent means loliwm, afaik (since wlc is what outputs it). VNC does not exit (I can connect to it, there's just nothing there). Not sure how sh would matter in an "exec" statement.....

ld-cd commented 9 years ago

good points (sorry I'm a bit of a noob), it looks like after a quick glance through fd.c (wlc) it looks like drm_load is exiting immediately, causing the function communicate to run, which seems to be the thing causing the exit of the whole program.

ld-cd commented 9 years ago

I think its probably just not loading in a way we don't expect it to not load

ld-cd commented 9 years ago

my guess would be that by resetting LD_LIBRARY_PATH your making it impossible to find libdrm.so, and therefore breaking that piece of code (line 72 in fd.c).

Cloudef commented 9 years ago

The parent exit comes from the FD passing fork that runs as suid or sgid permissions (depending if you need TTY switching or not), opening and closing fds for the compositor and handling drm master and drops permissions. Parent exit also means that the fd fork noticed that the main process died. The strange thing is that it seems to die normally, without anything in log. (I may bail out somewhere without logging, I guess?)

@ld-cd Should the drm_load function print out error if that particular line failed? I don't see any references in the log.

@5paceToast Can you check with gdb that the process actually exits normally. (And post backtrace with bt, if there is any)

CosmicToast commented 9 years ago

I checked loliwm's RPATH and it matched the LD_LIBRARY_PATH. Trying to run it w/o LD_LIBRARY_PATH (so relying on the executable's built-in rpath) still has the same issue.

CosmicToast commented 9 years ago

GDB results - interesting:

Program received signal SIGFPE, Arithmetic exception.
[Switching to Thread 0x7fd1a0dee700 (LWP 5869)]

backtrace:

#0  0x00007fd19f9b5b4e in ?? ()
#1  0x3a8888883a888888 in ?? ()
#2  0x3a8888883a888888 in ?? ()
#3  0x3a8888883a888888 in ?? ()
#4  0x3a8888883a888888 in ?? ()
#5  0x3b0888883b088888 in ?? ()
#6  0x3b0888883b088888 in ?? ()
#7  0x3b0888883b088888 in ?? ()
#8  0x3b0888883b088888 in ?? ()
#9  0x0000000000000000 in ?? ()

Do note that since I can't properly gdb in VNC, this is the result of gdb when trying to launch loliwm through ssh X11 forwarding.

Cloudef commented 9 years ago

Seems like something somewhee is causing sigfpe, wlc catches those in debug builds. Either build with release or set WAYLAND_DISPLAY to something to workaround this. (Also make sure your DISPLAY is set to correct X server, though if you use startx/xinit, it should do it correctly). You can also comment lines 387-388 in wlc.c to disable sigfpe handler.

CosmicToast commented 9 years ago

Building in release fixes all of my previous issues. There goes the hope of debugging~

ids1024 commented 8 years ago

I am also getting SIGFPE with orbment (fixed by using a release build).