-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Python: Segmentation Fault when importing duckdb on x86 running MacOS 11 #12199
Comments
Can you provide these? |
@Tishj The "11" number is the error code. The error message is literally this: Btw, I chased it down and it looks like this is a regression. Version 0.10.2 does not display this behavior. |
Some more information that might be relevant: The earliest version that causes the seg fault is It looks like there was a change between versions 0.10.2 and 0.10.3 in how the python stubs are generated and for some reason it causes a segfault on my setup. |
I've tried to reproduce this using asdf install python 3.8.19
asdf global python 3.8.19
asdf exec python -m pip install duckdb
asdf exec python
```py
>>> import duckdb
>>> duckdb.sql('select 42')
┌───────┐
│ 42 │
│ int32 │
├───────┤
│ 42 │
└───────┘ Perhaps there are some existing packages this is conflicting with. Could you provide the list of installed packages and versions? Are you using a wheel build or a source build? |
@Tishj hm, probably not it, I can reproduce this with only duckdb installed. Here's what
|
Just to confirm you are using the wheel builds right? (e.g. if you try running |
@Mytherin hey, yes it succeeds:
|
Do you have pybind11 installed locally? If so what is the version? ( |
@Mytherin no pybind
|
I can replicate this on an older (non-updated) x86_64 mac.
(Creating a wheel locally from a source build works without error.) Is there anything I can do to help with debugging? |
Can you try this to troubleshoot? You say this crashes: import duckdb
duckdb.sql("select 42") Does this also crash? import duckdb
duckdb.default_connection.sql("select 42") import duckdb
con = duckdb.connect()
con.sql("select 42") |
@cmdlineluser Could you also try these snippets and report your results? |
@Tishj It's the $ python3 -m pip install duckdb -U --force-reinstall --only-binary=:all:
Collecting duckdb
Using cached duckdb-0.10.3-cp310-cp310-macosx_10_9_x86_64.whl.metadata (763 bytes)
Installing collected packages: duckdb
Attempting uninstall: duckdb
Found existing installation: duckdb 0.10.2
Uninstalling duckdb-0.10.2:
Successfully uninstalled duckdb-0.10.2
Successfully installed duckdb-0.10.3
(This is on an older mac that cannot be updated.) |
Could you try compiling from source using the We've done some internal investigation and this seems to be related specifically to MacOS 11. It's also not limited to Python - and can also be triggered using the CLI. Since MacOS 11 is no longer supported by Apple itself, the problem could be that newer Apple build toolchains do not support MacOS 11 anymore or do not support it by default anymore and we might need to set specific flags for our binaries. Maybe building with the machine itself will circumvent the issue. |
@Mytherin confirmed, the locally compiled version works without issues.
|
This should be fixed via #12236, where we will provide pre-built wheels only for MacOS >= 12.0, and support for MacOS 11.0 will be via building from source. Given MacOS 11 is mostly discontinued, I think this might be an OK stance. Tonight set of nightly (available in about 6 hours) will be reviewed / tested some more, but I expect that PR to solve this issue. Thanks for raising this. |
What happens?
Getting segmentation fault: 11 errors when importing the duckdb package
To Reproduce
The environment is MacOs 11.7.10 (x86), Python 3.8.19 (and 3.12.3) installed through asdf.
Minimal reproduction
Trace:
OS:
MacOS 11.17.10
DuckDB Version:
0.10.3
DuckDB Client:
Python
Full Name:
Nikos Kastamoulas
Affiliation:
None/Personal Project
What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.
I have tested with a nightly build
Did you include all relevant data sets for reproducing the issue?
Yes
Did you include all code required to reproduce the issue?
Did you include all relevant configuration (e.g., CPU architecture, Python version, Linux distribution) to reproduce the issue?
The text was updated successfully, but these errors were encountered: