Bug 1186110

Summary: GCC 11: libreoffice package fails
Product: [openSUSE] openSUSE Tumbleweed Reporter: Martin Liška <martin.liska>
Component: BasesystemAssignee: E-mail List <screening-team-bugs>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: gp, marina.latini, mmachova
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
URL: https://bugs.documentfoundation.org/show_bug.cgi?id=142326
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on:    
Bug Blocks: 1181859    

Description Martin Liška 2021-05-17 07:21:20 UTC
The package fails here:
https://build.opensuse.org/package/live_build_log/openSUSE:Factory:Staging:N/libreoffice/standard/x86_64

due to:
[ 4283s] In file included from /home/abuild/rpmbuild/BUILD/libreoffice-7.1.3.2/sfx2/source/control/bindings.cxx:24:
[ 4283s] /home/abuild/rpmbuild/BUILD/libreoffice-7.1.3.2/sfx2/source/control/bindings.cxx: In member function 'sal_uInt16 SfxBindings::EnterRegistrations(const char*, int)':
[ 4283s] /home/abuild/rpmbuild/BUILD/libreoffice-7.1.3.2/include/sal/log.hxx:194:6: error: invalid 'static_cast' from type 'std::__cxx11::basic_ostringstream<char>' to type 'std::ostringstream&' {aka 'std::__cxx11::basic_ostringstream<char>&'}
[ 4283s]   194 |     (dynamic_cast< ::std::ostringstream & >(::std::ostringstream() << stream).str())
[ 4283s]       |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 4283s] /home/abuild/rpmbuild/BUILD/libreoffice-7.1.3.2/include/sal/log.hxx:129:45: note: in definition of macro 'SAL_DETAIL_LOG_STREAM_PRIVATE_'
[ 4283s]   129 |             ::sal::detail::StreamStart() << stream) == 1) \
[ 4283s]       |                                             ^~~~~~
[ 4283s] /home/abuild/rpmbuild/BUILD/libreoffice-7.1.3.2/include/sal/log.hxx:335:5: note: in expansion of macro 'SAL_DETAIL_LOG_STREAM'
[ 4283s]   335 |     SAL_DETAIL_LOG_STREAM( \
[ 4283s]       |     ^~~~~~~~~~~~~~~~~~~~~
[ 4283s] /home/abuild/rpmbuild/BUILD/libreoffice-7.1.3.2/sfx2/source/control/bindings.cxx:1314:5: note: in expansion of macro 'SAL_INFO'
[ 4283s]  1314 |     SAL_INFO(
[ 4283s]       |     ^~~~~~~~
Comment 1 Markéta Machová 2021-05-17 10:40:50 UTC
the only changes in the upstream changelog between older version and the recent one are:

2021-05-04  Nick Clifton  <nickc@redhat.com>

	* configure.ac (AC_PROG_CC): Replace with AC_PROG_CC_C99.
	* configure: Regenerate.

2021-04-28  Jakub Jelinek  <jakub@redhat.com>
	    Tobias Burnus  <tobias@codesourcery.com>

	* configure.ac (--enable-offload-defaulted): New.
	* configure: Regenerate.

That does not look relevant to me :( .
Comment 2 Richard Biener 2021-05-17 14:46:58 UTC
     (dynamic_cast< ::std::ostringstream & >(::std::ostringstream() << stream).str())

that looks totally phishy - the result of .str() isn't valid after the
operation and the dynamic_cast is likely to avoid some diagnostic about
extending the lifetime of a temporary?
Comment 3 Richard Biener 2021-05-17 14:54:36 UTC
a fix would be to use

dynamic_cast< ::std::ostringstream &&>

(&& instead of &), likely caused by the fix for LWG 1203 (g:ca7d2f2ec9142995179a5d832a946b50de05e659)
Comment 4 Martin Liška 2021-05-17 16:07:30 UTC
It was addressed in master, but not for GCC 11 if I read it correctly:
https://cgit.freedesktop.org/libreoffice/core/commit/?id=1f3dddd6f21d91c429190ae314dadeec409f35f4
Comment 5 Martin Liška 2021-05-17 16:15:52 UTC
(In reply to Richard Biener from comment #3)
> a fix would be to use
> 
> dynamic_cast< ::std::ostringstream &&>
> 
> (&& instead of &), likely caused by the fix for LWG 1203
> (g:ca7d2f2ec9142995179a5d832a946b50de05e659)

I can confirm, this fixes the problem.
Comment 6 Markéta Machová 2021-05-18 06:19:53 UTC
Just referencing the libreoffice upstream bug (today I had some trouble finding it in my inbox): https://bugs.documentfoundation.org/show_bug.cgi?id=142326

Martin, thanks for taking care :) .
Comment 7 Martin Liška 2021-05-18 07:40:57 UTC
(In reply to Markéta Machová from comment #6)
> Just referencing the libreoffice upstream bug (today I had some trouble
> finding it in my inbox):
> https://bugs.documentfoundation.org/show_bug.cgi?id=142326
> 
> Martin, thanks for taking care :) .

You're welcome. I've just made a SR#893914 that fixes that. We can then wait for upstream for a proper fix.
Comment 8 Martin Liška 2021-05-19 08:21:26 UTC
Fixed now.
Comment 11 Swamp Workflow Management 2021-06-10 16:20:02 UTC
SUSE-RU-2021:1949-1: An update that has 8 recommended fixes can now be installed.

Category: recommended (important)
Bug References: 1162022,1172941,1175552,1176197,1176198,1185505,1185797,1186110
CVE References: 
JIRA References: 
Sources used:
SUSE Linux Enterprise Workstation Extension 15-SP2 (src):    libreoffice-7.1.3.2-13.21.2

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 12 Swamp Workflow Management 2021-06-15 13:18:05 UTC
SUSE-RU-2021:1973-1: An update that has 6 recommended fixes can now be installed.

Category: recommended (important)
Bug References: 1184527,1184961,1185505,1185797,1186110,1186706
CVE References: 
JIRA References: 
Sources used:
SUSE MicroOS 5.0 (src):    xmlsec1-1.2.28-7.7.1
SUSE Linux Enterprise Workstation Extension 15-SP3 (src):    libreoffice-7.1.3.2-4.5.3, myspell-dictionaries-20191219-3.19.1, xmlsec1-1.2.28-7.7.1
SUSE Linux Enterprise Workstation Extension 15-SP2 (src):    myspell-dictionaries-20191219-3.19.1, xmlsec1-1.2.28-7.7.1
SUSE Linux Enterprise Module for Packagehub Subpackages 15-SP3 (src):    libreoffice-7.1.3.2-4.5.3, myspell-dictionaries-20191219-3.19.1, raptor-2.0.15-9.5.1, ucpp-1.3.4-3.2.1, xmlsec1-1.2.28-7.7.1
SUSE Linux Enterprise Module for Packagehub Subpackages 15-SP2 (src):    xmlsec1-1.2.28-7.7.1
SUSE Linux Enterprise Module for Development Tools 15-SP3 (src):    ucpp-1.3.4-3.2.1
SUSE Linux Enterprise Module for Development Tools 15-SP2 (src):    ucpp-1.3.4-3.2.1
SUSE Linux Enterprise Module for Desktop Applications 15-SP3 (src):    raptor-2.0.15-9.5.1
SUSE Linux Enterprise Module for Desktop Applications 15-SP2 (src):    raptor-2.0.15-9.5.1
SUSE Linux Enterprise Module for Basesystem 15-SP3 (src):    myspell-dictionaries-20191219-3.19.1, xmlsec1-1.2.28-7.7.1
SUSE Linux Enterprise Module for Basesystem 15-SP2 (src):    myspell-dictionaries-20191219-3.19.1, xmlsec1-1.2.28-7.7.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 13 Swamp Workflow Management 2021-06-16 19:22:47 UTC
openSUSE-RU-2021:0880-1: An update that has 8 recommended fixes can now be installed.

Category: recommended (important)
Bug References: 1162022,1172941,1175552,1176197,1176198,1185505,1185797,1186110
CVE References: 
JIRA References: 
Sources used:
openSUSE Leap 15.2 (src):    libreoffice-7.1.3.2-lp152.2.13.1
Comment 16 Swamp Workflow Management 2021-07-06 19:24:04 UTC
SUSE-RU-2021:2263-1: An update that has 21 recommended fixes and contains three features can now be installed.

Category: recommended (moderate)
Bug References: 1116658,1136234,1155141,1173404,1173409,1173410,1173471,1174465,1176547,1177955,1178807,1179025,1179203,1181122,1181644,1181872,1182790,1182970,1185505,1185797,1186110
CVE References: 
JIRA References: ECO-3150,ECO-3375,SLE-17417
Sources used:
SUSE Linux Enterprise Workstation Extension 12-SP5 (src):    Box2D-2.3.1-4.3.8, libixion-0.16.1-13.15.1, libmwaw-0.3.17-7.18.1, liborcus-0.16.1-10.18.1, libreoffice-7.1.3.2-43.79.1, libstaroffice-0.0.7-13.1, libwps-0.4.11-10.16.1
SUSE Linux Enterprise Software Development Kit 12-SP5 (src):    Box2D-2.3.1-4.3.8, libixion-0.16.1-13.15.1, libmwaw-0.3.17-7.18.1, liborcus-0.16.1-10.18.1, libreoffice-7.1.3.2-43.79.1, libwps-0.4.11-10.16.1
SUSE Linux Enterprise Server 12-SP5 (src):    libnumbertext-1.0.6-1.6.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 17 Swamp Workflow Management 2021-07-10 23:04:41 UTC
openSUSE-RU-2021:1973-1: An update that has 6 recommended fixes can now be installed.

Category: recommended (important)
Bug References: 1184527,1184961,1185505,1185797,1186110,1186706
CVE References: 
JIRA References: 
Sources used:
openSUSE Leap 15.3 (src):    libreoffice-7.1.3.2-4.5.3, myspell-dictionaries-20191219-3.19.1, raptor-2.0.15-9.5.1, ucpp-1.3.4-3.2.1, xmlsec1-1.2.28-7.7.1