Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
GCC upgrade (4.9.4 to 7.3.0) and JACK issues
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
tclover
Guru
Guru


Joined: 10 Apr 2011
Posts: 516

PostPosted: Sun May 20, 2018 8:56 am    Post subject: GCC upgrade (4.9.4 to 7.3.0) and JACK issues Reply with quote

I had to update my system and use a new GCC. I merged glibc beforehand because the version I was using was masked, then merged GCC-7.3.0.
First, I was tempted to update my system to not have to rebuild the same package several time. But as the half of my system (nearly 1500 package) have to be updated, ABI breackages made a `revdep-rebuild --library libstdc++.so -- --exclude sys-devel/gcc' mandatory.

The process was still painful, but I still managed to rebuild the packages linked to libstdc++.so after switching the compiler to the new GCC-7.3.0, and then updated my system with a `emerge -avuDN @world' afterwards. An `emerge @preserved-rebuild' was still necessary to take care of the leftovers.

media-sound/jack-connection-kit was not functional with segmentation faults and client connection errors. So a second `revdep-rebuild --library libstdc++.so -- --exclude sys-devel/gcc' was necessary. Still, a quick outlook of the rebuilded packages looked fine but media-sound/a2jmidid which I had to rebuild manually.

Code:
cd /var/db/pkg; grep -l libstdc++.so **/*/NEEDED
app-admin/elektra-0.8.20/NEEDED
app-arch/p7zip-16.02-r2/NEEDED
app-arch/plzip-1.6/NEEDED
app-arch/unrar-5.6.3/NEEDED
app-arch/zstd-1.3.4/NEEDED
app-cdr/cdrdao-1.2.3-r4/NEEDED
app-cdr/dvd+rw-tools-7.1-r3/NEEDED
app-cdr/gaffitter-0.6.0-r1/NEEDED
app-crypt/gpgme-1.11.1/NEEDED
app-crypt/pinentry-1.1.0-r1/NEEDED
app-doc/doxygen-1.8.14/NEEDED
app-emulation/qemu-2.11.1-r53/NEEDED
app-office/libreoffice-6.0.3.2/NEEDED
app-portage/deltup-0.4.6-r1/NEEDED
app-portage/eix-0.33.2/NEEDED
app-text/djvu-3.5.27/NEEDED
app-text/evince-3.24.2-r1/NEEDED
app-text/html2text-1.3.2a-r1/NEEDED
app-text/hunspell-1.6.2/NEEDED
app-text/libabw-0.1.2/NEEDED
app-text/libebook-0.1.3/NEEDED
app-text/libepubgen-0.1.0/NEEDED
app-text/libetonyek-0.1.8/NEEDED
app-text/libmspub-0.1.4/NEEDED
app-text/libmwaw-0.3.14/NEEDED
app-text/libodfgen-0.1.6/NEEDED
app-text/libqxp-0.0.1/NEEDED
app-text/libstaroffice-0.0.6/NEEDED
app-text/libwpd-0.10.2/NEEDED
app-text/libwpg-0.3.2/NEEDED
app-text/libwps-0.4.9/NEEDED
app-text/mythes-1.2.4/NEEDED
app-text/openjade-1.3.2-r7/NEEDED
app-text/opensp-1.5.2-r6/NEEDED
app-text/pdf2htmlEX-0.14.6.2/NEEDED
app-text/pdftk-2.02/NEEDED
app-text/poppler-0.63.0/NEEDED
app-text/qpdf-8.0.2/NEEDED
app-text/texlive-core-2017-r3/NEEDED
dev-cpp/atkmm-2.24.2/NEEDED
dev-cpp/cairomm-1.12.0-r1/NEEDED
dev-cpp/clucene-2.3.3.4-r6/NEEDED
dev-cpp/glibmm-2.52.1/NEEDED
dev-cpp/gtkmm-2.24.5/NEEDED
dev-cpp/gtkmm-3.22.2/NEEDED
dev-cpp/libcmis-0.5.2_pre20160820-r1/NEEDED
dev-cpp/libglademm-2.6.7-r2/NEEDED
dev-cpp/libgnomecanvasmm-2.26.0-r1/NEEDED
dev-cpp/libxmlpp-2.40.1/NEEDED
dev-cpp/libxmlpp-3.0.1/NEEDED
dev-cpp/pangomm-2.40.1/NEEDED
dev-cpp/tbb-2018.20180312/NEEDED
dev-db/cpp-driver-2.8.1/NEEDED
dev-db/mysql-5.7.22/NEEDED
dev-db/mysql-connector-c-6.1.11-r1/NEEDED
dev-lang/php-5.6.36/NEEDED
dev-lang/swig-3.0.12/NEEDED
dev-libs/DirectFB-1.7.6-r1/NEEDED
dev-libs/boehm-gc-7.6.4/NEEDED
dev-libs/boost-1.66.0/NEEDED
dev-libs/dbus-c++-0.9.0-r3/NEEDED
dev-libs/efl-1.17.2/NEEDED
dev-libs/elfutils-0.170-r1/NEEDED
dev-libs/fcgi-2.4.1_pre0910052249-r2/NEEDED
dev-libs/gmp-6.1.2-r1/NEEDED
dev-libs/icu-58.2-r1/NEEDED
dev-libs/jemalloc-5.0.1/NEEDED
dev-libs/jsoncpp-1.8.4/NEEDED
dev-libs/libcdio-0.94-r1/NEEDED
dev-libs/libconfig-1.7.2/NEEDED
dev-libs/libebml-1.3.5/NEEDED
dev-libs/libixion-0.13.0/NEEDED
dev-libs/libmemcached-1.0.18-r3/NEEDED
dev-libs/liborcus-0.13.4/NEEDED
dev-libs/libpcre-8.42/NEEDED
dev-libs/librevenge-0.0.4-r1/NEEDED
dev-libs/libsigc++-2.10.0/NEEDED
dev-libs/protobuf-3.5.2/NEEDED
dev-libs/pugixml-1.9/NEEDED
dev-libs/xapian-1.4.5/NEEDED
dev-util/bdelta-0.3.1-r1/NEEDED
dev-util/cmake-3.11.1/NEEDED
dev-util/colm-0.13.0.5/NEEDED
dev-util/cppunit-1.14.0/NEEDED
dev-util/geany-1.33/NEEDED
dev-util/gperf-3.1/NEEDED
dev-util/lv2-c++-tools-1.0.5/NEEDED
dev-util/ninja-1.8.2/NEEDED
dev-util/patchelf-0.9_p20180129/NEEDED
dev-util/ragel-7.0.0.10-r1/NEEDED
dev-util/re2c-1.0.3/NEEDED
media-fonts/pcf2bdf-1.04-r1/NEEDED
media-gfx/exiv2-0.26_p20180319/NEEDED
media-gfx/graphite2-1.3.11/NEEDED
media-gfx/graphviz-2.40.1-r1/NEEDED
media-gfx/icc_examin-0.56_p20171007/NEEDED
media-gfx/imagemagick-7.0.7.28/NEEDED
media-gfx/inkscape-0.92.3/NEEDED
media-gfx/ufraw-0.22-r2/NEEDED
media-libs/audiofile-0.3.6-r3/NEEDED
media-libs/flac-1.3.2-r1/NEEDED
media-libs/ftgl-2.1.3_rc5/NEEDED
media-libs/ganv-1.4.2/NEEDED
media-libs/gexiv2-0.10.8/NEEDED
media-libs/glu-9.0.0-r1/NEEDED
media-libs/harfbuzz-1.7.6/NEEDED
media-libs/ladspa-cmt-1.16-r4/NEEDED
media-libs/ladspa-sdk-1.13-r2/NEEDED
media-libs/lensfun-0.3.2-r1/NEEDED
media-libs/libbs2b-3.1.0-r2/NEEDED
media-libs/libcdr-0.1.4/NEEDED
media-libs/libffado-2.4.0/NEEDED
media-libs/libfreehand-0.1.2/NEEDED
media-libs/libmatroska-1.4.8/NEEDED
media-libs/libmodplug-0.8.9.0/NEEDED
media-libs/libmp4v2-2.0.0/NEEDED
media-libs/libpagemaker-0.0.4/NEEDED
media-libs/libraw-0.18.9/NEEDED
media-libs/libvisio-0.1.6/NEEDED
media-libs/libvpx-1.7.0/NEEDED
media-libs/libzmf-0.0.2/NEEDED
media-libs/mesa-18.0.9999/NEEDED
media-libs/opencv-3.3.0-r5/NEEDED
media-libs/oyranos-0.9.6/NEEDED
media-libs/rubberband-1.8.1-r1/NEEDED
media-libs/taglib-1.11.1-r1/NEEDED
media-libs/tiff-4.0.9-r3/NEEDED
media-libs/vamp-plugin-sdk-2.7.1/NEEDED
media-libs/x265-2.7/NEEDED
media-libs/zita-alsa-pcmi-0.2.0/NEEDED
media-libs/zita-resampler-1.3.0/NEEDED
media-plugins/calf-0.90.0/NEEDED
media-plugins/frei0r-plugins-1.6.1/NEEDED
media-sound/deadbeef-0.7.2/NEEDED
media-sound/ecasound-2.9.1-r1/NEEDED
media-sound/jack-audio-connection-kit-1.9.12/NEEDED
media-sound/jack_capture-0.9.71/NEEDED
media-sound/ladish-1-r2/NEEDED
media-sound/mac-4.11.4.5.7/NEEDED
media-sound/mpd-0.20.12/NEEDED
media-sound/patchage-1.0.0/NEEDED
media-sound/zita-ajbridge-0.6.0/NEEDED
net-libs/gnutls-3.5.18/NEEDED
net-libs/libproxy-0.4.13-r2/NEEDED
net-libs/libtorrent-0.13.6-r1/NEEDED
net-libs/nghttp2-1.31.1/NEEDED
net-mail/notmuch-0.26.1/NEEDED
net-misc/tigervnc-1.8.0-r2/NEEDED
net-nds/openldap-2.4.45/NEEDED
net-p2p/rtorrent-0.9.6-r1/NEEDED
net-print/cups-2.2.7/NEEDED
net-print/cups-filters-1.20.3/NEEDED
sci-physics/bullet-2.86/NEEDED
sys-apps/gptfdisk-1.0.3/NEEDED
sys-apps/groff-1.22.3/NEEDED
sys-apps/smartmontools-6.6/NEEDED
sys-block/thin-provisioning-tools-0.7.6/NEEDED
sys-devel/binutils-2.30-r2/NEEDED
sys-devel/clang-6.0.0-r1/NEEDED
sys-devel/gcc-5.4.0/NEEDED
sys-devel/gcc-7.3.0-r1/NEEDED
sys-devel/gettext-0.19.8.1/NEEDED
sys-devel/llvm-6.0.0-r1/NEEDED
sys-fs/ddrescue-1.23/NEEDED
sys-fs/extundelete-0.2.4/NEEDED
sys-libs/compiler-rt-sanitizers-4.0.1/NEEDED
sys-libs/compiler-rt-sanitizers-6.0.0/NEEDED
sys-libs/db-5.3.28-r3/NEEDED
sys-libs/db-6.0.35-r1/NEEDED
sys-libs/ncurses-6.1-r2/NEEDED
sys-power/powertop-2.9/NEEDED
www-client/firefox-52.7.4/NEEDED
x11-libs/flowcanvas-0.7.1-r2/NEEDED
x11-libs/fltk-1.3.4/NEEDED
x11-libs/vte-0.48.4/NEEDED
x11-misc/slim-1.3.6-r5/NEEDED
x11-misc/vdpauinfo-1.0/NEEDED
x11-wm/icewm-1.4.2/NEEDED


The same errors were still there, so I decided to merge JACK with the empty tree swicth: `emerge -ave media-sound/jack-audio-connection-kit'. More than 500 packages were rebuilded yesterday with this... even MySQL anted PostgreSQL were rebuild with this.


I still cannot connect no client to jack with failure to open socket:

Code:
Sun May 20 09:20:01 2018: New client 'playback_calp' with PID 28615
Sun May 20 09:20:01 2018: ERROR: Failed to find port 'playback_calp:capture_1' to destroy
Sun May 20 09:20:01 2018: ERROR: Failed to find port 'playback_calp:capture_2' to destroy
Sun May 20 09:20:01 2018: Client 'playback_calp' with PID 28615 is out

(WITH A SEGMENTATION FAULT)
May 20 10:35:42 localhost kernel: alsa_in[30147]: segfault at 7fc640bcb08e ip 00007fc63f758488 sp 00007fc63fe2ae20 error 4 in libjack.so.0.1.0[7fc63f73f000+3a000]


I got this error when trying to connect an ALSA loop device to JACK with alsa_in (a binary included in media-sound/jack-audio-connection-kit):
Code:
alsa_in -j playback_calp -d calp -q1 -v
WARNING: buffer size does not match: (requested 2048, got 12000)
WARNING: period size does not match: (requested 1024, got 6000)
selected sample format: 16bit
[1]    28615 segmentation fault  alsa_in -j playback_calp -d calp -q1 -v


When trying to test JACK with jack_test, I got:
Code:
ack_test -t 300 -v
Verbose mode is activated...
Jack server is said being in non-realtime mode...
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*--*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*--*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-* Start jack server stress test  *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*--*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*--*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Register a client using jack_client_open()...
trying to load the "inprocess" server internal client
"inprocess" server internal client loaded
jack_get_internal_client_name returns inprocess
jack_internal_client_handle returns correct handle
jack_internal_client_unload done first time returns correct value
jack_internal_client_unload done second time returns correct value
trying to register a new jackd client with name jack_test using jack_client_new()...
jack_client_new: deprecated
Client name = jack_test conflits with another running client
Cannot connect to the server
JackShmReadWritePtr1::~JackShmReadWritePtr1 - Init not done for -1, skipping unlock
valid : a second client with the same name cannot be registered
trying to register a new jackd client with name jack_test using jack_client_open()...
Cannot open shm segment /jack-1000-0 (No such file or directory)
Map shared memory segments exception
JackShmReadWritePtr1::~JackShmReadWritePtr1 - Init not done for 0, skipping unlock
!!! ERROR !!! Jackd server automatic renaming feature does not work!
trying to register a new jackd client with maximum possible client name size...
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA|" is too long to be used as a JACK client name.
Please use 63 characters or less
JackShmReadWritePtr1::~JackShmReadWritePtr1 - Init not done for -1, skipping unlock
!!! ERROR !!! opening a client with maximum possible client name size does not work!
Testing name... ok
!!! ERROR !!! Jackd is in a non-expected realtime mode (RT = 0).
Init callback has been successfully called from thread = 29cce700. (msg from callback)
Sample rate : 48000.
error : port_name is empty (msg from callback)
Can't register a port with a NULL portname... ok.
[1]    28502 segmentation fault  jack_test -t 300 -v

with the same segme,tation fault:
Code:
May 20 10:38:42 localhost kernel: jack_test[30190]: segfault at 7f2c2ac9c096 ip 00007f2c2983c465 sp 00007ffcbb734870 error 4 in libjack.so.0.1.0[7f2c2982d000+3a000]


And libjack.so has a very linkages:
Code:
ldd /usr/lib/libjack.so
   linux-vdso.so.1 (0x00007ffdbf8d3000)
   libpthread.so.0 => /lib64/libpthread.so.0 (0x00007faef37fa000)
   librt.so.1 => /lib64/librt.so.1 (0x00007faef35f1000)
   libdbus-1.so.3 => /usr/lib64/libdbus-1.so.3 (0x00007faef339c000)
   libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/libstdc++.so.6 (0x00007faef2f62000)
   libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/libgcc_s.so.1 (0x00007faef2d4b000)
   libc.so.6 => /lib64/libc.so.6 (0x00007faef297a000)
   /lib64/ld-linux-x86-64.so.2 (0x00007faef3c57000)
   libm.so.6 => /lib64/libm.so.6 (0x00007faef2636000)

basically sys-libs/glibc sys-devel/gcc:7.3.0 sys-apps/dbus which were always rebuilded with GCC-7.3.0 several times.

Remain only rebuilding the whole system with an `emerge -ave @world'.

Thanks for any input.

[Moderator edit: changed [quote] tags to [code] tags to preserve output layout. -Hu]
_________________
home/:mkinitramfs-ll/:supervision/:e-gtk-theme/:overlay/
Back to top
View user's profile Send private message
Dominique_71
Veteran
Veteran


Joined: 17 Aug 2005
Posts: 1869
Location: Switzerland (Romandie)

PostPosted: Wed May 23, 2018 10:36 am    Post subject: Reply with quote

Maybe you need to use a kernel which was compiled with the new gcc.
_________________
"Confirm You are a robot." - the singularity
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21490

PostPosted: Thu May 24, 2018 2:02 am    Post subject: Reply with quote

Dominique_71 wrote:
Maybe you need to use a kernel which was compiled with the new gcc.
Could you explain why you think this would be helpful? Generally, the gcc version used for the kernel and the gcc version used for user code do not need to be aligned. Barring bugs, any supported version of gcc should be usable for the kernel, independent of what is used to compile user code.
Back to top
View user's profile Send private message
Dominique_71
Veteran
Veteran


Joined: 17 Aug 2005
Posts: 1869
Location: Switzerland (Romandie)

PostPosted: Fri Jun 01, 2018 8:36 pm    Post subject: Reply with quote

I don't remember the details, but I was reading somewhere than different gcc versions can optimize the code in ways that can make softwares compiled by these different versions to not be 100 % compatible. As the ALSA driver is part of the kernel, it can be good to recompile the kernel even if you don't update it.
_________________
"Confirm You are a robot." - the singularity
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21490

PostPosted: Sat Jun 02, 2018 12:55 am    Post subject: Reply with quote

Citation needed for that claim. Standard-conforming C code built by a standard-conforming C compiler will have a consistent ABI, regardless of which standard-conforming compiler builds it. Now, it's possible that by rebuilding with a non-conforming compiler, the ABI could change. Non-conformance could come from passing options to disable standard conformance.

The kernel in particular is very careful to have a consistent ABI.
Back to top
View user's profile Send private message
tclover
Guru
Guru


Joined: 10 Apr 2011
Posts: 516

PostPosted: Sun Jun 10, 2018 9:58 am    Post subject: Reply with quote

I have almost completed an `emerge -e @world' successfully and then emerge died with less than 80 package to merge. `emerge -r' did not work and I had to finish with a `emerge @world'. So, a few package were not recompiled. The same issue mains. JACK segfault for simple operations like client connection to JACK server.
_________________
home/:mkinitramfs-ll/:supervision/:e-gtk-theme/:overlay/
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21490

PostPosted: Sun Jun 10, 2018 3:14 pm    Post subject: Reply with quote

What is the callstack when JACK segfaults? What are the values of the locals and arguments in the faulting frame? What is the faulting instruction?
Back to top
View user's profile Send private message
tclover
Guru
Guru


Joined: 10 Apr 2011
Posts: 516

PostPosted: Sun Jun 24, 2018 10:21 am    Post subject: Reply with quote

Hu wrote:
What is the callstack when JACK segfaults? What are the values of the locals and arguments in the faulting frame? What is the faulting instruction?


This what happen a client, alsa_out here, try to connect to JACK:

Code:
gdb -- alsa_out
---
(gdb) run -j playback_palp -d palp -q1
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /usr/bin/alsa_out -j playback_palp -d palp -q1
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7ffff7fb5700 (LWP 28469)]
[New Thread 0x7ffff7f34700 (LWP 28475)]
selected sample format: float
[New Thread 0x7ffff7eb3700 (LWP 28484)]

Thread 4 "alsa_out" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff7eb3700 (LWP 28484)]
Jack::JackClient::WaitSync (this=0x555555779df0) at ../common/JackClient.cpp:626
626   ../common/JackClient.cpp: No such file or directory.
---

../common/JackClient.cpp:

 623 inline bool JackClient::WaitSync()                                             
 624 {                                                                               
 625     // Suspend itself: wait on the input synchro                               
 626     if (GetGraphManager()->SuspendRefNum(GetClientControl(), fSynchroTable, 0x7FFFFFFF) < 0) {
 627         jack_error("SuspendRefNum error");                                     
 628         return false;                                                           
 629     } else {                                                                   
 630         return true;                                                           
 631     }                                                                           
 632

_________________
home/:mkinitramfs-ll/:supervision/:e-gtk-theme/:overlay/
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21490

PostPosted: Sun Jun 24, 2018 3:18 pm    Post subject: Reply with quote

As a first guess, GetGraphManager() returned an invalid pointer (probably null) and SuspendRefNum is not a non-virtual C++ member method (and thus needs a non-nullptr left-hand side[1]). If SuspendRefNum is a classic C function pointer, or is a virtual C++ method (which is usually implemented in a similar way), then the call would need to read from the pointer returned by GetGraphManager(). Register context (info registers) and disassembly around the fault site (disas) may confirm this theory. Even if confirmed, you then need to understand why an invalid pointer was returned.

[1] In some cases, code can work even when the left-hand side is nullptr, but this is bad practice. Never use a nullptr for this.
Back to top
View user's profile Send private message
tclover
Guru
Guru


Joined: 10 Apr 2011
Posts: 516

PostPosted: Sun Jun 24, 2018 4:22 pm    Post subject: Reply with quote

Hu wrote:
Even if confirmed, you then need to understand why an invalid pointer was returned.

I do not. There is an issue there, still waiting any response from upstream with that new data.
_________________
home/:mkinitramfs-ll/:supervision/:e-gtk-theme/:overlay/
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum