Skip to content
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

dbWriteTable segfaults on an admittedly weird data.frame with raw/bytea fields #60

Open
GoogleCodeExporter opened this issue Nov 3, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?

 dbGetQuery(con,"CREATE TABLE byteatable (name text NOT NULL, val bytea, PRIMARY KEY (name))")
  sample.object <- list("one","two"); 
  ser <- serialize(sample.object,NULL,ascii=F);

  df <- data.frame(name=c("first","second"),stringsAsFactors=F);
  df$val <- list(ser,ser)

  dbWriteTable(con,"byteatable",df,append=T,row.names=F)

What is the expected output? What do you see instead?
All this was for a bytea insertion attempt. Instead, this happens:

 *** caught segfault ***
address (nil), cause 'memory not mapped'

Traceback:
 1: .Call("RS_PostgreSQL_CopyInDataframe", conId, dataframe, nrow,     p, PACKAGE = .PostgreSQLPkgName)
 2: postgresqlCopyInDataframe(new.con, value)
 3: postgresqlWriteTable(conn, name, value, ...)
 4: is(object, Cl)
 5: is(object, Cl)
 6: .valueClassTest(standardGeneric("dbWriteTable"), "logical", "dbWriteTable")
 7: dbWriteTable(con, "byteatable", df, append = T, row.names = F)

What version of the product are you using? On what operating system?


Please provide any additional information below.
1. Postgres 9.1 (don't know if matters)
> sessionInfo()
R version 2.15.3 (2013-03-01)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=C                 LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] PKI_0.1-1       base64enc_0.1-1 RPostgreSQL_0.5 DBI_0.2-7      

loaded via a namespace (and not attached):
[1] compiler_2.15.3 tools_2.15.3   

Original issue reported on code.google.com by [email protected] on 29 Jan 2014 at 9:41

@GoogleCodeExporter
Copy link
Author

I have exactly the same problem on Ubuntu 14.04 with the newest R packages from 
CRAN.

Original comment by [email protected] on 27 May 2014 at 6:15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant