-
Notifications
You must be signed in to change notification settings - Fork 314
feat: enable debug assertions in CI profile, fix unaligned memory access bug #3652
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
21d850b
feat: enable debug assertions in CI profile and RUST_BACKTRACE in wor…
andygrove d3c31b5
feat: set panic=unwind in CI profile to capture debug assertion messages
andygrove 4f4caed
feat: catch panics across FFI boundary and log to stderr
andygrove 8399c5a
fix: use unaligned reads for null bitset in SparkUnsafeRow/Array
andygrove 343ec1c
fix: remove miri ignore now that unaligned access is fixed
andygrove File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,6 +41,7 @@ on: | |
|
|
||
| env: | ||
| RUST_VERSION: stable | ||
| RUST_BACKTRACE: 1 | ||
|
|
||
| jobs: | ||
| benchmark-check: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,6 +48,7 @@ on: | |
|
|
||
| env: | ||
| RUST_VERSION: stable | ||
| RUST_BACKTRACE: 1 | ||
|
|
||
| jobs: | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,6 +48,7 @@ on: | |
|
|
||
| env: | ||
| RUST_VERSION: stable | ||
| RUST_BACKTRACE: 1 | ||
|
|
||
| jobs: | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,6 +54,7 @@ on: | |
|
|
||
| env: | ||
| RUST_VERSION: stable | ||
| RUST_BACKTRACE: 1 | ||
|
|
||
| jobs: | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,7 @@ on: | |
|
|
||
| env: | ||
| RUST_VERSION: stable | ||
| RUST_BACKTRACE: 1 | ||
|
|
||
| jobs: | ||
| spark-sql-catalyst-native-datafusion: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,7 @@ on: | |
|
|
||
| env: | ||
| RUST_VERSION: stable | ||
| RUST_BACKTRACE: 1 | ||
|
|
||
| jobs: | ||
| spark-sql-catalyst-native-iceberg-compat: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,7 +29,7 @@ use crate::{ | |
| use arrow::array::{Array, RecordBatch, UInt32Array}; | ||
| use arrow::compute::{take, TakeOptions}; | ||
| use arrow::datatypes::DataType as ArrowDataType; | ||
| use datafusion::common::{Result as DataFusionResult, ScalarValue}; | ||
| use datafusion::common::{DataFusionError, Result as DataFusionResult, ScalarValue}; | ||
| use datafusion::execution::disk_manager::DiskManagerMode; | ||
| use datafusion::execution::memory_pool::MemoryPool; | ||
| use datafusion::execution::runtime_env::RuntimeEnvBuilder; | ||
|
|
@@ -59,6 +59,7 @@ use datafusion_spark::function::string::concat::SparkConcat; | |
| use datafusion_spark::function::string::space::SparkSpace; | ||
| use futures::poll; | ||
| use futures::stream::StreamExt; | ||
| use futures::FutureExt; | ||
| use jni::objects::JByteBuffer; | ||
| use jni::sys::{jlongArray, JNI_FALSE}; | ||
| use jni::{ | ||
|
|
@@ -570,10 +571,29 @@ pub unsafe extern "system" fn Java_org_apache_comet_Native_executePlan( | |
| let (tx, rx) = mpsc::channel(2); | ||
| let mut stream = stream; | ||
| get_runtime().spawn(async move { | ||
| while let Some(batch) = stream.next().await { | ||
| if tx.send(batch).await.is_err() { | ||
| break; | ||
| let result = std::panic::AssertUnwindSafe(async { | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These changes are for catching panics that happen in tokio threads |
||
| while let Some(batch) = stream.next().await { | ||
| if tx.send(batch).await.is_err() { | ||
| break; | ||
| } | ||
| } | ||
| }) | ||
| .catch_unwind() | ||
| .await; | ||
|
|
||
| if let Err(panic) = result { | ||
| let msg = match panic.downcast_ref::<&str>() { | ||
| Some(s) => s.to_string(), | ||
| None => match panic.downcast_ref::<String>() { | ||
| Some(s) => s.clone(), | ||
| None => "unknown panic".to_string(), | ||
| }, | ||
| }; | ||
| let _ = tx | ||
| .send(Err(DataFusionError::Execution(format!( | ||
| "native panic: {msg}" | ||
| )))) | ||
| .await; | ||
| } | ||
| }); | ||
| exec_context.batch_receiver = Some(rx); | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the main change for improving reporting of panics