Skip to content

Java: Bad summary.#11569

Closed
michaelnebel wants to merge 1 commit intogithub:mainfrom
michaelnebel:java/errorinmodel
Closed

Java: Bad summary.#11569
michaelnebel wants to merge 1 commit intogithub:mainfrom
michaelnebel:java/errorinmodel

Conversation

@michaelnebel
Copy link
Copy Markdown
Contributor

This PR is a reproduction example for getting an error message in case the number of elements in the arrays provided as data extensions values do not match the arity of the extensible predicate.

To reproduce, checkout this branch and

codeql test run java/ql/test/library-tests/dataflow/external-models

This leads to the following error message.

Oops! A fatal internal error occurred.
java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
        at com.semmle.inmemory.caching.ExtensionalStoreBase.evaluate(ExtensionalStoreBase.java:84)
        at com.semmle.inmemory.scheduler.ExtensiblePredicateLayer.evaluate(ExtensiblePredicateLayer.java:65)
        at com.semmle.inmemory.scheduler.SimpleLayerTask.evaluate(SimpleLayerTask.java:89)
        at com.semmle.inmemory.scheduler.LayerTask.evaluate(LayerTask.java:251)
        at com.semmle.inmemory.scheduler.ComputingTask.doWork(ComputingTask.java:606)
        at com.semmle.inmemory.scheduler.ComputingTask.doWork(ComputingTask.java:62)
        at com.semmle.inmemory.scheduler.DemandableTask.doWork(DemandableTask.java:381)
        at com.semmle.inmemory.scheduler.ExecutionScheduler.runnerMain(ExecutionScheduler.java:568)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)

@aeisenberg: Would it somehow be possible to improve the error message?

@github-actions github-actions Bot added the Java label Dec 5, 2022
@aeisenberg
Copy link
Copy Markdown
Contributor

Yep. That's not a very informative message.

@aeisenberg
Copy link
Copy Markdown
Contributor

Taking a bit of a deeper look here and I can add a message, but there is a limit to how precise it can be. All we can know is that there is a tuple that does not have the expected number of columns. To get more info here (or to find it earlier before evaluation), we will need to integrate deeper with the compiler, which is not planned for the next quarter.

@michaelnebel michaelnebel deleted the java/errorinmodel branch December 6, 2022 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants