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
[C#] Arrow R/C++ hangs reading binary file generated by C# #23030
Comments
Anthony Abate / @abbotware: |
Anthony Abate / @abbotware: |
Neal Richardson / @nealrichardson: All source code is available at https://github.com/apache/arrow. |
Anthony Abate / @abbotware: library(arrow) dfcs <- read_arrow("e: end_memory <- memory.size() print(end_memory) |
Anthony Abate / @abbotware: system 8 cores (virtual) |
Wes McKinney / @wesm: |
Wes McKinney / @wesm: |
Anthony Abate / @abbotware: |
Wes McKinney / @wesm: What is the schema of the file? |
Eric Erhardt / @eerhardt: |
Neal Richardson / @nealrichardson: > system.time(tab <- read_arrow("Generated_4000Batch_50Columns_100Rows_PerBatch.arrow"))
user system elapsed
1.10 3.96 8.69
> dim(tab)
[1] 400000 50
> sessionInfo()
R version 3.6.0 (2019-04-26)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] arrow_0.14.1.9000
loaded via a namespace (and not attached):
[1] tidyselect_0.2.5 bit_1.1-14 compiler_3.6.0 magrittr_1.5 assertthat_0.2.1 R6_2.4.0
[7] tools_3.6.0 glue_1.3.1 Rcpp_1.0.1 bit64_0.9-7 rlang_0.3.4 purrr_0.3.2
> Would you mind installing a nightly build of the R package and see if whatever you're seeing has been resolved in the master branch? install.packages("arrow", repos="https://dl.bintray.com/ursalabs/arrow-r") |
Anthony Abate / @abbotware: |
Anthony Abate / @abbotware: |
Neal Richardson / @nealrichardson: |
Anthony Abate / @abbotware:
|
Anthony Abate / @abbotware: |
Anthony Abate / @abbotware: other than is there a version number I can print out via runtime to make sure im using the new code? |
Wes McKinney / @wesm: |
Anthony Abate / @abbotware: |
Neal Richardson / @nealrichardson: |
Wes McKinney / @wesm: In [3]: pa.ipc.open_file('Generated_4000Batch_50Columns_100Rows_PerBatch.arrow').read_all()
../src/arrow/ipc/reader.cc:683: Check failed: BitUtil::IsMultipleOf8(block.metadata_length)
/home/wesm/local/lib/libarrow.so.15(_ZN5arrow4util7CerrLog14PrintBackTraceEv+0x35)[0x7f4a9cd494dd]
/home/wesm/local/lib/libarrow.so.15(_ZN5arrow4util7CerrLogD1Ev+0x5b)[0x7f4a9cd4945f]
/home/wesm/local/lib/libarrow.so.15(_ZN5arrow4util7CerrLogD0Ev+0x18)[0x7f4a9cd49480]
/home/wesm/local/lib/libarrow.so.15(_ZN5arrow4util8ArrowLogD1Ev+0x57)[0x7f4a9cd492c1]
/home/wesm/local/lib/libarrow.so.15(+0x18e9a60)[0x7f4a9d34fa60]
/home/wesm/local/lib/libarrow.so.15(+0x18ea26b)[0x7f4a9d35026b]
/home/wesm/local/lib/libarrow.so.15(_ZN5arrow3ipc21RecordBatchFileReader15ReadRecordBatchEiPSt10shared_ptrINS_11RecordBatchEE+0x48)[0x7f4a9d349f76]
/home/wesm/code/arrow/python/pyarrow/lib.cpython-37m-x86_64-linux-gnu.so(+0x2a4115)[0x7f4a9e088115]
/home/wesm/code/arrow/python/pyarrow/lib.cpython-37m-x86_64-linux-gnu.so(+0x2a21e4)[0x7f4a9e0861e4]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyMethodDef_RawFastCallKeywords+0x141)[0x56025cd81651]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyMethodDescr_FastCallKeywords+0x4f)[0x56025cd89cdf]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyEval_EvalFrameDefault+0x4cbc)[0x56025cdeedac]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyEval_EvalCodeWithName+0x2f9)[0x56025cd2f929]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(PyEval_EvalCodeEx+0x44)[0x56025cd307e4]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(PyEval_EvalCode+0x1c)[0x56025cd3080c]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(+0x1e0c70)[0x56025cdf9c70]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyMethodDef_RawFastCallKeywords+0xe9)[0x56025cd815f9]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyCFunction_FastCallKeywords+0x21)[0x56025cd81891]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyEval_EvalFrameDefault+0x47d4)[0x56025cdee8c4]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyGen_Send+0x2a2)[0x56025cd8aea2]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyEval_EvalFrameDefault+0x1acc)[0x56025cdebbbc]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyGen_Send+0x2a2)[0x56025cd8aea2]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyEval_EvalFrameDefault+0x1acc)[0x56025cdebbbc]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyGen_Send+0x2a2)[0x56025cd8aea2]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyMethodDef_RawFastCallKeywords+0x8c)[0x56025cd8159c]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyMethodDescr_FastCallKeywords+0x4f)[0x56025cd89cdf]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyEval_EvalFrameDefault+0x4cbc)[0x56025cdeedac]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyFunction_FastCallKeywords+0xfb)[0x56025cd80cfb]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyEval_EvalFrameDefault+0x416)[0x56025cdea506]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyFunction_FastCallKeywords+0xfb)[0x56025cd80cfb]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyEval_EvalFrameDefault+0x6f0)[0x56025cdea7e0]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyEval_EvalCodeWithName+0x2f9)[0x56025cd2f929]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyFunction_FastCallKeywords+0x387)[0x56025cd80f87]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyEval_EvalFrameDefault+0x14dc)[0x56025cdeb5cc]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyEval_EvalCodeWithName+0x2f9)[0x56025cd2f929]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyFunction_FastCallKeywords+0x325)[0x56025cd80f25]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyEval_EvalFrameDefault+0x6f0)[0x56025cdea7e0]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyEval_EvalCodeWithName+0x2f9)[0x56025cd2f929]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyFunction_FastCallKeywords+0x325)[0x56025cd80f25]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyEval_EvalFrameDefault+0x6f0)[0x56025cdea7e0]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyFunction_FastCallKeywords+0xfb)[0x56025cd80cfb]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyEval_EvalFrameDefault+0x6f0)[0x56025cdea7e0]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyEval_EvalCodeWithName+0x2f9)[0x56025cd2f929]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyFunction_FastCallDict+0x400)[0x56025cd30c20]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyObject_Call_Prepend+0x63)[0x56025cd4fe23]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(PyObject_Call+0x6e)[0x56025cd4251e]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyEval_EvalFrameDefault+0x1f4c)[0x56025cdec03c]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyEval_EvalCodeWithName+0x2f9)[0x56025cd2f929]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyFunction_FastCallKeywords+0x387)[0x56025cd80f87]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyEval_EvalFrameDefault+0x416)[0x56025cdea506]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_PyEval_EvalCodeWithName+0x2f9)[0x56025cd2f929]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(PyEval_EvalCodeEx+0x44)[0x56025cd307e4]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(PyEval_EvalCode+0x1c)[0x56025cd3080c]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(+0x22fac4)[0x56025ce48ac4]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(PyRun_FileExFlags+0xa1)[0x56025ce52db1]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(PyRun_SimpleFileExFlags+0x1c3)[0x56025ce52fa3]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(+0x23b0bf)[0x56025ce540bf]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(_Py_UnixMain+0x3c)[0x56025ce541dc]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7f4acfb0bb97]
/home/wesm/miniconda/envs/arrow-3.7/bin/python(+0x1e0d3d)[0x56025cdf9d3d]
Aborted These issues would be caught in integration tests. All of this points to a problem in the C# library |
Eric Erhardt / @eerhardt: @abbotware - which version of the C# library were you using to produce the file? was it |
Anthony Abate / @abbotware:
@wesm @nealrichardson - this looks/behaves like a threading issue - I don't get any hanging if i reduce the VM to 1 core (not ideal) (I can't explain the core dumps though) |
Anthony Abate / @abbotware: I would point out that I was able to validate a 30 million row x 37 column data set produced by C# in R including the null support I added. The only indication of any issue was a very rare hang on first use of the library in R Studio - if it didn't hang the first time, i was able to do many file loads of 10gb without issue I was attempting to narrow down that rare hang when it seemed to be a column width issue |
Wes McKinney / @wesm: Once we have a valid file to look at we can begin to diagnose other issues that come up. |
Wes McKinney / @wesm: I tried reading the file 100 times in release builds in Python on both 0.14.1 and master on Linux and had no issues. With R I tested the master branch and also read the file more than 10 times. So definitely inconclusive... I'll look out to learn more if you're able to reproduce the issue and track down what might be going wrong |
Anthony Abate / @abbotware: > sessionInfo()R version 3.6.1 (2019-07-05) Matrix products: default locale: attached base packages: other attached packages: loaded via a namespace (and not attached): |
Anthony Abate / @abbotware: |
Neal Richardson / @nealrichardson: |
Anthony Abate / @abbotware: this is the script runner code I am using:
{{For ($i=0; $i -le 10000; $i++) }}
|
Anthony Abate / @abbotware: |
Anthony Abate / @abbotware:
|
Eric Erhardt / @eerhardt:
checked
The doc https://arrow.apache.org/docs/format/IPC.html#recordbatch-body-structure clearly states this should be a multiple of 8, and it includes the length prefix.
I am working on a fix. |
Anthony Abate / @abbotware:
|
Neal Richardson / @nealrichardson: cf. Lines 42 to 44 in a89c803
|
Anthony Abate / @abbotware: |
Wes McKinney / @wesm: |
Wes McKinney / @wesm: |
Anthony Abate / @abbotware: @eerhardt - Is there a pre-release nuget that I can test out? |
No, you would have to build one yourself. It looks like this change will be included in |
Wes McKinney / @wesm: |
I get random hangs on arrow_read in R (windows) when using a very large file (10-12gb). (the file has 37 columns)
I have memory dumps - All threads seem to be in wait handles.
Are there debug symbols somewhere?
Is there a way to get the C++ code to produce diagnostic logging from R?
UPDATE: it seems that the hangs are not related to file size, row counts, or # of record batches, but rather the number of columns
Reporter: Anthony Abate / @abbotware
Assignee: Eric Erhardt / @eerhardt
Original Issue Attachments:
PRs and other links:
Note: This issue was originally created as ARROW-6682. Please see the migration documentation for further details.
The text was updated successfully, but these errors were encountered: