Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-10474

Cannot iterate on std::map in Python using gcc9 builds

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.20/00
    • Component/s: PyROOT
    • Labels:
      None
    • Environment:

      LCG_96b, LCG dev3 and dev4

      Description

      The minimal Python script

      import cppyy
      m = cppyy.gbl.std.map(str, str)()
      m['a'] = 'A'
      print next(iter(m)).second
      

      prints A when using a gcc8 build of ROOT:

      lxplus ~ $ . /cvmfs/sft-nightlies.cern.ch/lcg/views/dev3/Fri/x86_64-centos7-gcc8-opt/setup.sh 
      lxplus ~ $ python
      Python 2.7.16 (default, Jun 13 2019, 18:33:20) 
      [GCC 8.2.0] on linux2
      Type "help", "copyright", "credits" or "license" for more information.
      >>> import cppyy
      >>> m = cppyy.gbl.std.map(str, str)()
      >>> m['a'] = 'A'
      >>> print next(iter(m)).second
      A
      

      but it fails with a StopIteration when using a gcc9 build:

      lxplus ~ $ . /cvmfs/sft-nightlies.cern.ch/lcg/views/dev3/Fri/x86_64-centos7-gcc9-opt/setup.sh
      lxplus ~ $ python
      Python 2.7.16 (default, Jul 12 2019, 12:27:03) 
      [GCC 9.1.0] on linux2
      Type "help", "copyright", "credits" or "license" for more information.
      >>> import cppyy
      >>> m = cppyy.gbl.std.map(str, str)()
      >>> m['a'] = 'A'
      >>> print next(iter(m)).second
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
      StopIteration
      

      I also tested it with the environment produced by

      • /cvmfs/sft-nightlies.cern.ch/lcg/views/dev4/Fri/x86_64-centos7-gcc9-opt/setup.sh
      • /cvmfs/sft.cern.ch/lcg/views/LCG_96b/x86_64-centos7-gcc9-opt/setup.sh

      with the exact same behaviour.

      This is very important for LHCb as we are changing our default compiler to gcc9.

        Attachments

          Activity

            People

            • Assignee:
              etejedor Enric Tejedor Saavedra
              Reporter:
              clemenci Marco Clemencic
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: