You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "amoeba (via GitHub)" <gi...@apache.org> on 2023/10/01 20:46:48 UTC

[GitHub] [arrow] amoeba opened a new issue, #37969: [R] segfault when writing to ParquetFileWriter after closing

amoeba opened a new issue, #37969:
URL: https://github.com/apache/arrow/issues/37969

   ### Describe the bug, including details regarding any error messages, version, and platform.
   
   Writing to a closed writer causes a segfault rather than an error. I ran into this while testing something unrelated, evaluating portions of a larger script in a REPL. Writing to a closed output errors as expected so the key here is `writer$Close()` and the subsequent `writer$WriteTable` call:
   
   ```r
   library(arrow)
   
   outfile <- tempfile(fileext = ".parquet")
   sink <- FileOutputStream$create(outfile)
   
   my_schema <- schema(letters = string())
   writer <- ParquetFileWriter$create(
     schema = my_schema,
     sink,
     properties = ParquetWriterProperties$create(
       column_names = names(my_schema),
       compression = arrow:::default_parquet_compression()
     )
   )
   tbl_arrow <- as_arrow_table(data.frame(letters=LETTERS), schema = my_schema)
   writer$WriteTable(tbl_arrow, chunk_size = 1)
   
   writer$Close()
   sink$close()
   
   tbl_arrow <- as_arrow_table(data.frame(letters=LETTERS), schema = my_schema)
   writer$WriteTable(tbl_arrow, chunk_size = 1)
   ```
   
   Result:
   
   ```
    *** caught segfault ***
   address 0x0, cause 'invalid permissions'
   
   Traceback:
    1: parquet___arrow___FileWriter__WriteTable(self, table, chunk_size)
    2: writer$WriteTable(tbl_arrow, chunk_size = 1)
   An irrecoverable exception occurred. R is aborting now ...
   fish: Job 1, 'Rscript arrow_memorypool_crashe…' terminated by signal SIGSEGV (Address boundary error)
   ```
   
   - OS/arch: macOS 14.0 (Sonoma), aarch64 (M2)
   - R: 4.3.1
   - arrow version: 13.0.0.1
   
   ### Component(s)
   
   R


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] thisisnic commented on issue #37969: [R] segfault when writing to ParquetFileWriter after closing

Posted by "thisisnic (via GitHub)" <gi...@apache.org>.
thisisnic commented on issue #37969:
URL: https://github.com/apache/arrow/issues/37969#issuecomment-1742204049

   Have replicated this on Ubuntu 23.04 with R 4.3.1 and arrow 13.0.0.1 too.  Here's gdb output:
   
   ```
   Thread 1 "R" received signal SIGSEGV, Segmentation fault.
   parquet::ParquetFileWriter::properties (this=0x5555563a04b0)
       at /home/nic/arrow/cpp/src/parquet/file_writer.cc:663
   warning: Source file is more recent than executable.
   663	  return contents_->properties();
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [R][C++] segfault when writing to ParquetFileWriter after closing [arrow]

Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou closed issue #37969: [R][C++] segfault when writing to ParquetFileWriter after closing
URL: https://github.com/apache/arrow/issues/37969


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [R][C++] segfault when writing to ParquetFileWriter after closing [arrow]

Posted by "thisisnic (via GitHub)" <gi...@apache.org>.
thisisnic commented on issue #37969:
URL: https://github.com/apache/arrow/issues/37969#issuecomment-1770885037

   Yep, nobody's assigned and there's no open PR, so it's free.  Thanks @quanghgx! 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [R][C++] segfault when writing to ParquetFileWriter after closing [arrow]

Posted by "quanghgx (via GitHub)" <gi...@apache.org>.
quanghgx commented on issue #37969:
URL: https://github.com/apache/arrow/issues/37969#issuecomment-1770826050

   Hi @thisisnic and @amoeba 
   I can take this ticket if it's unassigned. I'm running local tests to confirm the fix.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org