Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected error Self-suppression not permitted, only appear recently #825

Open
DerZc opened this issue Jun 16, 2023 · 3 comments
Open

Unexpected error Self-suppression not permitted, only appear recently #825

DerZc opened this issue Jun 16, 2023 · 3 comments

Comments

@DerZc
Copy link

DerZc commented Jun 16, 2023

Does anyone meet the Self-suppression not permitted error recently, I guess it was caused by the IgnoreMeException() we threw in a try clause.

I first met this error when I update the MacOS version in my laptop, but do not update the Java version.
I fixed this error in my local repository by transforming the code like:

try (Statement s = con.createStatement()) {
    ...
} catch (SQLException e) {
    throw new IgnoreMeException();
}

to

Statement s = null;
try {
    s = con.createStatement();
    ...
} catch (SQLException e) {
    throw new IgnoreMeException();
} finally {
    if (s!=null) {
        s.close();
    }
}

But I think this is not the best solution and don't know the reason of this error. Does anyone have idea about this?

This is the entire log provided by @bajinsheng, he also met this error in an Ubuntu server recently.

--java.lang.IllegalArgumentException: Self-suppression not permitted
--      at java.base/java.lang.Throwable.addSuppressed(Throwable.java:1054)
--      at sqlancer.Main$DBMSExecutor.run(Main.java:412)
--      at sqlancer.Main$2.run(Main.java:582)
--      at sqlancer.Main$2.runThread(Main.java:564)
--      at sqlancer.Main$2.run(Main.java:555)
--      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
--      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
--      at java.base/java.lang.Thread.run(Thread.java:829)
--Caused by: sqlancer.IgnoreMeException
--      at sqlancer.tidb.TiDBExpressionGenerator.generateExpression(TiDBExpressionGenerator.java:67)
--      at sqlancer.tidb.TiDBExpressionGenerator.generateExpression(TiDBExpressionGenerator.java:105)
--      at sqlancer.tidb.TiDBExpressionGenerator.generateExpression(TiDBExpressionGenerator.java:1)
--      at sqlancer.common.gen.UntypedExpressionGenerator.generateExpression(UntypedExpressionGenerator.java:14)
--      at sqlancer.tidb.gen.TiDBTableGenerator.createNewTable(TiDBTableGenerator.java:75)
--      at sqlancer.tidb.gen.TiDBTableGenerator.getQuery(TiDBTableGenerator.java:55)
--      at sqlancer.tidb.TiDBProvider.generateDatabase(TiDBProvider.java:114)
--      at sqlancer.tidb.TiDBProvider.generateDatabase(TiDBProvider.java:1)
--      at sqlancer.ProviderAdapter.generateAndTestDatabase(ProviderAdapter.java:52)
--      at sqlancer.Main$DBMSExecutor.run(Main.java:387)
--      ... 6 more
--
-- Time: 2023/06/16 10:05:41
-- Database: database0
-- Database version: 8.0.11-TiDB-v7.2.0-alpha-440-g8633c8ce99
-- seed value: 1686881141425
USE test;
DROP DATABASE IF EXISTS database0;
CREATE DATABASE database0;
USE database0;
@mrigger
Copy link
Contributor

mrigger commented Jun 16, 2023

Does this occur only with TiDB? If so, perhaps @hawkingrei has an idea why this could happen?

@DerZc
Copy link
Author

DerZc commented Jun 16, 2023

Not only TiDB, but also SQLite, DuckDB, CockroachDB, and MySQL. I just tried these DBMSs and all of them triggered this bug, so I guess this is not the issue of TiDB.

@bajinsheng
Copy link
Collaborator

It's a Java restriction that does not allow throw another exception in catch or final blocks. The rule was introduced in Java7, but we haven't not figured out why the code worked previously.
Note that we only observed this in our local different environments respectively, not in CI. Not sure it is due to some confugrations of Java.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants