holgerBerger / hpc-workspace

Automatically exported from code.google.com/p/hpc-workspace
GNU General Public License v3.0
18 stars 13 forks source link

ws_allocate: Regex exception #77

Closed URZ-HD closed 3 years ago

URZ-HD commented 3 years ago

Hi, since the change from boost regex to std:regex i got the following error when using ws_allocate:

/tmp/ws_allocate captest 1
Info: Took email address <xxx> from users config.
Warning: reminder is only sent after workspace expiry!
terminate called after throwing an instance of 'std::regex_error'
  what():  regex_error
Aborted

I'm using the latest version and compiled with:

best, Sven

URZ-HD commented 3 years ago

Fixing the Regex with:

static const std::regex e("^[[:alnum:]][[:alnum:]_.-]*$"); (ws_allocate.cpp:186)

works.

holgerBerger commented 3 years ago

oh damn, which gcc is that? my gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 has no issues with that.

holgerBerger commented 3 years ago

gcc (GCC) 8.3.1 20191121 (Red Hat 8.3.1-5)

seems to work as well.

URZ-HD commented 3 years ago

we are using currently: gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)

URZ-HD commented 3 years ago

Hi, i'm very sure that the new regex works yesterday. But unfortunately today user have again the same issue. I tested again, it looks like the problem are the brackets [].

For example, this regex works:

std::regex e("^.*$");

this not:

std::regex e("^[.]*$");

This sounds exactly like this problem: https://stackoverflow.com/questions/8060025/is-this-c11-regex-error-me-or-the-compiler So it looks like the regex support in gcc4.8 ist not complete.

I see currently as possible solutions

  1. testing for regex implementation and using regex only if supported
  2. updating compile requirements for gcc >4.9
  3. using some workaround regex, without using brackets

best, Sven

holgerBerger commented 3 years ago

f7eb93f3b5e0b2fc48301a23f0be7e5d762e08a4 now contains a new cmake switch for boost::regex usage with broken std::regexp

URZ-HD commented 3 years ago

perfect solution. Thanks.