boost::algorithm::split_regex hangs and consumes CPU on dangling alternatives
- Lenguaje dominante
- C++
- Estrellas
- 131
- Forks
- 117
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
I happened to typo a regex, and I noticed that `boost::algorithm::split_regex` started consuming a bunch of CPU. I don't know is this would have eventually caught itself and terminating. The regex in question was `;|`, and this appears to be true for any dangling `|`.
I'm a bit surprised that `boost::regex` allowed `;|` as valid, given split_regex's behavior.
Simple example up at https://gist.github.com/directionless/c38eb7dc216bcd93b40c3ecaf99f326e
I tested this on darwin with boost 1.67, and on linux with boost 1.65
(This was moved here from https://github.com/boostorg/regex/issues/76)
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Comienza reproduciendo el caso `split_regex` del gist enlazado con el patrón `;|` colgante, usando los entornos de Boost 1.65 o 1.67 mencionados. Sigue la llamada hasta el algoritmo de Boost y el comportamiento de regex para identificar por qué el uso de CPU no termina; se considera terminado cuando la entrada indicada ya no se queda bloqueada y el comportamiento está cubierto por una prueba de regresión.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- cpp
- Área
- tooling
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 38/100