greenplum-db / PivotalR-archive

An convenient R tool for manipulating tables in PostgreSQL type databases and a wrapper of Apache MADlib.
https://pivotalsoftware.github.io/gp-r/
125 stars 53 forks source link

Core Dump on db.connect #61

Closed wallingTACC closed 2 years ago

wallingTACC commented 2 years ago

I have tested PivotalR on a variety of platforms and can never get past establishing a connection. In the case of R 3.6.3 on Ubuntu, I get the follow core dump.

> conn.id <- db.connect(conn.pkg = "RPostgreSQL", dbname = 'dbname=mydb sslmode=require', host = 'hostname', port = 5432, user = 'username', password = 'password)

Loading required package: DBI
Created a connection to database with ID 1 

Warning: Madlib does not exist in database dbname=mydb sslmode=require schema madlib.
So all functions starting with 'madlib.' will not work.
But you can still use other functions with just a few exceptions.

 *** caught segfault ***
address 0x4, cause 'memory not mapped'

Traceback:
 1: postgresqlFetch(res, n, ...)
 2: func(res, n)
 3: .db.fetch.rpostgresql(res = res$res, n = n)
 4: eval(parse(text = command))
 5: eval(parse(text = command))
 6: .db.fetch(res, nrows)
 7: doTryCatch(return(expr), name, parentenv, handler)
 8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
 9: tryCatchList(expr, classes, parentenv, handlers)
10: tryCatch(.db.fetch(res, nrows), error = function(c) c, finally = {    .db.clearResult(res)    .restore.warnings(warns)})
11: db.q(paste("set application_name = '", .this.pkg.name, "'", sep = ""),     conn.id = result, verbose = FALSE)
12: db.connect(conn.pkg = "RPostgreSQL", dbname = "dbname=mydb sslmode=require",     host = "hostname", port = 5432,     user = "username", password = "password"
beeender commented 2 years ago

This was caused by https://github.com/tomoakin/RPostgreSQL/commit/93492ef6af33caef7b97dfc17adbe18414318f6f

Not a PivotalR issue. A PR has been submitted to RPostgreSQL to fix this.