tidal-gui icon indicating copy to clipboard operation
tidal-gui copied to clipboard

segmentation fault

Open ndr-brt opened this issue 3 years ago • 14 comments

OS: ubuntu 21.04 Kernel version: 5.11.0-1015-gcp

When I try to run it from the terminal I get

./tidal-gui  
[1]    7295 segmentation fault (core dumped)  ./tidal-gui

ndr-brt avatar Aug 06 '21 20:08 ndr-brt

hmm that's a new one to me.. could you try to clone the repo and build the program yourself? note that you need to move the static folder to the same folder where the executable is and edit the ghc_mode.txt file to WITH_GHC=TRUE to actually run the program

polymorphicengine avatar Aug 07 '21 07:08 polymorphicengine

I changed the WITH_GHC property but same result. I tried to build it by myself following the "workflow" yml but I get cabal errors... I haven't had much luck with cabal lately :(

ndr-brt avatar Aug 09 '21 07:08 ndr-brt

when you build yourself you just need the static folder and nothing else, so the workflow would just come down to doing a cabal update && cabal build I'm guessing you get dependency errors from cabal? What version of GHC are you using? I'm pretty sure it's broken for ghc 9.0.1

polymorphicengine avatar Aug 09 '21 08:08 polymorphicengine

Yep, I was used ghc 9.0.1, now with 8.10 I built it, copied the static folder and it started. I got another error when I evaluated the "tidal hello world", but that gets out of the scope of this issue.

Don't know if that helps, but this is the syslog detail of the segmentation fault error:

Aug  9 10:51:38 andrea-XPS-13-9370 kernel: [ 8253.129850] tidal-gui[52232]: segfault at 40 ip 0000000000000040 sp 00007ffd772c2c98 error 14 in tidal-gui[400000+42a3000]
Aug  9 10:51:38 andrea-XPS-13-9370 kernel: [ 8253.129858] Code: Unable to access opcode bytes at RIP 0x16.

EDIT: my kernel version is 5.11.0-1015-gcp

ndr-brt avatar Aug 09 '21 08:08 ndr-brt

hmm.. could you do a ldd tidal-gui for your downloaded application and post the results?

polymorphicengine avatar Aug 09 '21 09:08 polymorphicengine

here's the output:

	linux-vdso.so.1 (0x00007ffd0c57f000)
	libz.so.1 => /home/andrea/Downloads/binary/./c-libs/libz.so.1 (0x00007ffa4f97b000)
	libtinfo.so.6 => /home/andrea/Downloads/binary/./c-libs/libtinfo.so.6 (0x00007ffa4f94b000)
	librt.so.1 => /home/andrea/Downloads/binary/./c-libs/librt.so.1 (0x00007ffa4f940000)
	libutil.so.1 => /home/andrea/Downloads/binary/./c-libs/libutil.so.1 (0x00007ffa4f93b000)
	libdl.so.2 => /home/andrea/Downloads/binary/./c-libs/libdl.so.2 (0x00007ffa4f935000)
	libpthread.so.0 => /home/andrea/Downloads/binary/./c-libs/libpthread.so.0 (0x00007ffa4f910000)
	libgmp.so.10 => /home/andrea/Downloads/binary/./c-libs/libgmp.so.10 (0x00007ffa4f88c000)
	libm.so.6 => /home/andrea/Downloads/binary/./c-libs/libm.so.6 (0x00007ffa4f73d000)
	libc.so.6 => /home/andrea/Downloads/binary/./c-libs/libc.so.6 (0x00007ffa4f54b000)
	/lib64/ld-linux-x86-64.so.2 (0x00007ffa4f999000)

ndr-brt avatar Aug 09 '21 09:08 ndr-brt

ok that looks as expected could you do the same thing for your compiled binary? (I'm not really sure what I'm looking for, but I'm guessing one of these c libraries throws the segmentation fault error and there might be differences in the c-libs of ubuntu 21.04 compared to other versions ? )

polymorphicengine avatar Aug 09 '21 09:08 polymorphicengine

Here's the output, seems like the libraries used are not the same. with these it works

	linux-vdso.so.1 (0x00007ffffe186000)
	libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f1c94534000)
	libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007f1c94505000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f1c944fa000)
	libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f1c944f5000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f1c944ee000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f1c944ca000)
	libgmp.so.10 => /lib/x86_64-linux-gnu/libgmp.so.10 (0x00007f1c94447000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1c9425b000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f1c9410d000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f1c94572000)

ndr-brt avatar Aug 09 '21 11:08 ndr-brt

so if you would replace the files in the c-libs folder by the files of the same name on your system, the downloaded application works aswell ?

polymorphicengine avatar Aug 09 '21 12:08 polymorphicengine

I removed c-libs and replaced it with a link to the system library folder:

ln -s /lib/x86_64-linux-gnu/ c-libs

With this it started! So maybe the solution could be to use the system libraries?

But then I tried the d1 $ s "bd" evaluation and I got:

Unknown error: exceptionMissing file: /opt/ghc/8.10.1/lib/ghc-8.10.1/settings

ndr-brt avatar Aug 09 '21 14:08 ndr-brt

did you reset WITH_GHC=FALSE in the ghc_mode.txt ?

polymorphicengine avatar Aug 09 '21 14:08 polymorphicengine

Ok, now it works!

ndr-brt avatar Aug 09 '21 14:08 ndr-brt

great! So I guess, since the needed libraries seem to be available on ubuntu 21.04, I could make a seperate workflow that links to the system library folder like you did instead of copying the libs ? I guess they will be in the same location on every system ?

I know for ubuntu 18 not all libraries were available by default on the system, and I guess for other linux distributions it will be similar

polymorphicengine avatar Aug 09 '21 14:08 polymorphicengine

I checked... on an ubuntu 20.04 the lib path is the same, but on a centos 7 the path is /lib64/.
Don't know if there's a way to get the library path

ndr-brt avatar Aug 09 '21 15:08 ndr-brt