Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 933603 - kde-apps/libkgapi-23.08.5-r1 test fail SEGFAULT when LTO is enabled(NO LTO warning!!!)
Summary: kde-apps/libkgapi-23.08.5-r1 test fail SEGFAULT when LTO is enabled(NO LTO w...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo KDE team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: lto
  Show dependency tree
 
Reported: 2024-06-05 10:39 UTC by Arniii
Modified: 2024-07-13 19:12 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
libkgapi_build.log.lz (libkgapi_build.log.lz,21.59 KB, application/x-lzip)
2024-06-05 10:41 UTC, Arniii
Details
environment // profile default/linux/amd64/17.1/desktop/plasma gcc-13 O3 pipe march=native(verbose) lto graphite ggdb3 (file_933603.txt,116.90 KB, text/plain)
2024-06-05 10:41 UTC, Arniii
Details
/var/tmp/portage/kde-apps/libkgapi-23.08.5-r1/work/libkgapi-23.08.5_build/Testing/Temporary/LastTest.log (file_933603.txt,51.63 KB, text/plain)
2024-06-05 10:42 UTC, Arniii
Details
my attempts to backtrace (file_933603.txt,10.41 KB, text/plain)
2024-06-05 10:44 UTC, Arniii
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Arniii 2024-06-05 10:39:31 UTC
from build log:
```
The following tests FAILED:
         22 - drive-aboutfetchjobtest (SEGFAULT)
         23 - drive-changefetchjobtest (SEGFAULT)
         24 - drive-filecopyjobtest (SEGFAULT)
         25 - drive-filecreatejobtest (SEGFAULT)
         26 - drive-filesearchquerytest (SEGFAULT)
         27 - drive-drivescreatejobtest (SEGFAULT)
         28 - drive-drivesdeletejobtest (SEGFAULT)
         29 - drive-drivesmodifyjobtest (SEGFAULT)
         30 - drive-driveshidejobtest (SEGFAULT)
         31 - drive-drivesfetchjobtest (SEGFAULT)
         32 - drive-drivessearchquerytest (SEGFAULT)
         33 - drive-teamdrivecreatejobtest (SEGFAULT)
         34 - drive-teamdrivedeletejobtest (SEGFAULT)
         35 - drive-teamdrivemodifyjobtest (SEGFAULT)
         36 - drive-teamdrivefetchjobtest (SEGFAULT)
         37 - drive-teamdrivesearchquerytest (SEGFAULT)
Errors while running CTest
Output from these tests are in: /var/tmp/portage/kde-apps/libkgapi-23.08.5-r1/work/libkgapi-23.08.5_build/Testing/Temporary/LastTest.log
```
Comment 1 Arniii 2024-06-05 10:41:10 UTC
Created attachment 895150 [details]
libkgapi_build.log.lz
Comment 2 Arniii 2024-06-05 10:41:52 UTC
Created attachment 895151 [details]
environment // profile default/linux/amd64/17.1/desktop/plasma gcc-13 O3 pipe march=native(verbose) lto graphite ggdb3
Comment 3 Arniii 2024-06-05 10:42:20 UTC
Created attachment 895152 [details]
/var/tmp/portage/kde-apps/libkgapi-23.08.5-r1/work/libkgapi-23.08.5_build/Testing/Temporary/LastTest.log
Comment 4 Arniii 2024-06-05 10:44:04 UTC
Created attachment 895153 [details]
my attempts to backtrace

usually backtrace looks like this: 
```
(gdb) bt
#0  QtPrivate::RefCount::ref (this=0x0) at /usr/include/qt5/QtCore/qrefcount.h:55
#1  0x00007ffff7f55b18 in _sub_I_65535_0.0 () from /var/tmp/portage/kde-apps/libkgapi-23.08.5-r1/work/libkgapi-23.08.5_build/bin/libKPim5GAPIDrive.so.5
#2  0x00007ffff7fcd5ee in call_init (l=<optimized out>, argc=argc@entry=1, argv=argv@entry=0x7fffffffdb38, env=env@entry=0x7fffffffdb48) at dl-init.c:74
#3  0x00007ffff7fcd6db in call_init (env=0x7fffffffdb48, argv=0x7fffffffdb38, argc=1, l=<optimized out>) at dl-init.c:120
#4  _dl_init (main_map=0x7ffff7ffe2e0, argc=1, argv=0x7fffffffdb38, env=0x7fffffffdb48) at dl-init.c:121
#5  0x00007ffff7fe5020 in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#6  0x0000000000000001 in ?? ()
#7  0x00007fffffffdf5c in ?? ()
#8  0x0000000000000000 in ?? ()
```
Comment 5 Andreas Sturmlechner gentoo-dev 2024-06-06 20:29:35 UTC
Reproducibly without lto or graphite...?
Comment 6 Arniii 2024-06-06 21:20:20 UTC
iteration 1:  IT HAPPENS when -O0 -march=native(verbosely) LTO graphite ggdb3 -frecord-gcc-switches(gentoo testing related)
```
  MARCH_NATIVE_GCC="-march=alderlake -mabm -mno-cldemote -mno-kl -mno-pconfig -mno-sgx -mno-widekl -mshstk --param=l1-cache-line-size=64 --param=l1-cache-size=48 --param=l2-cache-size=30720"

  LTO_WARNINGS_GCC="-Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
  LTO_FLAGS_GCC="-flto ${LTO_WARNINGS_GCC}"

  GCC_POLLY="-fgraphite-identity -floop-interchange -floop-strip-mine -floop-nest-optimize"

  DEBUG_FLAGS_GCC="-ggdb3"

  BECAUSE_PACKAGE_TESTING_WIKI_CF="-frecord-gcc-switches"
  BECAUSE_PACKAGE_TESTING_WIKI_LDF="-Wl,--defsym=__gentoo_check_ldflags__=0"

  COMMON_FLAGS="-O0 -pipe ${MARCH_NATIVE_GCC} ${GCC_POLLY} ${LTO_FLAGS_GCC} ${DEBUG_FLAGS_GCC} ${BECAUSE_PACKAGE_TESTING_WIKI_CF}"
  CFLAGS="${COMMON_FLAGS}"
  CXXFLAGS="${COMMON_FLAGS}"
  FCFLAGS="${COMMON_FLAGS}"
  FFLAGS="${COMMON_FLAGS}"

  LDFLAGS="${LDFLAGS} ${BECAUSE_PACKAGE_TESTING_WIKI_LDF}"
```
Comment 7 Arniii 2024-06-06 21:38:33 UTC
iteration 2: it doesn't happen when only -O0 -pipe -ggdb3 -frecord-gcc-switches
Comment 8 Arniii 2024-06-06 21:48:03 UTC
iteration 3: it doesn't happen when -O0 -ggdb3 -pipe + graphite_flags + -frecord-gcc-switches

```
  GCC_POLLY="-fgraphite-identity -floop-interchange -floop-strip-mine -floop-nest-optimize"

  DEBUG_FLAGS_GCC="-ggdb3"

  BECAUSE_PACKAGE_TESTING_WIKI_CF="-frecord-gcc-switches"
  BECAUSE_PACKAGE_TESTING_WIKI_LDF="-Wl,--defsym=__gentoo_check_ldflags__=0"

  COMMON_FLAGS="-O0 -pipe ${DEBUG_FLAGS_GCC} ${GCC_POLLY} ${BECAUSE_PACKAGE_TESTING_WIKI_CF}"
  CFLAGS="${COMMON_FLAGS}"
  CXXFLAGS="${COMMON_FLAGS}"
  FCFLAGS="${COMMON_FLAGS}"
  FFLAGS="${COMMON_FLAGS}"

  LDFLAGS="${LDFLAGS} ${BECAUSE_PACKAGE_TESTING_WIKI_LDF}"
```
Comment 9 Arniii 2024-06-06 21:59:22 UTC
Iteration 4: IT HAPPENS when (iteration 3 + LTO)
```
  LTO_WARNINGS_GCC="-Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
  LTO_FLAGS_GCC="-flto ${LTO_WARNINGS_GCC}"

  GCC_POLLY="-fgraphite-identity -floop-interchange -floop-strip-mine -floop-nest-optimize"

  DEBUG_FLAGS_GCC="-ggdb3"

  BECAUSE_PACKAGE_TESTING_WIKI_CF="-frecord-gcc-switches"
  BECAUSE_PACKAGE_TESTING_WIKI_LDF="-Wl,--defsym=__gentoo_check_ldflags__=0"

  COMMON_FLAGS="-O0 -pipe ${DEBUG_FLAGS_GCC} ${GCC_POLLY} ${LTO_FLAGS_GCC} ${BECAUSE_PACKAGE_TESTING_WIKI_CF}"
  CFLAGS="${COMMON_FLAGS}"
  CXXFLAGS="${COMMON_FLAGS}"
  FCFLAGS="${COMMON_FLAGS}"
  FFLAGS="${COMMON_FLAGS}"

  LDFLAGS="${LDFLAGS} ${BECAUSE_PACKAGE_TESTING_WIKI_LDF}"


```
Comment 10 Arniii 2024-06-06 22:02:13 UTC
Iteration 5: IT HAPPENS when (iteration 2 + LTO)
```
  LTO_WARNINGS_GCC="-Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
  LTO_FLAGS_GCC="-flto ${LTO_WARNINGS_GCC}"

  DEBUG_FLAGS_GCC="-ggdb3"

  BECAUSE_PACKAGE_TESTING_WIKI_CF="-frecord-gcc-switches"
  BECAUSE_PACKAGE_TESTING_WIKI_LDF="-Wl,--defsym=__gentoo_check_ldflags__=0"

  COMMON_FLAGS="-O0 -pipe ${DEBUG_FLAGS_GCC} ${LTO_FLAGS_GCC} ${BECAUSE_PACKAGE_TESTING_WIKI_CF}"
  CFLAGS="${COMMON_FLAGS}"
  CXXFLAGS="${COMMON_FLAGS}"
  FCFLAGS="${COMMON_FLAGS}"
  FFLAGS="${COMMON_FLAGS}"

  LDFLAGS="${LDFLAGS} ${BECAUSE_PACKAGE_TESTING_WIKI_LDF}"

```
Comment 11 Arniii 2024-06-06 22:03:06 UTC
I assume it happens when LTO is enabled.

Though LTO-related warnings are not triggered, that's interesting.
Comment 12 Arniii 2024-06-06 22:09:11 UTC
iteration 6: it doesn't happen when used my usual flags (-O3 -march=native(verbose) -ggdb3 +graphite +testing_related +lto ) with no LTO .
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-07-13 19:12:19 UTC
For 24.05.2, the tests pass for me with -O3 -march=native -mtls-dialect=gnu2 -flto=jobserver -fno-semantic-interposition wnt the -Werror=* flags as usual for LTO.

Please try the latest version. If that fails, try narrow it down in a clean chroot.