You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Adam Hooper (Jira)" <ji...@apache.org> on 2020/09/18 17:58:00 UTC

[jira] [Commented] (ARROW-10033) ArrowReaderProperties creates thread pool, even when use_threads=False and pre_buffer=False

    [ https://issues.apache.org/jira/browse/ARROW-10033?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17198476#comment-17198476 ] 

Adam Hooper commented on ARROW-10033:
-------------------------------------

I think this should be "Major" because it nudges towards a segfault on the simplest possible program:

{noformat}
#include <parquet/arrow/reader.h>

int main(int argc, char** argv) {
  parquet::ArrowReaderProperties arrowReaderProperties(false); // do not use threads
  return 0;
}
{noformat}

Expected return code: 0
Actual return code: segfault

(Docker, Linux 5.8.4-200.fc32.x86_64, GCC Debian 8.3.0-6, linker flags {{-rdynamic main.cc.o -o parquet-to-arrow -static /usr/local/lib/libparquet.a /usr/local/lib/libarrow.a -lsnappy -pthread /usr/local/lib/libarrow_bundled_dependencies.a}})

Perhaps this is because {{ThreadPool}} doesn't call {{pthread_join}} in its dtor? I'm not sure. But nixing the {{async_context_}} member certainly fixes the segfault.

> ArrowReaderProperties creates thread pool, even when use_threads=False and pre_buffer=False
> -------------------------------------------------------------------------------------------
>
>                 Key: ARROW-10033
>                 URL: https://issues.apache.org/jira/browse/ARROW-10033
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: C++
>    Affects Versions: 1.0.1
>            Reporter: Adam Hooper
>            Priority: Minor
>
> {{ArrowReaderProperties}} has a {{::arrow::io::AsyncContext async_context_;}} member. Its constructor creates a thread pool -- regardless of options.
> As a caller, I expect {{!use_threads}} to prevent the creation of a thread pool. (Maybe there should be an exception if {{pre_buffer && !use_threads}}?)
> Stack trace:
> {noformat}
> #0  arrow::internal::ThreadPool::ThreadPool (this=0x232fa90) at /src/apache-arrow-1.0.1/cpp/src/arrow/util/thread_pool.cc:121
> #1  0x00000000008e4747 in arrow::internal::ThreadPool::Make (threads=8)
>     at /src/apache-arrow-1.0.1/cpp/src/arrow/util/thread_pool.cc:246
> #2  0x00000000008e48c9 in arrow::internal::ThreadPool::MakeEternal (threads=8)
>     at /src/apache-arrow-1.0.1/cpp/src/arrow/util/thread_pool.cc:252
> #3  0x00000000008a20ac in arrow::io::internal::MakeIOThreadPool () at /src/apache-arrow-1.0.1/cpp/src/arrow/io/interfaces.cc:326
> #4  0x00000000008a21dd in arrow::io::internal::GetIOThreadPool () at /src/apache-arrow-1.0.1/cpp/src/arrow/io/interfaces.cc:334
> #5  0x00000000008a064f in arrow::io::AsyncContext::AsyncContext (
>     this=0xea6bb0 <parquet::default_arrow_reader_properties()::default_reader_props+80>)
>     at /src/apache-arrow-1.0.1/cpp/src/arrow/io/interfaces.cc:49
> #6  0x000000000048893e in parquet::ArrowReaderProperties::ArrowReaderProperties (
>     this=0xea6b60 <parquet::default_arrow_reader_properties()::default_reader_props>, use_threads=false)
>     at /src/apache-arrow-1.0.1/cpp/src/parquet/properties.h:579
> #7  0x00000000005e1b98 in parquet::default_arrow_reader_properties () at /src/apache-arrow-1.0.1/cpp/src/parquet/properties.cc:53
> #8  0x0000000000414843 in parquet::arrow::FileReaderBuilder::FileReaderBuilder (this=0x7fffb31f0c60)
>     at /src/apache-arrow-1.0.1/cpp/src/parquet/arrow/reader.cc:930
> #9  0x0000000000414b10 in parquet::arrow::OpenFile (file=..., pool=0xea6cf0 <arrow::jemalloc_pool>, reader=0x7fffb31f0e08)
>     at /src/apache-arrow-1.0.1/cpp/src/parquet/arrow/reader.cc:957
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)