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

Problem with unhandled exceptions #314

Closed
whubbla opened this issue Sep 18, 2020 · 1 comment
Closed

Problem with unhandled exceptions #314

whubbla opened this issue Sep 18, 2020 · 1 comment

Comments

@whubbla
Copy link

whubbla commented Sep 18, 2020

Hello,

I am not certain whether this is an ODBC.jl problem or a debugger problem (or a me problem), but I am experiencing the following:

When I'm running a Julia script in debug mode and choose to break on uncaught exceptions (if I don't choose to do this, then nothing works right, which I think is a debugger issue), then I get stuck in an endless loop of trying to log something (so, no amount of stepping out or over or continuing gets me back to my code) arising from something in ODBC.

Specifically, I run this code:
conn = ODBC.Connection(dsnname)

where dsnname is the name of a dsn I set up in Windows. I'm using Windows login, so no user name or password.

Anyway, it ends up in line 351 of API.jl which has this:
connect(dsn, user, pwd) = driverconnect(string("DSN=", dsn, user === nothing ? "" : ";UID=$user", pwd === nothing ? "" : ";PWD=$pwd"))

user and pwd both are nothing, so it should just be passing "DSN=" and the name of my dsn, which is what it looks to be doing. But for some reason, driverconnect(.) is getting sent to error logging, i.e., the next thing up in the call stack is in base\logging.jl, and that's where my stepping line gets stuck when I'm trying to debug.

function driverconnect(connstr)
    dbc = Handle(SQL_HANDLE_DBC, ODBC_ENV[])
    @checksuccess dbc SQLDriverConnect(dbc, connstr)
    return dbc
end

Somehow I get stuck in this:

# Generate code for logging macros
function logmsg_code(_module, file, line, level, message, exs...)

Please let me know if I can give you any more information.

Also, I should note that if I just run the script in the REPL or execute the whole file, it works fine, in the sense that I can create an ODBC connection to MS SQL Server and get data back.

@quinnj
Copy link
Member

quinnj commented Sep 20, 2020

Thanks for the report; yeah, this doesn't sound like an ODBC.jl issue at all. I would suggest copy/pasting this issue to https://github.com/JuliaDebug/Debugger.jl, so people more familiar with that code could help figure out why it seems to be getting confused.

@quinnj quinnj closed this as completed Sep 20, 2020
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