Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 918616

Summary: media-libs/opencv-4.8.1 failed to emerge - Segmentation fault
Product: Gentoo Linux Reporter: Leonid Kopylov <leonchik1976>
Component: Current packagesAssignee: Paul Zander <negril.nx+gentoo>
Status: RESOLVED WORKSFORME    
Severity: normal CC: proxy-maint, sam
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=918607
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log

Description Leonid Kopylov 2023-11-26 19:07:03 UTC
# emerge -pqv '=media-libs/opencv-4.8.1::gentoo'
[ebuild  N    ] media-libs/opencv-4.8.1  USE="download eigen features2d ffmpeg gstreamer java jpeg opencl opengl openmp png python qt5 qt6 threads tiff v4l vaapi webp -contrib -contribcvv -contribdnn -contribfreetype -contribhdf (-contribovis) -contribsfm -contribxfeatures2d -cuda -debug -dnnsamples -examples -gdal -gflags -glog -gphoto2 -gtk3 -ieee1394 -jpeg2k -lapack -lto -opencvapps -openexr -tesseract -testprograms -vtk -xine" ABI_X86="32 (64) (-x32)" CPU_FLAGS_X86="avx avx2 f16c fma3 popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3 -avx512f" PYTHON_TARGETS="python3_11 -python3_10"

# emerge --info '=media-libs/opencv-4.8.1::gentoo'
Portage 3.0.55 (python 3.12.0-final-0, default/linux/amd64/17.1/systemd/merged-usr, gcc-13, glibc-2.38-r7, 6.6.2-gentoo-amd64 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-6.6.2-gentoo-amd64-x86_64-13th_Gen_Intel-R-_Core-TM-_i7-1360P-with-glibc2.38
KiB Mem:    65397708 total,  40514544 free
KiB Swap:    8388604 total,   8388604 free
Timestamp of repository gentoo: Sun, 26 Nov 2023 11:30:01 +0000
Head commit of repository gentoo: 82b1d9b8f7dcfb0d00af40cc8c99d4480b089a85
sh bash 5.2_p21
ld GNU ld (Gentoo 2.41 p2) 2.41.0
ccache version 4.8.3 [enabled]
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p21::gentoo
dev-java/java-config:      2.3.3-r1::gentoo
dev-lang/perl:             5.38.0-r1::gentoo
dev-lang/python:           3.11.6::gentoo, 3.12.0_p1::gentoo
dev-lang/rust:             1.73.0::gentoo
dev-lang/rust-bin:         1.73.0::gentoo
dev-util/ccache:           4.8.3::gentoo
dev-util/cmake:            3.27.8::gentoo
dev-util/meson:            1.3.0::gentoo
sys-apps/baselayout:       2.14-r1::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-apps/systemd:          254.6::gentoo
sys-devel/autoconf:        2.71-r7::gentoo
sys-devel/automake:        1.16.5-r1::gentoo
sys-devel/binutils:        2.41-r2::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           15.0.7-r3::gentoo, 16.0.6::gentoo, 17.0.5::gentoo
sys-devel/gcc:             12.3.1_p20230825::gentoo, 13.2.1_p20231014::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/llvm:            14.0.6-r4::gentoo, 15.0.7-r3::gentoo, 16.0.6::gentoo, 17.0.5::gentoo
sys-devel/make:            4.4.1-r1::gentoo
sys-kernel/linux-headers:  6.6::gentoo (virtual/os-headers)
sys-libs/glibc:            2.38-r7::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://gentoo.kopylovs.net/gentoo-portage
    priority: -1000
    volatile: False
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts:

Binary Repositories:

gentoobinhost
    priority: 1
    sync-uri: https://gentoo.osuosl.org/releases/amd64/binpackages/17.1/x86-64

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA android AnyDesk-TOS geekbench google-chrome Intel-SDP microsoft-edge Microsoft-vscode OPERA-2018 PUEL-11 RAR TeamViewer Vivaldi"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php8.2/ext-active/ /etc/php/cgi-php8.2/ext-active/ /etc/php/cli-php8.2/ext-active/ /etc/php/fpm-php8.2/ext-active/ /etc/php/phpdbg-php8.2/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live ccache config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict strict-keepdir unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync warn-on-large-env xattr"
FFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
GENTOO_MIRRORS="https://mirror.isoc.org.il/pub/gentoo/ https://mirror.eu.oneandone.net/linux/distributions/gentoo/gentoo/"
LANG="en_US.utf8"
LC_ALL="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
MAKEOPTS="-j10"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/bash"
USE="X a52 aac accessibility acl alsa amd64 audit bash-completion berkdb bidi bluetooth branding brotli btrfs bzip2 cairo cdda cgi cli colord crypt cryptsetup cups curl dbus designer device-mapper doc dri drm dts dvd egl emacs encode evdev examples exif experimental ffmpeg flac fortran fuse gamepad gdbm gif git gles2 gmp gnome gnome-keyring gnutls go gpg gpm gstreamer gtk gtk-doc gui heif hscolour html http ibus iconv icu idn introspection iodbc ios ipv6 jack java jemalloc joystick jpeg json kde kerberos keyring lcms ldap libnotify libtirpc lm-sensors lua lvm lz4 lzma lzo mad man mbedtls mng mongodb mp3 mpeg mpi multilib multimedia mysql nas ncurses netlink network nfs nls nptl nss odbc offensive ogg opencl opengl openmp openssl pam pango pcap pcre pdf perl pkcs11 plasma plugins png policykit postgres pulseaudio python qml qt5 qt6 readline redis samba sasl screencast sdl seccomp semantic-desktop snmp sound source speech spell sqlite ssl svg symlink systemd tcl telemetry test-rust text threads tiff tk tools tpm truetype udev unicode unwind upnp upower usb utils v4l vaapi vala vim-syntax vnc vorbis vulkan wayland webengine webkit webp wifi wxwidgets x264 xattr xft xinerama xml xv xvid yaml zeroconf zfs zip zlib zsh-completion zstd" ABI_X86="64 32" ADA_TARGET="gnat_2021" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets stage words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="evdev joystick libinput" KERNEL="linux" L10N="en en-US he ru" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="nlpsolver scripting-beanshell scripting-javascript wiki-publisher" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-1" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_12" PYTHON_TARGETS="python3_11 python3_12" RUBY_TARGETS="ruby31 ruby32" VIDEO_CARDS="intel fbdev vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 Leonid Kopylov 2023-11-26 19:07:14 UTC
Created attachment 875735 [details]
build.log
Comment 2 Paul Zander 2023-11-26 19:56:18 UTC
Could you retest with USE="-download"? It's a bit odd that cmake segfaults.
Comment 3 Leonid Kopylov 2023-11-26 19:57:13 UTC
(In reply to Paul Zander from comment #2)
> Could you retest with USE="-download"? It's a bit odd that cmake segfaults.

yes, with USE=-download it builds
Comment 4 Paul Zander 2023-11-26 20:14:37 UTC
Could you try FEATURES="-network-sandbox" USE=download next?
Comment 5 Leonid Kopylov 2023-11-26 20:17:05 UTC
(In reply to Paul Zander from comment #4)
> Could you try FEATURES="-network-sandbox" USE=download next?

same error:

-- Found Protobuf: /usr/bin/protoc-23.3.0 (found version "23.3.0")
-- ADE: Downloading v0.1.2a.zip from https://github.com/opencv/ade/archive/v0.1.2a.zip
/var/tmp/portage/media-libs/opencv-4.8.1/temp/environment: line 1454:   208 Segmentation fault      (core dumped) "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}"
 * ERROR: media-libs/opencv-4.8.1::gentoo failed (configure phase):
 *   cmake failed
Comment 6 Paul Zander 2023-11-26 20:18:41 UTC
Last question, does plain `curl https://github.com/opencv/ade/archive/v0.1.2a.zip` work on your test system?
Comment 7 Leonid Kopylov 2023-11-26 20:20:55 UTC
(In reply to Paul Zander from comment #6)
> Last question, does plain `curl
> https://github.com/opencv/ade/archive/v0.1.2a.zip` work on your test system?

# curl https://github.com/opencv/ade/archive/v0.1.2a.zip
Segmentation fault (core dumped)


and i see the same on all my 3 intel-based machines
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-11-26 20:21:22 UTC
(In reply to Leonid Kopylov from comment #7)
> (In reply to Paul Zander from comment #6)
> > Last question, does plain `curl
> > https://github.com/opencv/ade/archive/v0.1.2a.zip` work on your test system?
> 
> # curl https://github.com/opencv/ade/archive/v0.1.2a.zip
> Segmentation fault (core dumped)
> 
> 
> and i see the same on all my 3 intel-based machines

Could you run it under gdb? (see https://wiki.gentoo.org/wiki/Debugging#Per-package first to get debug symbols for curl + c-ares + glibc).
Comment 9 Leonid Kopylov 2023-11-26 20:27:47 UTC
(In reply to Sam James from comment #8)
> (In reply to Leonid Kopylov from comment #7)
> > (In reply to Paul Zander from comment #6)
> > > Last question, does plain `curl
> > > https://github.com/opencv/ade/archive/v0.1.2a.zip` work on your test system?
> > 
> > # curl https://github.com/opencv/ade/archive/v0.1.2a.zip
> > Segmentation fault (core dumped)
> > 
> > 
> > and i see the same on all my 3 intel-based machines
> 
> Could you run it under gdb? (see
> https://wiki.gentoo.org/wiki/Debugging#Per-package first to get debug
> symbols for curl + c-ares + glibc).

# curl
Segmentation fault (core dumped)

# gdb curl
GNU gdb (Gentoo 13.2 vanilla) 13.2
Copyright (C) 2023 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-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
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 curl...
Reading symbols from /usr/lib/debug//usr/bin/curl.debug...
(gdb) run
Starting program: /usr/bin/curl
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib64/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7d4926c in pthread_mutex_init () from /usr/lib64/libc.so.6
(gdb)
Comment 10 Paul Zander 2023-11-26 20:28:39 UTC
You want to run bt in gdb.
Comment 11 Leonid Kopylov 2023-11-26 20:29:15 UTC
(In reply to Paul Zander from comment #10)
> You want to run bt in gdb.

(gdb) bt
#0  0x00007ffff7d4926c in pthread_mutex_init () from /usr/lib64/libc.so.6
#1  0x00007ffff77ef0c0 in ?? () from /usr/lib64/libmbedcrypto.so.7
#2  0x00007ffff77c9d0a in mbedtls_entropy_init () from /usr/lib64/libmbedcrypto.so.7
#3  0x00007ffff7b00f6c in ?? () from /usr/lib64/libssh2.so.1
#4  0x00007ffff7b028b9 in libssh2_init () from /usr/lib64/libssh2.so.1
#5  0x00007ffff7f4725b in Curl_ssh_init () at /var/tmp/portage/net-misc/curl-8.4.0/work/curl-8.4.0/lib/vssh/libssh2.c:3791
#6  0x00007ffff7ed67f6 in global_init (flags=<optimized out>, memoryfuncs=memoryfuncs@entry=true) at /var/tmp/portage/net-misc/curl-8.4.0/work/curl-8.4.0/lib/easy.c:192
#7  0x00007ffff7ed69aa in curl_global_init (flags=flags@entry=3) at /var/tmp/portage/net-misc/curl-8.4.0/work/curl-8.4.0/lib/easy.c:229
#8  0x000055555555f9ae in main_init (config=0x7fffffffdc70) at /var/tmp/portage/net-misc/curl-8.4.0/work/curl-8.4.0/src/tool_main.c:161
#9  main (argc=1, argv=0x7fffffffde28) at /var/tmp/portage/net-misc/curl-8.4.0/work/curl-8.4.0/src/tool_main.c:269
(gdb)
Comment 12 Paul Zander 2023-11-26 20:30:24 UTC
can you show the output of `emerge -pv curl` please.
Comment 13 Leonid Kopylov 2023-11-26 20:31:12 UTC
(In reply to Paul Zander from comment #12)
> can you show the output of `emerge -pv curl` please.

# emerge -pv curl

These are the packages that would be merged, in order:

Calculating dependencies... done!
Dependency resolution took 1.30 s (backtrack: 0/20).

[ebuild   R    ] net-misc/curl-8.4.0::gentoo  USE="adns alt-svc brotli ftp gnutls gopher hsts http2 idn imap kerberos ldap mbedtls openssl pop3 progress-meter rtmp rustls samba smtp ssh ssl telnet tftp websockets zstd -nghttp3 (-sslv3) -static-libs -test -verify-sig" ABI_X86="32 (64) (-x32)" CURL_SSL="openssl -gnutls -mbedtls -rustls" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB
Comment 14 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-11-26 20:33:03 UTC
did you definitely build glibc with debug symbols?

please also do net-libs/libssh2 and net-libs/mbedtls, thanks
Comment 15 Leonid Kopylov 2023-11-26 20:53:44 UTC
(In reply to Sam James from comment #14)
> did you definitely build glibc with debug symbols?
> 
> please also do net-libs/libssh2 and net-libs/mbedtls, thanks

hm, after rebuilding all those packages - curl started to work.
on my other 2 machines - rebuilding one by one - seems net-libs/libssh2 was that caused the issue. 
also media-gfx/libimagequant (https://bugs.gentoo.org/918607) was built successfully.
Comment 16 Leonid Kopylov 2023-11-26 21:10:12 UTC
after rebuilding net-libs/libssh2, "curl" now works - so i believe this bug can be closed