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

Segfault on Julia 1.10.0-rc1 + DuckDB 0.9 #9601

Closed
1 task done
asbisen opened this issue Nov 7, 2023 · 7 comments · Fixed by #9728
Closed
1 task done

Segfault on Julia 1.10.0-rc1 + DuckDB 0.9 #9601

asbisen opened this issue Nov 7, 2023 · 7 comments · Fixed by #9728

Comments

@asbisen
Copy link

asbisen commented Nov 7, 2023

What happens?

Executing any query on macOS 14.0 + Julia 1.10.0-rc1 + DuckDB 0.9.0 causes a segmentation fault. Downgrading to DuckDB 0.8.1 and executing the same query does not encounter this Segfault.

However using duckdb 0.9.1 CLI on macOS and executing the same query also does not encounter any Segfaults.

Julia + DuckDB v0.8.1

julia> using DuckDB

julia> con = DBInterface.connect(DuckDB.DB, ":memory:")
DuckDB.DB(":memory:")

julia> r = DBInterface.execute(con, "SELECT count(*) FROM 'test.csv';")
1×1 DataFrame
 Row │ count_star()
     │ Int64?
─────┼──────────────
   199

julia> DBInterface.close!(con)

DuckDB CLI v0.9.1

v0.9.1 401c8061c6
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
D SELECT count(*) FROM 'test.csv';
┌──────────────┐
│ count_star() │
│    int64     │
├──────────────┤
│           99 │
└──────────────┘
D .q

To Reproduce

Julia + DuckDB v0.9.0

julia> using DuckDB

julia> con = DBInterface.connect(DuckDB.DB, ":memory:")
DuckDB.DB(":memory:")

julia> r = DBInterface.execute(con, "SELECT count(*) FROM 'test.csv';")

[55102] signal (11.2): Segmentation fault: 11
in expression starting at REPL[3]:1
duckdb_execute_pending at /Users/abisen/.julia/artifacts/4c3c1ab004347fc4278bd18633db13743e31b159/lib/libduckdb.dylib (unknown line)
duckdb_pending_execution_is_finished at /Users/abisen/.julia/packages/DuckDB/N9ODB/src/api.jl:1362 [inlined]
pending_execute_tasks at /Users/abisen/.julia/packages/DuckDB/N9ODB/src/result.jl:641
execute_singlethreaded at /Users/abisen/.julia/packages/DuckDB/N9ODB/src/result.jl:690
execute at /Users/abisen/.julia/packages/DuckDB/N9ODB/src/result.jl:729
execute at /Users/abisen/.julia/packages/DuckDB/N9ODB/src/result.jl:830 [inlined]
execute at /Users/abisen/.julia/packages/DBInterface/1Gmxx/src/DBInterface.jl:130 [inlined]
#execute#2 at /Users/abisen/.julia/packages/DBInterface/1Gmxx/src/DBInterface.jl:152 [inlined]
execute at /Users/abisen/.julia/packages/DBInterface/1Gmxx/src/DBInterface.jl:152
unknown function (ip: 0x10fc4c0cb)
_jl_invoke at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/gf.c:0 [inlined]
ijl_apply_generic at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/gf.c:3074
jl_apply at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/./julia.h:1976 [inlined]
do_call at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/interpreter.c:125
eval_body at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/interpreter.c:0
jl_interpret_toplevel_thunk at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/interpreter.c:774
jl_toplevel_eval_flex at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/toplevel.c:934
jl_toplevel_eval_flex at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/toplevel.c:877
ijl_toplevel_eval at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/toplevel.c:943 [inlined]
ijl_toplevel_eval_in at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/toplevel.c:985
eval at ./boot.jl:383 [inlined]
eval_user_input at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/usr/share/julia/stdlib/v1.10/REPL/src/REPL.jl:150
repl_backend_loop at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/usr/share/julia/stdlib/v1.10/REPL/src/REPL.jl:246
#start_repl_backend#46 at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/usr/share/julia/stdlib/v1.10/REPL/src/REPL.jl:231
start_repl_backend at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/usr/share/julia/stdlib/v1.10/REPL/src/REPL.jl:228
_jl_invoke at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/gf.c:0 [inlined]
ijl_apply_generic at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/gf.c:3074
#run_repl#59 at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/usr/share/julia/stdlib/v1.10/REPL/src/REPL.jl:389
run_repl at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/usr/share/julia/stdlib/v1.10/REPL/src/REPL.jl:375
jfptr_run_repl_91807 at /Applications/Julia-1.10.app/Contents/Resources/julia/lib/julia/sys.dylib (unknown line)
_jl_invoke at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/gf.c:0 [inlined]
ijl_apply_generic at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/gf.c:3074
#1013 at ./client.jl:432
jfptr_YY.1013_82834 at /Applications/Julia-1.10.app/Contents/Resources/julia/lib/julia/sys.dylib (unknown line)
_jl_invoke at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/gf.c:0 [inlined]
ijl_apply_generic at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/gf.c:3074
jl_apply at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/./julia.h:1976 [inlined]
jl_f__call_latest at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/builtins.c:812
#invokelatest#2 at ./essentials.jl:887 [inlined]
invokelatest at ./essentials.jl:884 [inlined]
run_main_repl at ./client.jl:416
exec_options at ./client.jl:333
_start at ./client.jl:552
jfptr__start_82860 at /Applications/Julia-1.10.app/Contents/Resources/julia/lib/julia/sys.dylib (unknown line)
_jl_invoke at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/gf.c:0 [inlined]
ijl_apply_generic at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/gf.c:3074
jl_apply at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/./julia.h:1976 [inlined]
true_main at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/jlapi.c:582
jl_repl_entrypoint at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/jlapi.c:731
Allocations: 631443 (Pool: 630758; Big: 685); GC: 1
zsh: segmentation fault  julia

OS:

macOS 14.0

DuckDB Version:

0.9.1

DuckDB Client:

Julia

Full Name:

Anand Bisen

Affiliation:

SAS

Have you tried this on the latest main branch?

I have tested with a release build (and could not test with a main build)

Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

  • Yes, I have
@szarnyasg szarnyasg changed the title Segfault on Julia + DuckDB 0.9 Segfault on Julia 1.10.0-rc1 + DuckDB 0.9 Nov 8, 2023
@szarnyasg
Copy link
Collaborator

@asbisen thanks for reporting this, I could reproduce the issue with Julia v1.10.0-rc1.

Please note that the Julia client is not supported as explained in our support policy. So we cannot give an ETA for resolving this.

@era127
Copy link
Contributor

era127 commented Nov 16, 2023

Is there a particular reason why the DuckDB package was released with the correct version 0.9.1, whereas the package DuckDB_jll was released with a more advanced version 0.9.2?

@sefffal
Copy link

sefffal commented Nov 17, 2023

Reproduced this issue on MacOS 13.6 (M2) and 1.10-rc1.

@szarnyasg
Copy link
Collaborator

Is there a particular reason why the DuckDB package was released with the correct version 0.9.1, whereas the package DuckDB_jll was released with a more advanced version 0.9.2?

The reason is that the initial release for the v0.9.0 Julia client failed and Julia's package repository does not allow skipping versions, so now v0.9.0 Julia client is DuckDB 0.9.1, 0.9.1 Julia is DuckDB 0.9.2.

Mytherin added a commit that referenced this issue Nov 20, 2023
Fix #9601: Call correct method in duckdb_pending_execution_is_finished
@Mytherin
Copy link
Collaborator

Pushed a fix in #9728

@sefffal
Copy link

sefffal commented Nov 20, 2023

Thanks, could you also tag a new release with this fix? The latest stable release of 0.9.1 still crashes.

@dzonimn
Copy link

dzonimn commented Dec 15, 2023

Hi @Mytherin,

Firstly, thank you for your efforts in maintaining the Julia API of DuckDB and we appreciate the efforts in fixing this issue. However, I faced the same problem when I added the DuckDB package to Julia, and I noticed that the Julia General registry has yet to receive these changes. When I dev the project, it works fine, as it pulls the latest changes.

Is it possible to tag a new release so that the registry updates with the new changes? It would be greatly appreciated if it's possible. Thanks!

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

Successfully merging a pull request may close this issue.

7 participants