Export of the CPG into Neo4J fails for numeric arguments too big to be interpreted as long values.
The example is taken from Nucleus.
This usually happens when the code contains binary logic operators (like & or | applying a bitmask)
Stack trace
11:04:30,897 INFO TranslationConfiguration$Builder Registered language frontend 'CLanguage' for following file types: [c, h]
11:04:30,906 INFO TranslationConfiguration$Builder Registered language frontend 'CPPLanguage' for following file types: [cpp, cc, cxx, hpp, hh]
11:04:30,912 INFO TranslationConfiguration$Builder Registered language frontend 'JavaLanguage' for following file types: [java]
11:04:30,912 INFO TranslationConfiguration$Builder Registered language frontend 'JavaLanguage' for following file types: [java]
11:04:30,917 INFO TranslationConfiguration$Builder Registered language frontend 'GoLanguage' for following file types: [go]
11:04:30,937 INFO TranslationConfiguration$Builder Registered an extra (frontend dependent) default dependency: class de.fraunhofer.aisec.cpg.passes.FunctionPointerCallResolver
11:04:30,937 INFO TranslationConfiguration$Builder Registered an extra (frontend dependent) default dependency: class de.fraunhofer.aisec.cpg.passes.FunctionPointerCallResolver
11:04:30,940 INFO TranslationConfiguration$Builder Registered an extra (frontend dependent) default dependency: class de.fraunhofer.aisec.cpg.passes.JavaExternalTypeHierarchyResolver
11:04:30,940 INFO TranslationConfiguration$Builder Registered an extra (frontend dependent) default dependency: class de.fraunhofer.aisec.cpg.passes.JavaExternalTypeHierarchyResolver
11:04:30,945 INFO TranslationConfiguration$Builder Registered an extra (frontend dependent) default dependency: class de.fraunhofer.aisec.cpg.passes.GoExtraPass
11:04:30,947 INFO TranslationConfiguration$Builder Passes before enforcing order: [TypeHierarchyResolver, ImportResolver, VariableUsageResolver, CallResolver, DFGPass, EvaluationOrderGraphPass, TypeResolver, ControlFlowSensitiveDFGPass, FilenameMapper, PrepareSerialization, FunctionPointerCallResolver, FunctionPointerCallResolver, JavaExternalTypeHierarchyResolver, JavaExternalTypeHierarchyResolver, GoExtraPass]
11:04:31,040 INFO TranslationConfiguration$Builder Passes after enforcing order: [TypeHierarchyResolver, PrepareSerialization, JavaExternalTypeHierarchyResolver, ImportResolver, GoExtraPass, VariableUsageResolver, CallResolver, DFGPass, EvaluationOrderGraphPass, TypeResolver, ControlFlowSensitiveDFGPass, FunctionPointerCallResolver, FilenameMapper]
11:04:31,043 INFO TranslationConfiguration$Builder Passes before enforcing order: []
11:04:31,043 INFO TranslationConfiguration$Builder Passes after enforcing order: []
11:04:31,067 INFO MeasurementHolder TranslationManager: Translation into full graph
11:04:31,068 INFO MeasurementHolder TranslationManager: Executing Language Frontend
11:04:31,075 INFO TranslationManager Parsing /home/aisec/rh/cpg-test/f9.c
11:04:31,278 INFO MeasurementHolder CXXLanguageFrontend: Parsing sourcefile f9.c
11:04:31,708 INFO CXXLanguageFrontend Parsed 4417 bytes in f9.c corresponding roughly to 88 LoC
11:04:31,717 INFO MeasurementHolder CXXLanguageFrontend: Parsing sourcefile f9.c done in 429 ms
11:04:31,718 INFO MeasurementHolder CXXLanguageFrontend: Transforming f9.c to CPG
11:04:31,774 WARN Util /home/aisec/rh/cpg-test/f9.c:28:11: Integer literal 0x8000000000000000 is too large to be represented in a signed type, interpreting it as unsigned.
11:04:31,826 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:31,836 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:31,925 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:31,931 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:31,952 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:31,954 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:31,956 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:31,958 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:31,961 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:31,963 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:31,964 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:31,967 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:31,968 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:31,974 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:31,979 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:31,985 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:31,987 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:31,989 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:31,991 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:31,992 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:31,996 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:32,054 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:32,056 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:32,058 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:32,059 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:32,060 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:32,063 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:32,067 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:32,069 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:32,074 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:32,074 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:32,075 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:32,076 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:32,077 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:32,079 WARN BinaryOperator Creating a BinaryOperator with an assignment operator code is deprecated. The class AssignExpression should be used instead.
11:04:32,086 INFO MeasurementHolder CXXLanguageFrontend: Transforming f9.c to CPG done in 367 ms
11:04:32,089 INFO MeasurementHolder TranslationManager: Executing Language Frontend done in 1020 ms
11:04:32,089 INFO MeasurementHolder TypeHierarchyResolver: Executing Pass
11:04:32,174 INFO MeasurementHolder TypeHierarchyResolver: Executing Pass done in 84 ms
11:04:32,175 INFO MeasurementHolder PrepareSerialization: Executing Pass
11:04:32,301 INFO MeasurementHolder PrepareSerialization: Executing Pass done in 126 ms
11:04:32,302 INFO MeasurementHolder JavaExternalTypeHierarchyResolver: Executing Pass
11:04:32,304 INFO MeasurementHolder JavaExternalTypeHierarchyResolver: Executing Pass done in 2 ms
11:04:32,304 INFO MeasurementHolder ImportResolver: Executing Pass
11:04:32,311 INFO MeasurementHolder ImportResolver: Executing Pass done in 6 ms
11:04:32,311 INFO MeasurementHolder GoExtraPass: Executing Pass
11:04:32,363 INFO MeasurementHolder GoExtraPass: Executing Pass done in 51 ms
11:04:32,364 INFO MeasurementHolder VariableUsageResolver: Executing Pass
11:04:32,520 INFO MeasurementHolder VariableUsageResolver: Executing Pass done in 155 ms
11:04:32,521 INFO MeasurementHolder CallResolver: Executing Pass
11:04:32,583 ERROR TypeManager Missing context provider
11:04:32,612 INFO MeasurementHolder CallResolver: Executing Pass done in 90 ms
11:04:32,612 INFO MeasurementHolder DFGPass: Executing Pass
11:04:32,660 INFO MeasurementHolder DFGPass: Executing Pass done in 47 ms
11:04:32,660 INFO MeasurementHolder EvaluationOrderGraphPass: Executing Pass
11:04:32,906 INFO MeasurementHolder EvaluationOrderGraphPass: Executing Pass done in 246 ms
11:04:32,907 INFO MeasurementHolder TypeResolver: Executing Pass
11:04:32,928 INFO MeasurementHolder TypeResolver: Executing Pass done in 21 ms
11:04:32,928 INFO MeasurementHolder ControlFlowSensitiveDFGPass: Executing Pass
11:04:32,976 INFO MeasurementHolder ControlFlowSensitiveDFGPass: Executing Pass done in 47 ms
11:04:32,976 INFO MeasurementHolder FunctionPointerCallResolver: Executing Pass
11:04:32,985 INFO MeasurementHolder FunctionPointerCallResolver: Executing Pass done in 8 ms
11:04:32,985 INFO MeasurementHolder FilenameMapper: Executing Pass
11:04:32,987 INFO MeasurementHolder FilenameMapper: Executing Pass done in 2 ms
11:04:32,987 INFO MeasurementHolder TranslationManager: Translation into full graph done in 1919 ms
11:04:32,989 INFO Application Benchmark: analyzing code in 1 s.
11:04:32,990 INFO MeasurementHolder Application: Push cpg to neo4j
11:04:32,991 INFO Application Using import depth: -1
11:04:32,994 INFO Application Count base nodes to save: 10
11:04:34,357 INFO DomainInfo Starting Post-processing phase
11:04:34,358 INFO DomainInfo Building byLabel lookup maps
11:04:34,359 INFO DomainInfo Building interface class map for 231 classes
11:04:34,432 INFO DomainInfo Post-processing complete
11:04:35,094 WARN BoltResponse Neo.ClientNotification.Statement.FeatureDeprecationWarning: This feature is deprecated and will be removed in future versions.
UNWIND $rows as row CREATE (n:`Node`:`TranslationUnitDeclaration`) SET n=row.props RETURN row.nodeRef as ref, ID(n) as id, $type as type
^
The query used a deprecated function: `id`.
11:04:35,214 WARN BoltResponse Neo.ClientNotification.Statement.FeatureDeprecationWarning: This feature is deprecated and will be removed in future versions.
UNWIND $rows as row CREATE (n:`BinaryOperator`:`Node`) SET n=row.props RETURN row.nodeRef as ref, ID(n) as id, $type as type
^
The query used a deprecated function: `id`.
11:04:35,235 WARN BoltResponse Neo.ClientNotification.Statement.FeatureDeprecationWarning: This feature is deprecated and will be removed in future versions.
UNWIND $rows as row CREATE (n:`Node`:`ObjectType`) SET n=row.props RETURN row.nodeRef as ref, ID(n) as id, $type as type
^
The query used a deprecated function: `id`.
11:04:35,274 WARN BoltResponse Neo.ClientNotification.Statement.FeatureDeprecationWarning: This feature is deprecated and will be removed in future versions.
UNWIND $rows as row CREATE (n:`CompoundStatement`:`Node`) SET n=row.props RETURN row.nodeRef as ref, ID(n) as id, $type as type
^
The query used a deprecated function: `id`.
11:04:35,282 WARN BoltResponse Neo.ClientNotification.Statement.FeatureDeprecationWarning: This feature is deprecated and will be removed in future versions.
UNWIND $rows as row CREATE (n:`Node`:`PointerType`) SET n=row.props RETURN row.nodeRef as ref, ID(n) as id, $type as type
^
The query used a deprecated function: `id`.
11:04:35,294 WARN BoltResponse Neo.ClientNotification.Statement.FeatureDeprecationWarning: This feature is deprecated and will be removed in future versions.
UNWIND $rows as row CREATE (n:`CLanguage`:`Node`) SET n=row.props RETURN row.nodeRef as ref, ID(n) as id, $type as type
^
The query used a deprecated function: `id`.
11:04:35,298 WARN BoltResponse Neo.ClientNotification.Statement.FeatureDeprecationWarning: This feature is deprecated and will be removed in future versions.
UNWIND $rows as row CREATE (n:`Component`:`Node`) SET n=row.props RETURN row.nodeRef as ref, ID(n) as id, $type as type
^
The query used a deprecated function: `id`.
11:04:35,334 WARN BoltResponse Neo.ClientNotification.Statement.FeatureDeprecationWarning: This feature is deprecated and will be removed in future versions.
UNWIND $rows as row CREATE (n:`BlockScope`:`Scope`:`ValueDeclarationScope`) SET n=row.props RETURN row.nodeRef as ref, ID(n) as id, $type as type
^
The query used a deprecated function: `id`.
11:04:35,340 WARN BoltResponse Neo.ClientNotification.Statement.FeatureDeprecationWarning: This feature is deprecated and will be removed in future versions.
UNWIND $rows as row CREATE (n:`GlobalScope`:`Scope`:`StructureDeclarationScope`:`ValueDeclarationScope`) SET n=row.props RETURN row.nodeRef as ref, ID(n) as id, $type as type
^
The query used a deprecated function: `id`.
11:04:35,345 WARN BoltResponse Neo.ClientNotification.Statement.FeatureDeprecationWarning: This feature is deprecated and will be removed in future versions.
UNWIND $rows as row CREATE (n:`ForStatement`:`Node`) SET n=row.props RETURN row.nodeRef as ref, ID(n) as id, $type as type
^
The query used a deprecated function: `id`.
11:04:35,395 WARN BoltResponse Neo.ClientNotification.Statement.FeatureDeprecationWarning: This feature is deprecated and will be removed in future versions.
UNWIND $rows as row CREATE (n:`DeclaredReferenceExpression`:`Node`) SET n=row.props RETURN row.nodeRef as ref, ID(n) as id, $type as type
^
The query used a deprecated function: `id`.
11:04:35,432 WARN BoltResponse Neo.ClientNotification.Statement.FeatureDeprecationWarning: This feature is deprecated and will be removed in future versions.
UNWIND $rows as row CREATE (n:`FunctionDeclaration`:`Node`) SET n=row.props RETURN row.nodeRef as ref, ID(n) as id, $type as type
^
The query used a deprecated function: `id`.
11:04:35,466 WARN BoltResponse Neo.ClientNotification.Statement.FeatureDeprecationWarning: This feature is deprecated and will be removed in future versions.
UNWIND $rows as row CREATE (n:`FunctionType`:`Node`) SET n=row.props RETURN row.nodeRef as ref, ID(n) as id, $type as type
^
The query used a deprecated function: `id`.
11:04:35,495 WARN BoltResponse Neo.ClientNotification.Statement.FeatureDeprecationWarning: This feature is deprecated and will be removed in future versions.
UNWIND $rows as row CREATE (n:`Node`:`UnaryOperator`) SET n=row.props RETURN row.nodeRef as ref, ID(n) as id, $type as type
^
The query used a deprecated function: `id`.
11:04:35,523 WARN BoltResponse Neo.ClientNotification.Statement.FeatureDeprecationWarning: This feature is deprecated and will be removed in future versions.
UNWIND $rows as row CREATE (n:`CallExpression`:`Node`) SET n=row.props RETURN row.nodeRef as ref, ID(n) as id, $type as type
^
The query used a deprecated function: `id`.
11:04:35,546 WARN BoltResponse Neo.ClientNotification.Statement.FeatureDeprecationWarning: This feature is deprecated and will be removed in future versions.
UNWIND $rows as row CREATE (n:`IncompleteType`:`Node`) SET n=row.props RETURN row.nodeRef as ref, ID(n) as id, $type as type
^
The query used a deprecated function: `id`.
11:04:35,549 WARN BoltResponse Neo.ClientNotification.Statement.FeatureDeprecationWarning: This feature is deprecated and will be removed in future versions.
UNWIND $rows as row CREATE (n:`LoopScope`:`Scope`:`ValueDeclarationScope`) SET n=row.props RETURN row.nodeRef as ref, ID(n) as id, $type as type
^
The query used a deprecated function: `id`.
11:04:35,552 WARN BoltResponse Neo.ClientNotification.Statement.FeatureDeprecationWarning: This feature is deprecated and will be removed in future versions.
UNWIND $rows as row CREATE (n:`Node`:`UnknownType`) SET n=row.props RETURN row.nodeRef as ref, ID(n) as id, $type as type
^
The query used a deprecated function: `id`.
11:04:35,576 WARN BoltResponse Neo.ClientNotification.Statement.FeatureDeprecationWarning: This feature is deprecated and will be removed in future versions.
UNWIND $rows as row CREATE (n:`Node`:`ReturnStatement`) SET n=row.props RETURN row.nodeRef as ref, ID(n) as id, $type as type
^
The query used a deprecated function: `id`.
11:04:35,593 WARN BoltResponse Neo.ClientNotification.Statement.FeatureDeprecationWarning: This feature is deprecated and will be removed in future versions.
UNWIND $rows as row CREATE (n:`ArraySubscriptionExpression`:`Node`) SET n=row.props RETURN row.nodeRef as ref, ID(n) as id, $type as type
^
The query used a deprecated function: `id`.
11:04:35,599 WARN BoltResponse Neo.ClientNotification.Statement.FeatureDeprecationWarning: This feature is deprecated and will be removed in future versions.
UNWIND $rows as row CREATE (n:`CastExpression`:`Node`) SET n=row.props RETURN row.nodeRef as ref, ID(n) as id, $type as type
^
The query used a deprecated function: `id`.
java.lang.IllegalArgumentException: Numeric value (9223372036854775808) out of range of long (-9223372036854775808 - 9223372036854775807)
at [Source: UNKNOWN; byte offset: #UNKNOWN]
at com.fasterxml.jackson.databind.ObjectMapper._convert(ObjectMapper.java:4544)
at com.fasterxml.jackson.databind.ObjectMapper.convertValue(ObjectMapper.java:4485)
at org.neo4j.ogm.driver.ParameterConversion$DefaultParameterConversion.convertParameters(ParameterConversion.java:51)
at org.neo4j.ogm.drivers.bolt.request.BoltRequest.executeRequest(BoltRequest.java:174)
at org.neo4j.ogm.drivers.bolt.request.BoltRequest.execute(BoltRequest.java:103)
at org.neo4j.ogm.session.request.RequestExecutor.executeStatements(RequestExecutor.java:131)
at org.neo4j.ogm.session.request.RequestExecutor.lambda$executeSave$2(RequestExecutor.java:87)
at org.neo4j.ogm.session.Neo4jSession.lambda$doInTransaction$1(Neo4jSession.java:568)
at org.neo4j.ogm.session.Neo4jSession.doInTransaction(Neo4jSession.java:600)
at org.neo4j.ogm.session.Neo4jSession.doInTransaction(Neo4jSession.java:567)
at org.neo4j.ogm.session.request.RequestExecutor.executeSave(RequestExecutor.java:80)
at org.neo4j.ogm.session.delegates.SaveDelegate.save(SaveDelegate.java:90)
at org.neo4j.ogm.session.Neo4jSession.save(Neo4jSession.java:495)
at de.fraunhofer.aisec.cpg_vis_neo4j.Application.pushToNeo4j(Application.kt:259)
at de.fraunhofer.aisec.cpg_vis_neo4j.Application.call(Application.kt:451)
at de.fraunhofer.aisec.cpg_vis_neo4j.Application.call(Application.kt:69)
at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
at picocli.CommandLine.access$1500(CommandLine.java:148)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
at picocli.CommandLine.execute(CommandLine.java:2170)
at de.fraunhofer.aisec.cpg_vis_neo4j.ApplicationKt.main(Application.kt:483)
Caused by: com.fasterxml.jackson.core.exc.InputCoercionException: Numeric value (9223372036854775808) out of range of long (-9223372036854775808 - 9223372036854775807)
at [Source: UNKNOWN; byte offset: #UNKNOWN]
at com.fasterxml.jackson.core.base.ParserMinimalBase._reportInputCoercion(ParserMinimalBase.java:638)
at com.fasterxml.jackson.core.base.ParserMinimalBase.reportOverflowLong(ParserMinimalBase.java:630)
at com.fasterxml.jackson.core.base.ParserMinimalBase.reportOverflowLong(ParserMinimalBase.java:625)
at com.fasterxml.jackson.core.base.ParserMinimalBase.reportOverflowLong(ParserMinimalBase.java:620)
at com.fasterxml.jackson.databind.util.TokenBuffer$Parser._convertNumberToLong(TokenBuffer.java:1993)
at com.fasterxml.jackson.databind.util.TokenBuffer$Parser.getLongValue(TokenBuffer.java:1868)
at com.fasterxml.jackson.databind.deser.std.StdDeserializer._coerceIntegral(StdDeserializer.java:1711)
at com.fasterxml.jackson.databind.deser.std.UntypedObjectDeserializerNR._deserializeNR(UntypedObjectDeserializerNR.java:249)
at com.fasterxml.jackson.databind.deser.std.UntypedObjectDeserializerNR.deserialize(UntypedObjectDeserializerNR.java:79)
at com.fasterxml.jackson.databind.deser.std.MapDeserializer._readAndBindStringKeyMap(MapDeserializer.java:623)
at com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:449)
at com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:32)
at com.fasterxml.jackson.databind.ObjectMapper._convert(ObjectMapper.java:4539)
... 24 more
Code of interest
...
u64 MUL64x(u64 V, u64 c)
{
if ( V & 0x8000000000000000 )
return (V << 1) ^ c;
else
return V << 1;
}
...
Export of the CPG into Neo4J fails for numeric arguments too big to be interpreted as long values. The example is taken from Nucleus.
This usually happens when the code contains binary logic operators (like
&
or|
applying a bitmask)Stack trace
Code of interest