Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

boost::algorithm::split_regex hangs and consumes CPU on dangling alternatives

Open
#68 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
tooling

Research direction

Start by reproducing the split_regex case from the linked gist with the dangling ;| pattern, using the Boost 1.65 or 1.67 environments mentioned. Trace the call into the Boost algorithm and regex behavior to identify why CPU use does not terminate; done means the reported input no longer hangs and the behavior is covered by a regression test.

Written by the indexing model from the issue text.

Description

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)

Dominant language
C++
Stars
131
Forks
117
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boostorg/algorithm

All issues in boostorg/algorithm

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.