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

stackoverflow on adddriver error #270

Closed
ExpandingMan opened this issue May 27, 2020 · 5 comments
Closed

stackoverflow on adddriver error #270

ExpandingMan opened this issue May 27, 2020 · 5 comments

Comments

@ExpandingMan
Copy link
Contributor

This is happening on current master. Something is going wrong when I add drivers, but I can't see what it is because of a stackoverflow

julia> ODBC.adddriver("mssql", "/home/expandingman/buddha-dev/mssql/lib64/libmsodbcsql-17.5.so.1.1");
ERROR: StackOverflowError:
Stacktrace:
 [1] Array at ./boot.jl:405 [inlined]
 [2] installererror() at /home/expandingman/.julia/packages/ODBC/sUj7I/src/API.jl:505
 [3] installererror() at /home/expandingman/.julia/packages/ODBC/sUj7I/src/API.jl:498 (repeats 21640 times)
 [4] adddriver(::String, ::String; kw::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /home/expandingman/.julia/packages/ODBC/sUj7I/src/API.jl:498
 [5] adddriver at /home/expandingman/.julia/packages/ODBC/sUj7I/src/API.jl:534 [inlined]
 [6] #adddriver#36 at /home/expandingman/.julia/packages/ODBC/sUj7I/src/ODBC.jl:135 [inlined]
 [7] adddriver(::String, ::String) at /home/expandingman/.julia/packages/ODBC/sUj7I/src/ODBC.jl:135
 [8] top-level scope at REPL[6]:1
 [9] eval(::Module, ::Any) at ./boot.jl:331
 [10] eval_user_input(::Any, ::REPL.REPLBackend) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/REPL/src/REPL.jl:86
 [11] run_backend(::REPL.REPLBackend) at /home/expandingman/.julia/packages/Revise/XFtoQ/src/Revise.jl:1162
 [12] top-level scope at none:0

julia> ODBC.adddriver("freetds", "/usr/lib/x86_64-linux-gnu/odbc/libtdsS.so")
ERROR: StackOverflowError:
Stacktrace:
 [1] Array at ./boot.jl:405 [inlined]
 [2] installererror() at /home/expandingman/.julia/packages/ODBC/sUj7I/src/API.jl:505
 [3] installererror() at /home/expandingman/.julia/packages/ODBC/sUj7I/src/API.jl:498 (repeats 21640 times)
 [4] adddriver(::String, ::String; kw::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /home/expandingman/.julia/packages/ODBC/sUj7I/src/API.jl:498
 [5] adddriver at /home/expandingman/.julia/packages/ODBC/sUj7I/src/API.jl:534 [inlined]
 [6] #adddriver#36 at /home/expandingman/.julia/packages/ODBC/sUj7I/src/ODBC.jl:135 [inlined]
 [7] adddriver(::String, ::String) at /home/expandingman/.julia/packages/ODBC/sUj7I/src/ODBC.jl:135
 [8] top-level scope at REPL[7]:1
 [9] eval(::Module, ::Any) at ./boot.jl:331
 [10] eval_user_input(::Any, ::REPL.REPLBackend) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/REPL/src/REPL.jl:86
 [11] run_backend(::REPL.REPLBackend) at /home/expandingman/.julia/packages/Revise/XFtoQ/src/Revise.jl:1162
 [12] top-level scope at none:0
@quinnj
Copy link
Member

quinnj commented May 27, 2020

Try this PR: #271

@ExpandingMan
Copy link
Contributor Author

ExpandingMan commented May 27, 2020

Great, this fixes the stack overflow, thanks.

Now I'm really confused as to what's happening, I get Invalid install path thrown from API.jl line 498, but the library definitely exists... libraries, in fact, I've tried this with multiple libraries exactly as they appear in my existing (and usable) /etc/odbcinst.ini.

As a sanity check, I've also checked exactly the string I pass to adddriver with isfile and it indeed exists.

@quinnj
Copy link
Member

quinnj commented May 28, 2020

Ok, some things to check/think about/try:

  • What's your specific platform? Linux I assume? But ubuntu?
  • Can you post the exact command you're running for adddriver?
  • If you look at the driver entry in odbcinst.ini, are you passing any additional key-value pairs to adddriver? Like, if there's an entry like OPTION = 4, then you would do ODBC.adddriver("cool new driver", absolute_path_to_lib; OPTION=4), i.e. passing the additional entry as a keyword argument
  • Make sure you're passing a full, absolute path for the library name; that means no relative /../path or home directory ~ globbing stuff; calling abspath(libpath) can be helpful here.
  • Make sure the libpath is the path to the actual driver shared library and not the setup shared library (I noticed you did libtdsS.so, which is probably the setup library because of the extra capital S at the end of the name
  • Are the drivers you're using publicly available somewhere? Basically, I can try to spin up a docker container of your system and hopefully reproduce the issue you're seeing by trying to load the same drivers.

@ExpandingMan
Copy link
Contributor Author

ExpandingMan commented May 28, 2020

In this particular case I'm on an EC2 server with Ubuntuu

shell> inxi -S
System:    Host: ip---------- Kernel: 4.15.0-1063-aws x86_64 bits: 64 Console: tty 1
           Distro: Ubuntu 18.04.3 LTS

shell> inxi -SM
System:    Host: ip---------- Kernel: 4.15.0-1063-aws x86_64 bits: 64 Console: tty 1
           Distro: Ubuntu 18.04.3 LTS
Machine:   Device: kvm System: Amazon EC2 product: m5.4xlarge serial: N/A
           Mobo: Amazon EC2 model: N/A serial: N/A BIOS: Amazon EC2 v: 1.0 date: 10/16/2017

Here's what happens when I try to add an MS SQL lib

julia> path = "/home/expandingman/buddha-dev/mssql/lib64/libmsodbcsql-17.5.so.1.1";

julia> isfile(path)
true

julia> ODBC.adddriver("mssql", path);
ERROR: Invalid install path
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] adddriver(::String, ::String; kw::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /home/expandingman/.julia/packages/ODBC/oy8Qq/src/API.jl:498
 [3] adddriver at /home/expandingman/.julia/packages/ODBC/oy8Qq/src/API.jl:534 [inlined]
 [4] #adddriver#36 at /home/expandingman/.julia/packages/ODBC/oy8Qq/src/ODBC.jl:135 [inlined]
 [5] adddriver(::String, ::String) at /home/expandingman/.julia/packages/ODBC/oy8Qq/src/ODBC.jl:135
 [6] top-level scope at REPL[8]:1
 [7] eval(::Module, ::Any) at ./boot.jl:331
 [8] eval_user_input(::Any, ::REPL.REPLBackend) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/REPL/src/REPL.jl:86
 [9] run_backend(::REPL.REPLBackend) at /home/expandingman/.julia/packages/Revise/XFtoQ/src/Revise.jl:1162
 [10] top-level scope at none:0

Note that I'm currently using this same lib successfully in ODBC (with ODBC.jl 0.9.1) from /etc/odbc.ini.

Here's another attempt with a FreeTDS driver

julia> path = "/usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so";

julia> isfile(path)
true

julia> ODBC.adddriver("freetds", path)
ERROR: Invalid install path
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] adddriver(::String, ::String; kw::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /home/expandingman/.julia/packages/ODBC/oy8Qq/src/API.jl:498
 [3] adddriver at /home/expandingman/.julia/packages/ODBC/oy8Qq/src/API.jl:534 [inlined]
 [4] #adddriver#36 at /home/expandingman/.julia/packages/ODBC/oy8Qq/src/ODBC.jl:135 [inlined]
 [5] adddriver(::String, ::String) at /home/expandingman/.julia/packages/ODBC/oy8Qq/src/ODBC.jl:135
 [6] top-level scope at REPL[12]:1
 [7] eval(::Module, ::Any) at ./boot.jl:331
 [8] eval_user_input(::Any, ::REPL.REPLBackend) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/REPL/src/REPL.jl:86
 [9] run_backend(::REPL.REPLBackend) at /home/expandingman/.julia/packages/Revise/XFtoQ/src/Revise.jl:1162
 [10] top-level scope at none:0

Since it seems this is being passed to the C API, the only thing I can think of is that maybe the string is being mangled somehow?

@ExpandingMan
Copy link
Contributor Author

Stack overflow issue, resolved, will create separate issue for tracking permissions thing.

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

No branches or pull requests

2 participants