Hi Bryan,

I tried sending the following earlier today, but it appears I was having issues 
with the mailing list.

I started looking into the issue myself. I bisected one of the issues to a 
change in https://github.com/apache/arrow/pull/8533 and asked the author about 
the check that seemed to be causing the issue 
(https://github.com/apache/arrow/pull/8533#issuecomment-721815501). Benjamin 
replied back as you can see in the thread and it looks like the `DCHECK_NE` 
line can be removed. Locally, I'm also seeing another issue I'm starting to 
debug, but the following diff "fixes" the builder for me locally:

diff --git a/cpp/src/arrow/io/memory.cc b/cpp/src/arrow/io/memory.cc
index 1cde5e64e..88f006fe0 100644
--- a/cpp/src/arrow/io/memory.cc
+++ b/cpp/src/arrow/io/memory.cc
@@ -54,7 +54,7 @@ BufferOutputStream::BufferOutputStream(const 
std::shared_ptr<ResizableBuffer>& b
 Result<std::shared_ptr<BufferOutputStream>> BufferOutputStream::Create(
     int64_t initial_capacity, MemoryPool* pool) {
   // ctor is private, so cannot use make_shared
-  DCHECK_NE(pool, nullptr);
   auto ptr = std::shared_ptr<BufferOutputStream>(new BufferOutputStream);
   RETURN_NOT_OK(ptr->Reset(initial_capacity, pool));
   return ptr;
diff --git 
a/java/flight/flight-core/src/test/java/org/apache/arrow/flight/TestDoExchange.java
 
b/java/flight/flight-core/src/test/java/org/apache/arrow/flight/TestDoExchange.java
index b7e7a20be..04383c476 100644
--- 
a/java/flight/flight-core/src/test/java/org/apache/arrow/flight/TestDoExchange.java
+++ 
b/java/flight/flight-core/src/test/java/org/apache/arrow/flight/TestDoExchange.java
@@ -303,7 +303,7 @@ public class TestDoExchange {
       final FlightStream reader = stream.getReader();
       reader.cancel("", null);
       // Cancel should be idempotent
-      reader.cancel("", null);
     }
   }

The second change is due to the test suite throwing an exception about the test 
having a memory leak, and could also be related to 
https://github.com/apache/arrow/pull/8533 since that updates memory allocation.

Update: Since then I've identified that the nullptr is coming from 
https://github.com/apache/arrow/blob/3eb6e69d9c1ff34978d138bb8848a36cb938cec6/cpp/src/jni/orc/jni_wrapper.cpp#L229
 and I can both remove the check which was causing the segfault, but also 
propose not using a nullptr explicitly and use `arrow::default_memory_pool()` 
which is used elsewhere in the JNI wrapper.

I was just running the tests with the adjusted JNI wrapper and going to see if 
that fixed the other error I was seeing about the memory leaking.

-Terence

On 2020/11/03 20:53:59, Bryan Cutler <cutl...@gmail.com> wrote: 
> There seems to be a Github check error with the Java JNI tests for the ORC
> adapter that is affecting a lot of recent PRs, see
> https://github.com/apache/arrow/pull/8577/checks?check_run_id=1346780145.
> From the log, it looks like some env setting, but I can't tell what's
> wrong. Anyone else know?
> 
> Thanks,
> Bryan
> 

Reply via email to