Bug 1313234 - Dictionary compilation fails with #include <sstream>
Dictionary compilation fails with #include <sstream>
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: root (Show other bugs)
24
x86_64 Linux
unspecified Severity medium
: ---
: ---
Assigned To: Mattias Ellert
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-03-01 03:45 EST by nvwarr
Modified: 2016-04-28 16:41 EDT (History)
2 users (show)

See Also:
Fixed In Version: root-6.06.02-1.fc24 root-6.06.02-1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-04-15 17:35:19 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description nvwarr 2016-03-01 03:45:45 EST
Description of problem:

Compilation of a dictionary fails when sstream is included

Version-Release number of selected component (if applicable):

root-5.34.32-8.fc24.x86_64

How reproducible:

Always

Steps to Reproduce:
1. Create a simple file MyClass.hh containing:
#ifndef __MYCLASS_HH__
#define __MYCLASS_HH__
#include <iostream>
#include <sstream>
class MyClass {
 public:
   MyClass() {
      std::cout << "hello, world!" << std::endl;
   };
};
#endif

2.Create a LinkDef.h containing:
#ifdef __CINT__
#pragma link off all classes;
#endif

3.rootcint -f MyClass.Dict.cc -c MyClass.hh

4. g++  -g -Wall -fPIC -I. -pthread -m64 -I/usr/include/root   -c -o MyClass.Dict.o MyClass.Dict.cc

Actual results:

In file included from MyClass.hh:5:0,
                 from MyClass.Dict.h:34,
                 from MyClass.Dict.cc:17:
/usr/include/c++/6.0.0/sstream:300:7: error: ‘struct std::__cxx11::basic_stringbuf<_CharT, _Traits, _Alloc>::__xfer_bufptrs’ redeclared with different access
       struct __xfer_bufptrs
       ^~~~~~
<builtin>: recipe for target 'MyClass.Dict.o' failed
make: *** [MyClass.Dict.o] Error 1

Expected results:

Should create a .o file that can be made into a library using:

g++ -shared -Wl,-soname,libMyClass.so -o libMyClass.so MyClass.Dict.o

and then loaded into root with

.L libMyClass.so

Additional info:

Adding -DR__ACCESS_IN_SYMBOL to the compile works around the problem, since rootcint generates code containing:

#if !defined(R__ACCESS_IN_SYMBOL)
//Break the privacy of classes -- Disabled for the moment
#define private public
#define protected public
#endif

It is the #define private public which causes the problems.This interacts badly with sstream, which is where struct __xfer_bufptrs is declared (from libstdc++-devel-6.0.0-0.13.fc24.x86_64).

If the #include <sstream> is removed, it compiles in this case, but obviously not in realistic cases, where sstream is really needed.
Comment 1 nvwarr 2016-03-01 03:48:19 EST
Ooops, the LinkDef.h makes no difference one way or the other, since it is not actually in the rootcint command:) The problem exists with or without a LinkDef.h
Comment 2 Fedora Update System 2016-04-11 08:57:54 EDT
pythia8-8.2.15-1.el7 root-6.06.02-1.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-fb4c8595e1
Comment 3 Fedora Update System 2016-04-11 08:58:16 EDT
pythia8-8.2.15-1.fc24 root-6.06.02-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-ad70b05a7e
Comment 4 Fedora Update System 2016-04-12 06:53:47 EDT
pythia8-8.2.15-1.fc24, root-6.06.02-1.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-ad70b05a7e
Comment 5 nvwarr 2016-04-12 06:58:22 EDT
It works. Thanks very much.
Comment 6 Fedora Update System 2016-04-13 09:52:21 EDT
pythia8-8.2.15-1.el7, root-6.06.02-1.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-fb4c8595e1
Comment 7 Fedora Update System 2016-04-15 17:34:59 EDT
pythia8-8.2.15-1.fc24, root-6.06.02-1.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.
Comment 8 Fedora Update System 2016-04-28 16:40:55 EDT
pythia8-8.2.15-1.el7, root-6.06.02-1.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.