Segmentation Fault after upgrading to FreeBSD 11.1?

Get help, report and discuss bugs.
displaced
Posts: 8
Joined: 28 Jul 2017, 20:30

Re: Segmentation Fault after upgrading to FreeBSD 11.1?

Post by displaced » 28 Jul 2017, 22:04

Gotcha.

Ok -- downloading the debug build from GH now. Will install and run it shortly, then send over whatever info (.core file, stack trace, etc) to that gmail address.

hugbug
Developer & Admin
Posts: 6701
Joined: 09 Sep 2008, 11:58
Location: Germany (NRW)

Re: Segmentation Fault after upgrading to FreeBSD 11.1?

Post by hugbug » 28 Jul 2017, 22:07

"Error code 1" is nice :)
Try compiling the sources from distribution archive for v19.1 (see download page).
There was a recent change in develop version in configure/makefile, I wonder if it has something to do with the error.

hugbug
Developer & Admin
Posts: 6701
Joined: 09 Sep 2008, 11:58
Location: Germany (NRW)

Re: Segmentation Fault after upgrading to FreeBSD 11.1?

Post by hugbug » 28 Jul 2017, 22:11

On error code 1:
1 EPERM Operation not permitted. An attempt was made to perform an operation limited to processes with appropriate privileges or to the owner of a file or other resources.

displaced
Posts: 8
Joined: 28 Jul 2017, 20:30

Re: Segmentation Fault after upgrading to FreeBSD 11.1?

Post by displaced » 28 Jul 2017, 22:18

Interesting!

I don't think I sudo'd the make... I'll have another go. Core dump from 19.1 debug build just sent to the gmail address, btw!

donileo
Posts: 3
Joined: 31 Jul 2017, 04:20

Re: Segmentation Fault after upgrading to FreeBSD 11.1?

Post by donileo » 31 Jul 2017, 04:25

I am getting the same thing. NZBGet is crashing and exiting upon accessing its web port.

hugbug
Developer & Admin
Posts: 6701
Joined: 09 Sep 2008, 11:58
Location: Germany (NRW)

Re: Segmentation Fault after upgrading to FreeBSD 11.1?

Post by hugbug » 31 Jul 2017, 09:43

displaced wrote:
28 Jul 2017, 22:18
Core dump from 19.1 debug build just sent to the gmail address, btw!
I have troubles inspecting the core file. The GDB (debugger) can't load it. I'm using a cross-compiled gdb running on Linux, it's possible that it was built with wrong settings. I have to obtain a working FreeBSD-11 VM for testing and debugging. That will probably take a long time.

Do you have GDB on your system? If you do please try to load the core file into gdb:

Code: Select all

gdb /path/to/nzbget /path/to/nzbget.core
If gdb can successfully load the core file it should print call stack. If it doesn't try command "bt" in gdb. Then post the output on forum. Thanks.

donileo
Posts: 3
Joined: 31 Jul 2017, 04:20

Re: Segmentation Fault after upgrading to FreeBSD 11.1?

Post by donileo » 31 Jul 2017, 19:19

Ok got something...

GNU gdb (GDB) 8.0 [GDB v8.0 for FreeBSD]
Copyright (C) 2017 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-portbld-freebsd11.0".
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 nzbget.debug...done.
[New LWP 101153]
[New LWP 100764]
[New LWP 101146]
[New LWP 101147]
[New LWP 101148]
[New LWP 101162]
[New LWP 101455]
[New LWP 101648]
[New LWP 101663]
[New LWP 101664]
[New LWP 101665]
[New LWP 101666]
[New LWP 101669]
[New LWP 101670]
[New LWP 101671]
[New LWP 101672]
[New LWP 101673]
[New LWP 101674]
[New LWP 101675]
[New LWP 101676]
[New LWP 101678]
[New LWP 101679]
[New LWP 101680]
[New LWP 101681]
[New LWP 101682]
[New LWP 101684]
[New LWP 101686]
[New LWP 101687]
[New LWP 101690]
[New LWP 101691]
[New LWP 101692]
[New LWP 101693]
[New LWP 101694]
[New LWP 101695]
[New LWP 101696]
[New LWP 101697]
[New LWP 101700]
[New LWP 101142]
[New LWP 101135]
[New LWP 101155]
[New LWP 101157]
Core was generated by `./nzbget.debug -c nzbget.conf -s -o outputmode=log'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 x86_64_freebsd_fallback_frame_state (context=0x804600de0, context=0x804600de0, fs=0x804600b30) at ./md-unwind-support.h:60
60 ./md-unwind-support.h: No such file or directory.
[Current thread is 1 (LWP 101153)]
(gdb) bt
#0 x86_64_freebsd_fallback_frame_state (context=0x804600de0, context=0x804600de0, fs=0x804600b30) at ./md-unwind-support.h:60
#1 uw_frame_state_for (context=context@entry=0x804600de0, fs=fs@entry=0x804600b30) at ../../../gcc-5.3.0/libgcc/unwind-dw2.c:1249
#2 0x00000000008954db in _Unwind_ForcedUnwind_Phase2 (exc=exc@entry=0x8034afdf0, context=context@entry=0x804600de0) at ../../../gcc-5.3.0/libgcc/unwind.inc:155
#3 0x0000000000895b54 in _Unwind_ForcedUnwind (exc=0x8034afdf0, stop=0x57d1a0 <thread_unwind_stop>, stop_argument=<optimized out>)
at ../../../gcc-5.3.0/libgcc/unwind.inc:207
#4 0x000000000057d38c in _pthread_exit_mask ()
#5 0x000000000057d3ab in pthread_exit ()
#6 0x000000000057b36c in thread_start ()
#7 0x0000000804401000 in ?? ()
Backtrace stopped: Cannot access memory at address 0x804601000

donileo
Posts: 3
Joined: 31 Jul 2017, 04:20

Re: Segmentation Fault after upgrading to FreeBSD 11.1?

Post by donileo » 01 Aug 2017, 04:54

Update: So apparently the logfile I posted above points to a corrupt stack trace which means there was an issue "unwinding the seg fault" maybe because there is an issue with the binary, maybe because the debug binary was compiled with optimizations. In short not much can be derived from the above gdb output.

However, I went ahead and built nzbget from source and I am no longer getting a segmentation fault. I don't know what the prebuilt 19.1 binary depends on that changed in FreeBSD 11.1 but rebuilding gets rid of the error. To rebuild I did the following for FreeBSD.

run the following as root:
1. cp -r /usr/ports/news/nzbget /usr/ports/news/nzbget91
2. cd /usr/ports/news/nzbget91 and edit the Makefile and change line 5 "PORTVERSION = 19.0" to "PORTVERSION = 19.1"
3. run make makesum
4. then run make
5. make a backup of your current nzbget binary as we will be replacing it in step 6
6. now cp /usr/ports/news/nzbget/work/nzbget-19.1/nzbget to your nzbget directory
7. run nzbget as you normally would

Once this issue is resolved or the actual /usr/ports/news/nzbget port updates to 19.1 feel free to delete the nzb91 directory.

To the nzbget devs: considering a rebuild on 11.1 works can you guys provide the freebsd-19.1 binaries built with 11.1 for those on 11.1?

hugbug
Developer & Admin
Posts: 6701
Joined: 09 Sep 2008, 11:58
Location: Germany (NRW)

Re: Segmentation Fault after upgrading to FreeBSD 11.1?

Post by hugbug » 01 Aug 2017, 11:46

I've configured a VM with FreeBSD 11.1 and can reproduce the problem.

I'll see if I can find a way to build a binary which works on all FreeBSD versions and forks (FreeNAS, etc.). If that has now become impossible I'll probably remove FreeBSD installer from download page. Providing individual binaries/installers for each FreeBSD version is way too expensive.

hugbug
Developer & Admin
Posts: 6701
Joined: 09 Sep 2008, 11:58
Location: Germany (NRW)

Re: Segmentation Fault after upgrading to FreeBSD 11.1?

Post by hugbug » 03 Aug 2017, 12:53

I have built a compiler toolchain specifically for 11.1 but the generated binaries have exactly the same problem. This is weird.

After studying FreeBSD docs I've discover that FreeBSD can run Linux binaries. I've tried this and it worked.

Who wants to test?
We use NZBGet installer for Linux. The installer checks the operating system it runs on and will abort if executed on FreeBSD. However there is an installer option to unpack all files. The configuration step will be skipped however and therefore some additional manual work is needed after unpack.

Steps:
  • download NZBGet installer for Linux:

    Code: Select all

    wget https://nzbget.net/download/nzbget-latest-bin-linux.run
  • run installer:

    Code: Select all

    sh nzbget-latest-bin-linux.run --unpack
  • rename files:

    Code: Select all

    cd nzbget
    mv nzbget-x86_64 nzbget
    mv unrar-x86_64 unrar
    mv 7z-x86_64 7z
  • prepare configuration file:

    Code: Select all

    cp webui/nzbget.conf.template nzbget.conf
  • let FreeBSD know we have Linux binaries here:

    Code: Select all

    brandelf -t Linux nzbget
    brandelf -t Linux unrar
    brandelf -t Linux 7z
  • load Linux kernel module:

    Code: Select all

    kldload linux
    kldload linux64
Then try to run NZBGet as usual.

For Linux compatibility to be enabled at boot time, add this line to /etc/rc.conf:

Code: Select all

linux_enable="YES"
More info: Configuring Linux® Binary Compatibility. NOTE: For NZBGet you don't need to install any additional libraries.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 4 guests