duckdb / duckdb/duckdb-java

Loading extensions conflicts with JVM in debug mode

Open
#593 10 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
127
Forks
80
Avg merge
13h 49m
Merged PRs (30d)
48

Description

When extensions (like httpfs) are loaded via duckdb-jdbc driver when the JVM is running in debug mode, it somehow breaks instrumentation agent attachment.

This manifests as a crash when libraries like bytebuddy-agent attempt attaching to the running JVM. Consequently, other libraries and frameworks like mockito and spring that depend on bytebuddy-agent also crash.

Sample code to demonstrate the issue: https://github.com/juja0/duckdb-httpfs-java-debug-issue

Note: The code in the link above needs to be executed in debug mode to trigger the issue.

Observations

- Initially noticed in duckdb_jdbc 1.3.2.0 but also happens in 1.4.4.0
- Unsure if it happens on versions prior to duckdb_jdbc 1.3.2.0
- Happens when calling ByteBuddyAgent.install
- ByteBuddyAgent version doesn't seem to matter. Happens on a fairly old version and also in the latest version.
- Happens only if duckdb loads httpfs extension before installing ByteBuddyAgent. If the order is flipped, it works fine.
- Happens on httpfs and aws extensions but not on ducklake extension
- Happens only when run in debug mode.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.