Open almaz045 opened 3 months ago
Interesting test case! There is a type that is confusing the regex during tagging.
@almaz045 could you confirm the version of atom used, since I don't get this error with the latest.
Hey, I've got very similar crash on ghcr.io/appthreat/atom:nightly
(as of today) on my repo
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
Generating data-flow dependencies from atom. Please wait ...
Exception in thread "main" overflowdb.traversal.filter.StringPropertyFilter$InvalidRegexException: invalid regular expression: `,_a).py:<module>.*`
at overflowdb.traversal.filter.StringPropertyFilter$.regexpCompile(StringPropertyFilter.scala:48)
at overflowdb.traversal.filter.StringPropertyFilter$.regexp(StringPropertyFilter.scala:13)
at io.shiftleft.codepropertygraph.generated.traversal.CallTraversalExtGen$.methodFullName$extension(Call.scala:361)
at io.appthreat.x2cpg.passes.taggers.CdxPass.run$$anonfun$1$$anonfun$5$$anonfun$1$$anonfun$1$$anonfun$1(CdxPass.scala:118)
at overflowdb.traversal.TraversalLogicExt$.where$extension$$anonfun$1(Traversal.scala:176)
at scala.collection.Iterator$$anon$6.hasNext(Iterator.scala:479)
at scala.collection.Iterator$$anon$9.hasNext(Iterator.scala:583)
at scala.collection.IterableOnceOps.foreach(IterableOnce.scala:619)
at scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:617)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1303)
at io.shiftleft.semanticcpg.language.NewTagNodePairTraversal.store(NewTagNodePairTraversal.scala:9)
at io.appthreat.x2cpg.passes.taggers.CdxPass.run$$anonfun$1$$anonfun$5$$anonfun$1$$anonfun$1(CdxPass.scala:119)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.immutable.Set$Set2.foreach(Set.scala:210)
at io.appthreat.x2cpg.passes.taggers.CdxPass.run$$anonfun$1$$anonfun$5$$anonfun$1(CdxPass.scala:114)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.immutable.Set$Set1.foreach(Set.scala:177)
at io.appthreat.x2cpg.passes.taggers.CdxPass.run$$anonfun$1$$anonfun$5(CdxPass.scala:112)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.immutable.Vector.foreach(Vector.scala:2124)
at io.appthreat.x2cpg.passes.taggers.CdxPass.run$$anonfun$1(CdxPass.scala:91)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.IterableOnceOps.foreach(IterableOnce.scala:619)
at scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:617)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1303)
at io.appthreat.x2cpg.passes.taggers.CdxPass.run(CdxPass.scala:64)
at io.shiftleft.passes.CpgPass.runOnPart(CpgPass.scala:29)
at io.shiftleft.passes.NewStyleCpgPassBase.runWithBuilder(CpgPass.scala:134)
at io.shiftleft.passes.ForkJoinParallelCpgPass.createApplySerializeAndStore(CpgPass.scala:77)
at io.shiftleft.passes.NewStyleCpgPassBase.createAndApply(CpgPass.scala:124)
at io.appthreat.atom.Atom$.generateForLanguage(Atom.scala:606)
at io.appthreat.atom.Atom$.generateAtom(Atom.scala:446)
at io.appthreat.atom.Atom$.run(Atom.scala:300)
at io.appthreat.atom.Atom$.run(Atom.scala:294)
at io.appthreat.atom.Atom$.main(Atom.scala:275)
at io.appthreat.atom.Atom.main(Atom.scala)
Caused by: java.util.regex.PatternSyntaxException: Unmatched closing ')' near index 6
(?s),_a).py:<module>.*
^
at java.base/java.util.regex.Pattern.error(Pattern.java:2204)
at java.base/java.util.regex.Pattern.compile(Pattern.java:1949)
at java.base/java.util.regex.Pattern.<init>(Pattern.java:1576)
at java.base/java.util.regex.Pattern.compile(Pattern.java:1101)
at scala.util.matching.Regex.<init>(Regex.scala:234)
at scala.collection.StringOps$.r$extension(StringOps.scala:852)
at overflowdb.traversal.filter.StringPropertyFilter$.regexpCompile(StringPropertyFilter.scala:45)
... 39 more
@kittyandrew, could you share the .py file or the code snippet?
Hi, I've looked at it again today and realized that I might've included .venv
directory when pointing to the "current working directory". Problem went away when I started pointing only to my source code.
I don't know if that makes sense to debug further
Thank you for confirming. Will keep this issue open in case we face any other problematic pattern in the future.
I've tried to test depscan on https://github.com/grpc/grpc by next command:
p.s. bom.json is exist
And got next error: