I stumbled across this issue when I tried to solve a problem on the mailing list. It seems like a lot of steps need to be involved in order to make it reproducible.
I can't reproduce it w/o using repeat(), aggregate() or cap(). It is reproducible without path() though. And then it even gets a little worse; check this out:
The exception occurs only in OLAP mode, but also for more meaningful patterns (.dedup().dedup() really doesn't make much sense).
For a better / larger example see: https://groups.google.com/d/msg/gremlin-users/NMXExuvDjt0/ps7bJDYwAQAJ