Bug #1600

PyPersistenceTest throws an exception from regex

Added by pospelov about 4 years ago. Updated 10 days ago.

Status:ArchivedStart date:02 Sep 2016
Priority:NormalDue date:
Assignee:wuttke% Done:

0%

Category:-
Target version:Sprint32

Description

Every PyPersistenceTest fails with

terminate called after throwing an instance of 'std::regex_error'
  what():  regex_error

It happens on my OpenSuse Leap 42.1 with compiler gcc 4.8.5.
Can it be because of partial regex support in compilers before 4.9?
http://stackoverflow.com/questions/15671536/why-does-this-c11-stdregex-example-throw-a-regex-error-exception

Three weeks ago everything was OK on develop on my system.

Stack looks like

#0  0x00007ffff34050c7 in raise () from /lib64/libc.so.6
#1  0x00007ffff3406478 in abort () from /lib64/libc.so.6
#2  0x00007ffff3d26b7d in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib64/libstdc++.so.6
#3  0x00007ffff3d24c06 in ?? () from /usr/lib64/libstdc++.so.6
#4  0x00007ffff3d24c51 in std::terminate() () from /usr/lib64/libstdc++.so.6
#5  0x00007ffff3d24e68 in __cxa_throw () from /usr/lib64/libstdc++.so.6
#6  0x00007ffff3d4cca5 in std::__throw_regex_error(std::regex_constants::error_type) () from /usr/lib64/libstdc++.so.6
#7  0x00007ffff7485e10 in std::__detail::_Scanner<__gnu_cxx::__normal_iterator<char const*, std::string> >::_M_eat_escape (this=0x7fffffffd3f8) at /usr/include/c++/4.8/bits/regex_compiler.h:467
#8  0x00007ffff7484550 in std::__detail::_Scanner<__gnu_cxx::__normal_iterator<char const*, std::string> >::_M_advance (this=0x7fffffffd3f8) at /usr/include/c++/4.8/bits/regex_compiler.h:229
#9  0x00007ffff7484933 in std::__detail::_Compiler<__gnu_cxx::__normal_iterator<char const*, std::string>, std::regex_traits<char> >::_M_match_token (this=0x7fffffffd3f0, 
    token=std::__detail::_Scanner<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::_S_token_ord_char)
    at /usr/include/c++/4.8/bits/regex_compiler.h:747
#10 0x00007ffff74874ab in std::__detail::_Compiler<__gnu_cxx::__normal_iterator<char const*, std::string>, std::regex_traits<char> >::_M_atom (this=0x7fffffffd3f0)
    at /usr/include/c++/4.8/bits/regex_compiler.h:921
#11 0x00007ffff7486031 in std::__detail::_Compiler<__gnu_cxx::__normal_iterator<char const*, std::string>, std::regex_traits<char> >::_M_term (this=0x7fffffffd3f0)
    at /usr/include/c++/4.8/bits/regex_compiler.h:795
#12 0x00007ffff7484812 in std::__detail::_Compiler<__gnu_cxx::__normal_iterator<char const*, std::string>, std::regex_traits<char> >::_M_alternative (this=0x7fffffffd3f0)
    at /usr/include/c++/4.8/bits/regex_compiler.h:773
#13 0x00007ffff748485c in std::__detail::_Compiler<__gnu_cxx::__normal_iterator<char const*, std::string>, std::regex_traits<char> >::_M_alternative (this=0x7fffffffd3f0)
    at /usr/include/c++/4.8/bits/regex_compiler.h:776
#14 0x00007ffff748485c in std::__detail::_Compiler<__gnu_cxx::__normal_iterator<char const*, std::string>, std::regex_traits<char> >::_M_alternative (this=0x7fffffffd3f0)
    at /usr/include/c++/4.8/bits/regex_compiler.h:776
#15 0x00007ffff748485c in std::__detail::_Compiler<__gnu_cxx::__normal_iterator<char const*, std::string>, std::regex_traits<char> >::_M_alternative (this=0x7fffffffd3f0)
    at /usr/include/c++/4.8/bits/regex_compiler.h:776
#16 0x00007ffff748485c in std::__detail::_Compiler<__gnu_cxx::__normal_iterator<char const*, std::string>, std::regex_traits<char> >::_M_alternative (this=0x7fffffffd3f0)
    at /usr/include/c++/4.8/bits/regex_compiler.h:776
#17 0x00007ffff748485c in std::__detail::_Compiler<__gnu_cxx::__normal_iterator<char const*, std::string>, std::regex_traits<char> >::_M_alternative (this=0x7fffffffd3f0)
    at /usr/include/c++/4.8/bits/regex_compiler.h:776
#18 0x00007ffff748485c in std::__detail::_Compiler<__gnu_cxx::__normal_iterator<char const*, std::string>, std::regex_traits<char> >::_M_alternative (this=0x7fffffffd3f0)
    at /usr/include/c++/4.8/bits/regex_compiler.h:776
#19 0x00007ffff748485c in std::__detail::_Compiler<__gnu_cxx::__normal_iterator<char const*, std::string>, std::regex_traits<char> >::_M_alternative (this=0x7fffffffd3f0)
    at /usr/include/c++/4.8/bits/regex_compiler.h:776
#20 0x00007ffff748485c in std::__detail::_Compiler<__gnu_cxx::__normal_iterator<char const*, std::string>, std::regex_traits<char> >::_M_alternative (this=0x7fffffffd3f0)
    at /usr/include/c++/4.8/bits/regex_compiler.h:776
#21 0x00007ffff748485c in std::__detail::_Compiler<__gnu_cxx::__normal_iterator<char const*, std::string>, std::regex_traits<char> >::_M_alternative (this=0x7fffffffd3f0)
    at /usr/include/c++/4.8/bits/regex_compiler.h:776
#22 0x00007ffff748485c in std::__detail::_Compiler<__gnu_cxx::__normal_iterator<char const*, std::string>, std::regex_traits<char> >::_M_alternative (this=0x7fffffffd3f0)
    at /usr/include/c++/4.8/bits/regex_compiler.h:776
#23 0x00007ffff748485c in std::__detail::_Compiler<__gnu_cxx::__normal_iterator<char const*, std::string>, std::regex_traits<char> >::_M_alternative (this=0x7fffffffd3f0)
    at /usr/include/c++/4.8/bits/regex_compiler.h:776
#24 0x00007ffff748485c in std::__detail::_Compiler<__gnu_cxx::__normal_iterator<char const*, std::string>, std::regex_traits<char> >::_M_alternative (this=0x7fffffffd3f0)
    at /usr/include/c++/4.8/bits/regex_compiler.h:776
#25 0x00007ffff748485c in std::__detail::_Compiler<__gnu_cxx::__normal_iterator<char const*, std::string>, std::regex_traits<char> >::_M_alternative (this=0x7fffffffd3f0)
    at /usr/include/c++/4.8/bits/regex_compiler.h:776
#26 0x00007ffff748485c in std::__detail::_Compiler<__gnu_cxx::__normal_iterator<char const*, std::string>, std::regex_traits<char> >::_M_alternative (this=0x7fffffffd3f0)
---Type <return> to continue, or q <return> to quit---
    at /usr/include/c++/4.8/bits/regex_compiler.h:776
#27 0x00007ffff748485c in std::__detail::_Compiler<__gnu_cxx::__normal_iterator<char const*, std::string>, std::regex_traits<char> >::_M_alternative (this=0x7fffffffd3f0)
    at /usr/include/c++/4.8/bits/regex_compiler.h:776
#28 0x00007ffff748485c in std::__detail::_Compiler<__gnu_cxx::__normal_iterator<char const*, std::string>, std::regex_traits<char> >::_M_alternative (this=0x7fffffffd3f0)
    at /usr/include/c++/4.8/bits/regex_compiler.h:776
#29 0x00007ffff748485c in std::__detail::_Compiler<__gnu_cxx::__normal_iterator<char const*, std::string>, std::regex_traits<char> >::_M_alternative (this=0x7fffffffd3f0)
    at /usr/include/c++/4.8/bits/regex_compiler.h:776
#30 0x00007ffff748485c in std::__detail::_Compiler<__gnu_cxx::__normal_iterator<char const*, std::string>, std::regex_traits<char> >::_M_alternative (this=0x7fffffffd3f0)
    at /usr/include/c++/4.8/bits/regex_compiler.h:776
#31 0x00007ffff748485c in std::__detail::_Compiler<__gnu_cxx::__normal_iterator<char const*, std::string>, std::regex_traits<char> >::_M_alternative (this=0x7fffffffd3f0)
    at /usr/include/c++/4.8/bits/regex_compiler.h:776
#32 0x00007ffff748485c in std::__detail::_Compiler<__gnu_cxx::__normal_iterator<char const*, std::string>, std::regex_traits<char> >::_M_alternative (this=0x7fffffffd3f0)
    at /usr/include/c++/4.8/bits/regex_compiler.h:776
#33 0x00007ffff748485c in std::__detail::_Compiler<__gnu_cxx::__normal_iterator<char const*, std::string>, std::regex_traits<char> >::_M_alternative (this=0x7fffffffd3f0)
    at /usr/include/c++/4.8/bits/regex_compiler.h:776
#34 0x00007ffff748485c in std::__detail::_Compiler<__gnu_cxx::__normal_iterator<char const*, std::string>, std::regex_traits<char> >::_M_alternative (this=0x7fffffffd3f0)
    at /usr/include/c++/4.8/bits/regex_compiler.h:776
#35 0x00007ffff748485c in std::__detail::_Compiler<__gnu_cxx::__normal_iterator<char const*, std::string>, std::regex_traits<char> >::_M_alternative (this=0x7fffffffd3f0)
    at /usr/include/c++/4.8/bits/regex_compiler.h:776
#36 0x00007ffff7483878 in std::__detail::_Compiler<__gnu_cxx::__normal_iterator<char const*, std::string>, std::regex_traits<char> >::_M_disjunction (this=0x7fffffffd3f0)
    at /usr/include/c++/4.8/bits/regex_compiler.h:758
#37 0x00007ffff7482907 in std::__detail::_Compiler<__gnu_cxx::__normal_iterator<char const*, std::string>, std::regex_traits<char> >::_Compiler (this=0x7fffffffd3f0, __b=..., __e=..., __traits=..., 
    __flags=16) at /usr/include/c++/4.8/bits/regex_compiler.h:729
#38 0x00007ffff7481296 in std::__detail::__compile<__gnu_cxx::__normal_iterator<char const*, std::string>, std::regex_traits<char> > (__b=..., __e=..., __t=..., __f=16)
    at /usr/include/c++/4.8/bits/regex_compiler.h:1105
#39 0x00007ffff7480610 in std::basic_regex<char, std::regex_traits<char> >::basic_regex<std::char_traits<char>, std::allocator<char> > (this=0x7fffffffd5a0, __s=..., __f=16)
    at /usr/include/c++/4.8/bits/regex.h:444
#40 0x00007ffff747e180 in FileSystem::reglob (dir=..., pattern=...) at /home/pospelov/development/BornAgain/BornAgain/Core/Tools/FileSystem.cpp:74
#41 0x0000000000413854 in PyPersistenceTest::runTest (this=0x7fffffffd840) at /home/pospelov/development/BornAgain/BornAgain/Tests/Functional/PyCore/persistence/PyPersistenceTest.cpp:41
#42 0x000000000041344a in main (argc=3, argv=0x7fffffffd988) at /home/pospelov/development/BornAgain/BornAgain/Tests/Functional/PyCore/persistence/RunPyPersistenceTest.cpp:31

History

#1 Updated by wuttke about 4 years ago

Dependence on regex has come in because dependence on glob.h had to be removed; glob.h had to be removed because it is not supported under Windows.

Regex is used to decompose file names. This task is not particularly difficult, and could be hard coded within less than an hour, I would hope.

But is it worthwhile? Why not push our requirements to g++ >= 4.9 ?

#2 Updated by wuttke about 4 years ago

  • Parent task set to #1602

#3 Updated by pospelov about 4 years ago

OpenSuse 42.1 is a pretty modern distribution. If even I (the developer) is not able to compile on it without additional pain , community will have this pain too. So I wouldn’t rise compiler requirement just because of single regexp. One can use boost regex instead.

In general, to my opinion, adding new library/dependency, rising minimal compiler version, is a serious decision and requires at least sprint-wise if not year-wise thinking/planing/justification.

#4 Updated by wuttke about 4 years ago

  • Assignee set to wuttke

ok, let's go or boost/regex

#5 Updated by wuttke about 4 years ago

  • Status changed from Sprint to Resolved

Resolved in f9dca13.

#6 Updated by herck almost 4 years ago

  • Status changed from Resolved to Archived

#7 Updated by wuttke 10 days ago

  • Parent task deleted (#1602)

Also available in: Atom PDF