Open simonpcouch opened 2 months ago
In particular in the gist logs i see this, which is finally a backtrace for this crash
[Positron] All 5 sockets disconnected; kernel exited
[R] 2: __simple_esappend
[R] 3: _CRYPTO_THREAD_read_lock
[R] 4: _ossl_property_string
[R] 5: _ossl_property_parse_init
[R] 6: _context_init
[R] 7: _OSSL_LIB_CTX_new
[R] 8: _ztca_osl_DefaultLoad
[R] 9: _ztca_osl_CreateCtx
[R] 10: _ztca_Init
[R] 11: _ztca_GetRandomMC
[R] 12: _ztca_GetRandom
[R] 13: _ztcr2rnd
[R] 14: _ztcsh
[R] 15: _kpusattr0
[R] 16: _kpusattr
[R] 17: _bcoSQLConnect
[R] 18: _bcoSQLConnectCP
[R] 19: _bcoSQLDriverConnect
[R] 20: _SQLDriverConnectW
[R] 21: _SQLDriverConnect
[R] 22: __ZN7nanodbc10connection15connection_impl7connectERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKNS2_4listINS2_5tupleIJllPvEEENS6_ISE_EEEE
[R] 23: __ZN7nanodbc10connection15connection_implC2ERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS2_4listINS2_5tupleIJllPvEEENS6_ISE_EEEE
[R] 24: __ZN7nanodbc10connectionC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS1_4listINS1_5tupleIJllPvEEENS5_ISD_EEEE
[R] 25: __ZN4odbc15odbc_connectionC2ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES7_S7_S7_NS_12bigint_map_tElRKN4Rcpp8NullableINS9_6VectorILi19ENS9_15PreserveStorageEEEEERKb
[R] 26: __Z12odbc_connectRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES7_S7_S7_ilRKN4Rcpp8NullableINS8_6VectorILi19ENS8_15PreserveStorageEEEEERKb
[R] 27: __odbc_odbc_connect
[R] 28: R_doDotCall
Sys.unsetenv("LD_LIBRARY_PATH")
and then connecting results in a successful connection in both RStudio and Positron.🏄
Just so as not to leave this in an ambiguous state—I left this open as the Instant Client and ODBC installation instructions from Oracle tell users to set the LD_LIBRARY_PATH
envvar:
On Linux/Unix the directory path of the shared library should be set in the environment variable LD_LIBRARY_PATH, or platform equivalent.
Setting this envvar didn't cause any issues in RStudio, so folks migrating from RStudio will see their connection code newly failing (and rather uninformatively). One option could be to make changes in the odbc R package to detect that envvar and some Positron-is-running envvar inside of dbConnect(odbc(), ...)
and raise a more informative error there, though that wouldn't help folks who see R crashes in some other part of their workflow from having set that envvar. Not sure how challenging/invasive it would be for yall to address this from the Positron side, or what the implications are generally for that variable being set by the user.
Positron Version:
Positron Version: 2024.07.0 (Universal) build 59
Steps to reproduce the issue:
What did you expect to happen?
Successful connection to the database.
One piece of information I'm looking into at the moment: Oracle connections depend on a few environmental variables being properly set, and I see a difference in the values of those envvars between RStudio and Positron sessions. In RStudio, I see:
Created on 2024-07-17 with reprex v2.1.0
PATH
andLD_LIBRARY_PATH
are set in my global.Rprofile
.In Positron, I see:
In both the
PATH
andOCI_*
, there are old Instant Client installations that don't exist anymore.In RStudio, I have:
Created on 2024-07-17 with reprex v2.1.0
Were there any error messages in the Output panel or Developer Tools console?
Yes—GitHub is showing "There was an error creating your Issue: body is too long (maximum is 65536 characters)," so I just pasted the logs in this gist. :)