Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 786444 - dev-cpp/gstreamermm-1.10.0 - /.../gatomic.h: error: argument 2 of _atomic_load must not be a pointer to a volatile type
Summary: dev-cpp/gstreamermm-1.10.0 - /.../gatomic.h: error: argument 2 of _atomic_loa...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: gcc-11
  Show dependency tree
 
Reported: 2021-04-28 13:13 UTC by Toralf Förster
Modified: 2021-08-04 22:28 UTC (History)
1 user (show)

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


Attachments
emerge-info.txt (emerge-info.txt,17.83 KB, text/plain)
2021-04-28 13:13 UTC, Toralf Förster
Details
dev-cpp:gstreamermm-1.10.0:20210428-085130.log (dev-cpp:gstreamermm-1.10.0:20210428-085130.log,201.82 KB, text/plain)
2021-04-28 13:13 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,279.39 KB, text/plain)
2021-04-28 13:13 UTC, Toralf Förster
Details
environment (environment,118.42 KB, text/plain)
2021-04-28 13:13 UTC, Toralf Förster
Details
etc.portage.tar.bz2 (etc.portage.tar.bz2,20.81 KB, application/x-bzip)
2021-04-28 13:13 UTC, Toralf Förster
Details
logs.tar.bz2 (logs.tar.bz2,9.94 KB, application/x-bzip)
2021-04-28 13:13 UTC, Toralf Förster
Details
temp.tar.bz2 (temp.tar.bz2,35.67 KB, application/x-bzip)
2021-04-28 13:13 UTC, Toralf Förster
Details
gstreamermm-1.10.0-no-volatile.patch (gstreamermm-1.10.0-no-volatile.patch,856 bytes, patch)
2021-05-25 15:17 UTC, Andrew Savchenko
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2021-04-28 13:13:37 UTC
                 from all_media_player/main.cc:8:
../gstreamer/gstreamermm/register.h: In function ‘GType Gst::register_mm_type(const gchar*)’:
/usr/include/glib-2.0/glib/gatomic.h:117:19: error: argument 2 of ‘__atomic_load’ must not be a pointer to a ‘volatile’ type
  117 |     __atomic_load (gapg_temp_atomic, &gapg_temp_newval, __ATOMIC_SEQ_CST); \
      |     ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gthread.h:260:7: note: in expansion of macro ‘g_atomic_pointer_get’
  260 |     (!g_atomic_pointer_get (location) &&                             \

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.1_desktop_plasma_systemd-20210421-084009

  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-8.3.1
 [2] x86_64-pc-linux-gnu-10.3.0
 [3] x86_64-pc-linux-gnu-11.1.0 *
clang version 12.0.0
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/12/bin
/usr/lib/llvm/12
12.0.0
Python 3.8.9
Available Ruby profiles:
  [1]   ruby26 (with Rubygems)
  [2]   ruby30 (with Rubygems) *
Available Rust versions:
  [1]   rust-bin-1.51.0 *
The following VMs are available for generation-2:
*)	AdoptOpenJDK 8.292_p10 [openjdk-bin-8]
Available Java Virtual Machines:
  [1]   openjdk-bin-8  system-vm

The Glorious Glasgow Haskell Compilation System, version 8.10.4

  timestamp(s) of HEAD at this tinderbox image:
/var/db/repos/gentoo	Wed Apr 28 08:35:16 UTC 2021

emerge -qpvO dev-cpp/gstreamermm
[ebuild  N    ] dev-cpp/gstreamermm-1.10.0  USE="-doc -examples -test"
Comment 1 Toralf Förster gentoo-dev 2021-04-28 13:13:38 UTC
Created attachment 703218 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2021-04-28 13:13:40 UTC
Created attachment 703221 [details]
dev-cpp:gstreamermm-1.10.0:20210428-085130.log
Comment 3 Toralf Förster gentoo-dev 2021-04-28 13:13:42 UTC
Created attachment 703224 [details]
emerge-history.txt
Comment 4 Toralf Förster gentoo-dev 2021-04-28 13:13:43 UTC
Created attachment 703227 [details]
environment
Comment 5 Toralf Förster gentoo-dev 2021-04-28 13:13:44 UTC
Created attachment 703230 [details]
etc.portage.tar.bz2
Comment 6 Toralf Förster gentoo-dev 2021-04-28 13:13:45 UTC
Created attachment 703233 [details]
logs.tar.bz2
Comment 7 Toralf Förster gentoo-dev 2021-04-28 13:13:47 UTC
Created attachment 703236 [details]
temp.tar.bz2
Comment 8 Andrew Savchenko gentoo-dev 2021-05-25 12:26:54 UTC
Looks like there are two issues here:

1. Examples fail to build
2. Examples are always (attempted to) build, even with USE="-examples".

The second issue is addressed in the bug 791958 and proposed patch allows to build gstreamermm without examples as a workaround of current problem.
Comment 9 Andrew Savchenko gentoo-dev 2021-05-25 14:32:28 UTC
While gstreamermm can be built without examples, it is still broken:

$ cat gstreamermm-test.c
#include <gstreamermm.h>

int main()
{
    return 0;
}

$ g++ $(pkg-config --cflags gstreamermm-1.0) -c gstreamermm-test.c                                                                         In file included from /usr/include/glib-2.0/glib/gthread.h:32,
                 from /usr/include/glib-2.0/glib/gasyncqueue.h:32,
                 from /usr/include/glib-2.0/glib.h:32,
                 from /usr/include/glibmm-2.4/glibmm/threads.h:30,
                 from /usr/include/gstreamermm-1.0/gstreamermm/check.h:11,
                 from /usr/include/gstreamermm-1.0/gstreamermm.h:63,
                 from gstreamermm-test.c:1:
/usr/include/gstreamermm-1.0/gstreamermm/register.h: In function ‘GType Gst::register_mm_type(const gchar*)’:
/usr/include/glib-2.0/glib/gatomic.h:117:19: error: argument 2 of ‘__atomic_load’ must not be a pointer to a ‘volatile’ type
  117 |     __atomic_load (gapg_temp_atomic, &gapg_temp_newval, __ATOMIC_SEQ_CST); \
      |     ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gthread.h:260:7: note: in expansion of macro ‘g_atomic_pointer_get’
  260 |     (!g_atomic_pointer_get (location) &&                             \
      |       ^~~~~~~~~~~~~~~~~~~~
/usr/include/gstreamermm-1.0/gstreamermm/register.h:114:9: note: in expansion of macro ‘g_once_init_enter’
  114 |     if (g_once_init_enter (&gonce_data)) {
      |         ^~~~~~~~~~~~~~~~~

$ pkg-config --cflags gstreamermm-1.0
-pthread -I/usr/include/gstreamermm-1.0 -I/usr/lib/gstreamermm-1.0/include -I/usr/include/giomm-2.4 -I/usr/lib/giomm-2.4/include -I/usr/include/glibmm-2.4 -I/usr/lib/glibmm-2.4/include -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include -I/usr/include/gstreamer-1.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/gstreamer-1.0 -I/usr/lib/libffi/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include

So, the whole gstreamermm seems to be broken…
Comment 10 Andrew Savchenko gentoo-dev 2021-05-25 15:17:48 UTC
Created attachment 711162 [details, diff]
gstreamermm-1.10.0-no-volatile.patch

There is indeed an error in the /usr/include/gstreamermm-1.0/gstreamermm/register.h: it declares gsize gonce_data as volatile, while it should not:
https://developer.gnome.org/glib/stable/glib-Threads.html#g-once-init-enter

"While location has a volatile qualifier, this is a historical
artifact and the pointer passed to it should not be volatile."

Now both examples and test above builds fine.

Gnome team, are you OK with this patch?
Please also see bug 791958.
Comment 11 Matt Turner gentoo-dev 2021-06-01 02:19:17 UTC
(In reply to Andrew Savchenko from comment #10)
> Created attachment 711162 [details, diff] [details, diff]
> gstreamermm-1.10.0-no-volatile.patch
> 
> There is indeed an error in the
> /usr/include/gstreamermm-1.0/gstreamermm/register.h: it declares gsize
> gonce_data as volatile, while it should not:
> https://developer.gnome.org/glib/stable/glib-Threads.html#g-once-init-enter
> 
> "While location has a volatile qualifier, this is a historical
> artifact and the pointer passed to it should not be volatile."
> 
> Now both examples and test above builds fine.
> 
> Gnome team, are you OK with this patch?
> Please also see bug 791958.

Could you open a merge request upstream at https://gitlab.gnome.org/GNOME/gstreamermm ?

I see another merge request that fixes a double free() that seems like it should be accepted. Perhaps leio has the permissions to merge and make a release for us.
Comment 12 Larry the Git Cow gentoo-dev 2021-08-04 22:28:16 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=139cd7a38152835009c149085aad04e53ddc4e1c

commit 139cd7a38152835009c149085aad04e53ddc4e1c
Author:     Matt Turner <mattst88@gentoo.org>
AuthorDate: 2021-08-04 22:25:36 +0000
Commit:     Matt Turner <mattst88@gentoo.org>
CommitDate: 2021-08-04 22:28:09 +0000

    dev-cpp/gstreamermm: Add patch to build with gcc-11
    
    Closes: https://bugs.gentoo.org/786444
    Signed-off-by: Matt Turner <mattst88@gentoo.org>

 .../files/gstreamermm-1.10.0-no-volatile.patch          | 17 +++++++++++++++++
 dev-cpp/gstreamermm/gstreamermm-1.10.0.ebuild           |  4 ++++
 2 files changed, 21 insertions(+)
Comment 13 Matt Turner gentoo-dev 2021-08-04 22:28:59 UTC
(In reply to Matt Turner from comment #11)
> (In reply to Andrew Savchenko from comment #10)
> > Created attachment 711162 [details, diff] [details, diff] [details, diff]
> > gstreamermm-1.10.0-no-volatile.patch
> > 
> > There is indeed an error in the
> > /usr/include/gstreamermm-1.0/gstreamermm/register.h: it declares gsize
> > gonce_data as volatile, while it should not:
> > https://developer.gnome.org/glib/stable/glib-Threads.html#g-once-init-enter
> > 
> > "While location has a volatile qualifier, this is a historical
> > artifact and the pointer passed to it should not be volatile."
> > 
> > Now both examples and test above builds fine.
> > 
> > Gnome team, are you OK with this patch?
> > Please also see bug 791958.
> 
> Could you open a merge request upstream at
> https://gitlab.gnome.org/GNOME/gstreamermm ?
> 
> I see another merge request that fixes a double free() that seems like it
> should be accepted. Perhaps leio has the permissions to merge and make a
> release for us.

I've pushed this patch because it's less work for me than giving the package last rites.

If you care about this package, please work upstream, or the next time I get a bug about it I will give it last-rites.