Segfault with sql_execute_df
I'm working on getting the python client to return a pyarrow.Table for cpu shared memory results, but hitting a segfault. Using the branch at https://github.com/TomAugspurger/pymapd/tree/mapd-update, running the following causes a segfault on the call to client.sql_execute_df
# file: segfault.py
import pymapd
query = "select depdelay from flights_2008_10k"
con = pymapd.connect(user="mapd", password="HyperInteractive", dbname="mapd",
host="localhost")
client = con._client # an instance of `MapD.Client`
session = con._session
r = client.sql_execute_df(session, query, 0, 0, -1)
print(r)
(pymapd isn't really required for this example; it's just a convenient way to generate the mapd bindings and create the connection)
Here's the output from the server, started under gdb
(gdb) file bin/mapd_server
Reading symbols from bin/mapd_server...done.
(gdb) run data --port 9091
Starting program: /Users/taugspurger/sandbox/mapd-core/build/bin/mapd_server data --port 9091
[New Thread 0x1403 of process 75950]
warning: unhandled dyld version (15)
E0629 16:04:50.441025 2832335808 MapDHandler.cpp:155] This build isn't CUDA enabled, will run on CPU
E0629 16:04:52.463640 2832335808 MapDHandler.cpp:184] No GPUs detected, falling back to CPU mode
# (this is where I start the script)
[New Thread 0x1207 of process 75950]
[New Thread 0x1503 of process 75950]
[New Thread 0x1603 of process 75950]
[New Thread 0x1703 of process 75950]
[New Thread 0x1803 of process 75950]
[New Thread 0x1903 of process 75950]
[New Thread 0x1a03 of process 75950]
[New Thread 0x1b03 of process 75950]
[New Thread 0x1c03 of process 75950]
[New Thread 0x1d03 of process 75950]
[New Thread 0x1e03 of process 75950]
Thread 3 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x1207 of process 75950]
0x000000010019b71c in MapDHandler::validate_rel_alg (this=0x7000069f9930, _return=..., query_str=..., session_info=...) at /Users/taugspurger/sandbox/mapd-core/ThriftHandler/MapDHandler.cpp:652
652 }
Anything else I can provide to aid in debugging? I'm running mapd-core master (0235498abf899e295d5f5d0c92ef191598340805) with arrow enabled, and arrow / pyarrow 0.4.1
Thank you for the report! Which operating system / tool-chain versions are you using? Also, do you have libunwind installed?
@m1mc We'll have to look into it.
I'm on macOS 10.12.5. Not sure what all versions would be in the tool-chain, but clang --version outputs
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Anything else that would be useful?
I don't think I have libunwind installed.
What CMake options you using? Specifically, are you building with CUDA enabled or disabled?
second Andrew.
@TomAugspurger I did repro a segfault w/ HAVE_CUDA off, otherwise pymapd was working well w/ latest sql_execute_df on my macOS 10.11. The root cause of my segfault is due to access to void cuda manager by non-CUDA build or CUDA build in CPU mode.
Thanks for the info, this build was with CUDA disabled. I'll give it a shot with it enabled.
2966fac6d65f8019d62eee2035d0d42dda11621a should fix it, let us know.
@asuhan thanks, that fixed it.