Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 823857 - www-client/chromium-96.0.4664.45: fails to build with glibc-2.34 using Clang (sandbox/linux/services/credentials.cc:103:16: error: variable-sized object may not be initialized)
Summary: www-client/chromium-96.0.4664.45: fails to build with glibc-2.34 using Clang ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Chromium Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: systemwide-clang glibc-2.34
  Show dependency tree
 
Reported: 2021-11-15 19:06 UTC by Patrick McLean
Modified: 2022-02-08 17:41 UTC (History)
3 users (show)

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


Attachments
build.log (build.log.zst,819.56 KB, application/zstd)
2021-11-15 19:10 UTC, Patrick McLean
Details
emerge --info www-client/chromium (emerge-info,7.09 KB, text/plain)
2021-11-15 19:10 UTC, Patrick McLean
Details
sandbox patch (chromium-sandbox-glibc-2.34.patch,717 bytes, patch)
2021-11-15 21:24 UTC, Stephan Hartmann (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick McLean gentoo-dev 2021-11-15 19:06:42 UTC
FAILED: obj/sandbox/linux/sandbox_services/credentials.o
clang++ -MMD -MF obj/sandbox/linux/sandbox_services/credentials.o.d -DSANDBOX_IMPLEMENTATION -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_OZONE=1 -DUSE_X11=1 -DOFFICIAL_BUILD -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DNDEBUG -DNVALGRIND -DDYNAM
IC_ANNOTATIONS_ENABLED=0 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_40 -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40 -I../.. -Igen -I../../third_party/perfetto/include -Igen/third_party/perfetto/build_config -Igen/third_party/perfetto -Igen/shim_headers/zlib_shim -Igen/shim_headers/icui18n_shim -Igen/shim_headers/icuuc_shim -I../../third_party/abseil-cpp -I../../t
hird_party/boringssl/src/include -I../../third_party/protobuf/src -Igen/protoc_out -fno-delete-null-pointer-checks -fno-ident -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants -no-canonical-prefixes -Wimplicit-fallthrough -Wunreachable-code-a
ggressive -Wthread-safety -Wextra-semi -Wno-missing-field-initializers -Wno-unused-parameter -Wloop-analysis -Wno-unneeded-internal-declaration -Wenum-compare-conditional -Wno-psabi -Wno-ignored-pragma-optimize -Wno-builtin-assume-aligned-alignment -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Wno-bitwise-instead-of-logical -fno-omit-frame-pointer -
ftrivial-auto-var-init=pattern -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/lib64/libffi/include -DPROTOBUF_ALLOW_DEPRECATED=1 -std=c++14 -fno-trigraphs -Wno-trigraphs -fno-exceptions -fno-rtti -fvisibility-inlines-hidden -march=znver3 -pipe -flax-vector-conver
sions=all -Wno-unknown-warning-option -c ../../sandbox/linux/services/credentials.cc -o obj/sandbox/linux/sandbox_services/credentials.o
../../sandbox/linux/services/credentials.cc:103:16: error: variable-sized object may not be initialized
  char tls_buf[PTHREAD_STACK_MIN] = {0};
               ^~~~~~~~~~~~~~~~~
/usr/include/bits/pthread_stack_min-dynamic.h:26:30: note: expanded from macro 'PTHREAD_STACK_MIN'
#   define PTHREAD_STACK_MIN __sysconf (__SC_THREAD_STACK_MIN_VALUE)
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Comment 1 Patrick McLean gentoo-dev 2021-11-15 19:10:00 UTC
Created attachment 751335 [details]
build.log

The build.log file (zstd compressed)
Comment 2 Patrick McLean gentoo-dev 2021-11-15 19:10:30 UTC
Created attachment 751338 [details]
emerge --info www-client/chromium

Emerge --info output
Comment 3 Marcin Deranek 2021-11-15 19:55:50 UTC
There was some discussion at https://forums.gentoo.org/viewtopic-p-8644495.html?sid=fe1f3342f2f1163902b0f11cd3f3f1b5
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-11-15 19:58:08 UTC
(In reply to Marcin Deranek from comment #3)
> There was some discussion at
> https://forums.gentoo.org/viewtopic-p-8644495.
> html?sid=fe1f3342f2f1163902b0f11cd3f3f1b5

THat's not the same error, AFAICT. That is bug 816699.
Comment 5 Marcin Deranek 2021-11-15 20:33:40 UTC
I would say 4th comment shows exactly the same error message (except line number which):

../../sandbox/linux/services/credentials.cc:101:16: error: variable-sized object may not be initialized
  char tls_buf[PTHREAD_STACK_MIN] = {0};
               ^~~~~~~~~~~~~~~~~
/usr/include/bits/pthread_stack_min-dynamic.h:26:30: note: expanded from macro 'PTHREAD_STACK_MIN'
#   define PTHREAD_STACK_MIN __sysconf (__SC_THREAD_STACK_MIN_VALUE)
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Comment 6 Stephan Hartmann (RETIRED) gentoo-dev 2021-11-15 21:24:10 UTC
Created attachment 751350 [details, diff]
sandbox patch

Can someone test attached patch (including runtime)?
Comment 7 Patrick McLean gentoo-dev 2021-11-16 00:49:16 UTC
(In reply to Stephan Hartmann from comment #6)
> Created attachment 751350 [details, diff] [details, diff]
> sandbox patch
> 
> Can someone test attached patch (including runtime)?

I can confirm that it does build and seems to be working fine with the patch.
Comment 8 Stephan Hartmann (RETIRED) gentoo-dev 2021-11-16 11:31:56 UTC
Thanks for feedback. However, the patch is more or less a hack, because variable-length-array is a C99 feature and not allowed in C++. clang and GCC have an extension to support it.
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-11-16 11:50:49 UTC
Still no idea why/how I didn't hit this (with GCC). Also note that Fedora is patching a different file but not this one? https://src.fedoraproject.org/rpms/chromium/blob/rawhide/f/chromium-88.0.4324.182-rawhide-gcc-std-max-fix.patch
Comment 10 Stephan Hartmann (RETIRED) gentoo-dev 2021-11-16 11:55:16 UTC
I (In reply to Sam James from comment #9)
> Still no idea why/how I didn't hit this (with GCC). Also note that Fedora is
> patching a different file but not this one?
> https://src.fedoraproject.org/rpms/chromium/blob/rawhide/f/chromium-88.0.
> 4324.182-rawhide-gcc-std-max-fix.patch

Maybe a GCC extension.

Another option would be to use something like Firefox. On x86_64 PTHREAD_STACK_MIN is 16384. Firefox added a constant which is either PTHREAD_STACK_MIN or at least 32KiB. But I don't know if this is sufficient and the later used clone() has no way to tell the kernel the allocated stack size.
Comment 11 Larry the Git Cow gentoo-dev 2021-11-20 10:08:38 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2415a3c94f322bf84d310cf985b6e6081683ff92

commit 2415a3c94f322bf84d310cf985b6e6081683ff92
Author:     Stephan Hartmann <sultan@gentoo.org>
AuthorDate: 2021-11-20 10:08:00 +0000
Commit:     Stephan Hartmann <sultan@gentoo.org>
CommitDate: 2021-11-20 10:08:00 +0000

    www-client/chromium: add workaround for sandbox with glibc-2.34
    
    Bug: https://bugs.gentoo.org/823857
    Package-Manager: Portage-3.0.28, Repoman-3.0.3
    Signed-off-by: Stephan Hartmann <sultan@gentoo.org>

 .../chromium/files/chromium-glibc-2.34.patch       | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
Comment 12 Manuel Nickschas 2021-11-25 16:33:28 UTC
FWIW, I'm hitting the same issue with dev-qt/qtwebengine-5.15.2_p20211019...
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-11-26 02:33:53 UTC
(In reply to Manuel Nickschas from comment #12)
> FWIW, I'm hitting the same issue with dev-qt/qtwebengine-5.15.2_p20211019...

Please do file a new bug for things like this and reference this one.
Comment 14 Stephan Hartmann (RETIRED) gentoo-dev 2022-02-08 17:41:47 UTC
Patch was merged upstream: https://crrev.com/c/3436947