Repository navigation
Description
When using SQLancer with the JVM below (e.g., using a command such as java -jar sqlancer-2.0.0.jar duckdb), everything seems to work fine.
openjdk 11.0.18 2023-01-17
OpenJDK Runtime Environment (build 11.0.18+10-post-Ubuntu-0ubuntu122.04)
OpenJDK 64-Bit Server VM (build 11.0.18+10-post-Ubuntu-0ubuntu122.04, mixed mode, sharing)
If I now use the JVM below, I get a ParameterException as shown further below.
openjdk 17.0.6 2023-01-17
OpenJDK Runtime Environment Temurin-17.0.6+10 (build 17.0.6+10)
OpenJDK 64-Bit Server VM Temurin-17.0.6+10 (build 17.0.6+10, mixed mode)
Edit: This is the JDK used by the latest Eclipse, to which I imported SQLancer as a Maven project. Perhaps the issue could be environment-specific.
Exception in thread "main" com.beust.jcommander.ParameterException: Was passed main parameter 'duckdb' but no main parameter was defined in your arg class
at com.beust.jcommander.JCommander.initMainParameterValue(JCommander.java:961)
at com.beust.jcommander.JCommander.parseValues(JCommander.java:762)
at com.beust.jcommander.JCommander.parse(JCommander.java:363)
at com.beust.jcommander.JCommander.parse(JCommander.java:342)
at sqlancer.Main.executeMain(Main.java:467)
at sqlancer.Main.main(Main.java:296)
This seems related to the ServiceLoader that we are using. Starting SQLancer with no options (java -jar sqlancer-2.0.0.jar) shows that no providers were loaded since only general options are shown:
Usage: SQLancer [options]
Options:
--constant-cache-size
Specifies the size of the constant cache. This option only takes effect
when constant caching is enabled
Default: 100
--database-prefix
The prefix used for each database created
Default: database
...
--use-constant-caching
Specifies whether constants should be cached and re-used with a certain
probability
Default: true
--use-reducer
EXPERIMENTAL Attempt to reduce queries using a simple reducer
Default: false
--username
The user name used to log into the DBMS
Default: sqlancer
A workaround is to use an older Java version (e.g., Java 11). Another workaround would be to manually add the providers. For example, above line 612 in the main class (see
sqlancer/src/sqlancer/Main.java
Line 612 in e418489
| return providers; |
providers.add(new DuckDBProvider());. Neither is a satisfactory long-term solution, so we should fix this.
Activity
oraluben commentedon Jun 7, 2023
Was this happening when launching sqlancer in Eclipse?
mrigger commentedon Jun 7, 2023
Yes, I've updated the issue description already.
oraluben commentedon Jun 7, 2023
Sounds like that Eclipse's inserted some debug/diagnosis args. What's the actual arguments that the main function get?
mrigger commentedon Jun 7, 2023
Here is the full command line for WSL+Ubuntu (I can also reproduce this on Ubuntu directly).
oraluben commentedon Jun 7, 2023
as in #800 (review),
Here's information in Idea:
Add profiles in Maven to allow for dynamic build of specific DBMS.
isaacchua commentedon Aug 13, 2025
I tried to reproduce the problem with Temurin 17.0.6+10 but it didn't occur (see the logs below). I don't think the issue is caused by Temurin 17.0.6+10 per se.
Here is what I did:
jvm17.dockerfile:dockerorpodman:isaacchua commentedon Aug 13, 2025
To be clear, the issue 799 error was not seen:
Which means that the
DatabaseProviderclasses loaded with theServiceLoaderas expected.