[R-sig-DB] SOS! R Console crashed after loading RODBC... Update: Re: How to set up RODBC? Diff between R Console and RStudio?

Paul Gilbert pg||bert902 @end|ng |rom gm@||@com
Mon May 28 15:01:31 CEST 2012


I think it would be useful to first understand how your RStudio 
environment is working. You should not need both "/pp64/odbc/5.3/lib" 
and "/pp64/odbc/5.1/lib" on your LD_LIBRARY_PATH. One can guess what is 
being used, but it would be better to be certain. So if you can get a 
relatively clean RStudio environment that works, then deciding what to 
use in the console session would be easier.

Once again, while the crash to the shell with no error messages may not 
happen until you execute some R commands, this behaviour is almost 
certainly related to loading a bad binary file or library.

(Also, be certain you are getting the same version of R and package 
libraries when you run RStudio and your console session.)

Paul

On 12-05-27 09:59 PM, Michael wrote:
> Even more weirdly...
> Now I open the R-Console again, and manually typed:
>
>  >
>
> library(RODBC)
>
>  >
>
> require(RODBC)
>
> And it seems to be fine, no crash at all.
> But when I run my original program(the same program ran perfectly fine
> in RStudio), it crashed again quietly...
> The problem seems to be lying in the commands/functions after loading
> the RODBC library, but it's related to RODBC...
>
>
> On Sun, May 27, 2012 at 8:46 PM, Michael <comtech.usa using gmail.com
> <mailto:comtech.usa using gmail.com>> wrote:
>
>     Thank you!
>     I dug into the RStudio, since the RODBC worked perfectly fine inside
>     RStudio.
>     I did Sys.getenv("ODBC_HOME"), it returned:
>     /pp64/odbc/5.3/
>     I then looked into that fold and found "libodbc.so" in that directory.
>     When I set the LD_LIBRARY_PATH, I actually have copied everything
>     related to "odbc" and "ODBC" on the environments from RStudio.
>     There, inside RStudio, I found the following in LD_LIBRARY_PATH:
>     "/pp64/unixODBC/2.3.1/lib" "/pp64/unixODBC/2.3.1/lib"
>     "/pp64/unixODBC/2.3.1/lib"
>     "/pp64/unixODBC/2.3.1/lib"
>     "/pp64/odbc/5.3/lib" "/pp64/odbc/5.1/lib"
>     "/pp64/odbcpp/0.2.5-unixodbc/lib" "/pp64/odbcpp/0.2.5-unixodbc/lib"
>     "/pp64/odbc/5.3/lib" "/pp64/odbc/5.1/lib"
>     "/pp64/odbcpp/0.2.5-unixodbc/lib" "/pp64/odbcpp/0.2.5-unixodbc/lib"
>     There are some repetitions, so I copied only those non-repitives to
>     the global shell environment before calling the R-Console.
>     My goal was to replicate the exactly same environment variables for
>     R-Console... so that RODBC could work in R-Console.
>     Also following exactly what I see from RStudio, using Sys.getenv(),
>     I copied over and set up for R-Console the following:
>     ODBC_HOME
>     ODBCINI
>     ODBC_INI
>     PATH
>     PYTHONPATH
>     They all have "odbc" or "ODBC" in them...
>     As reported, initially it was the file "libodbc.so" couldn't be
>     found; later it became crash after I set up the paths...
>     Any more thoughts?
>     Thanks a lot!
>
>     On Sun, May 27, 2012 at 7:37 PM, Paul Gilbert <pgilbert902 using gmail.com
>     <mailto:pgilbert902 using gmail.com>> wrote:
>
>         If they are both installed, I think they are in directories like
>         /usr/lib/i386-linux-gnu/ and /usr/lib/x86_64-linux-gnu/. If they
>         are not both installed, then that could not be the problem. Try
>           locate libodbc.so
>         to see what you have installed.
>
>
>
>         On 12-05-27 07:58 PM, Michael wrote:
>
>             Thank you Paul.
>             How do I judge/check which lib is 32 and which is 64?
>             Thanks again!
>
>             On Sun, May 27, 2012 at 6:45 PM, Paul Gilbert
>             <pgilbert902 using gmail.com <mailto:pgilbert902 using gmail.com>
>             <mailto:pgilbert902 using gmail.com
>             <mailto:pgilbert902 using gmail.com>>__> wrote:
>
>                 (Cross posting should not be done!)
>
>                 A crash to the shell prompt suggests a bad .so got
>             loaded. Maybe you
>                 are picking up a 32 bit version instead of 64 bit, or
>             the reverse. I
>                 am surprised you need to set  LD_LIBRARY_PATH, and if
>             you set it
>                 wrong it might cause this. (Just guessing.)
>
>                 Paul
>
>
>
>                 On 12-05-27 01:26 PM, Michael wrote:
>
>                     On Sun, May 27, 2012 at 11:32 AM,
>             Michael<comtech.usa using gmail.com <mailto:comtech.usa using gmail.com>
>             <mailto:comtech.usa using gmail.com
>             <mailto:comtech.usa using gmail.com>>__>  wrote:
>
>
>                         Help! The R Console very quietly closed and
>             exited without
>                         giving any
>                         errors/warnings...after I loaded the RODBC
>             library...
>
>                         Loading required package: RODBC
>
>
>
>
>                         On Sat, May 26, 2012 at 10:27 PM,
>                         Michael<comtech.usa using gmail.com
>             <mailto:comtech.usa using gmail.com>
>             <mailto:comtech.usa using gmail.com
>             <mailto:comtech.usa using gmail.com>>__>  wrote:
>
>
>                             Hi all,
>
>                             It's very strange. In RStudio, I can
>             successfully
>                             load("RODBC"). But in
>                             the plain R Console, I just couldn't get it
>             work:
>
>                             (For some special and important reasons, I
>             have to make
>                             the RODBC work in
>                             R Console, not the RStudio.)
>
>                             At first, the some shared library
>             "libodbc.so" couldn't
>                             be found... it's
>                             right there, but R Console just couldn't
>             find it.
>
>                             I then find that the
>
>                             Sys.getenv("LD_LIBRARY_PATH") is different
>             for R Console
>                             vs. RStudio.
>
>                             Weirdly, the LD_LIBRARY_PATH in RStudio even
>             doesn't
>                             have any "ODBC"
>                             terms/words in its long string...
>
>                             I guess RStudio has some special
>             configuration for
>                             RODBC, so it doesn't
>                             require LD_LIBRARY_PATH to be set up for
>             ODBC at all.
>
>                             I then added the ODBC library path into the
>                             LD_LIBRARY_PATH in R Console.
>
>                             I found that this problem is solved...
>
>                             But then the R Console complained that the
>             "ODBCINI" was
>                             set up correctly.
>
>                             So I compared the "ODBCINI" in RStudio vs.
>             "ODBCINI" in
>                             R Console, found
>                             the R Console one seems to be missing.
>
>                             I then copied the "ODBCINI" from RStudio and
>             pasted it
>                             into R Console.
>
>                             Now the load("RODBC") can run in the plain R
>             Console,
>                             but then the whole
>                             R console crashed without giving any
>             errors/warnings...
>
>                             It exited back to the shell prompt...
>
>                             What can I do? Anybody please shed some
>             lights on me on
>                             this?
>
>                             Thanks a lot!
>
>
>
>
>                             [[alternative HTML version deleted]]
>
>                     ___________________________________________________
>
>                     R-sig-DB mailing list -- R Special Interest Group
>             R-sig-DB using r-project.org <mailto:R-sig-DB using r-project.org>
>             <mailto:R-sig-DB using r-project.org
>             <mailto:R-sig-DB using r-project.org>__>
>             https://stat.ethz.ch/mailman/____listinfo/r-sig-db
>             <https://stat.ethz.ch/mailman/__listinfo/r-sig-db>
>             <https://stat.ethz.ch/mailman/__listinfo/r-sig-db
>             <https://stat.ethz.ch/mailman/listinfo/r-sig-db>>
>
>
>
>




More information about the R-sig-DB mailing list