Basic Add example segfaults

M1 Apple Silicone
OSX: Sonoma 14.4.1
Python 3.9
concrete-pythonv2.6.0
xcode 15.4

Hi has anyone seen this error?

I am trying out Concrete getting started example and when I run the Add example in README it crashes with a segfault when the circuit = compiler.compile(inputset) line is executed. I am wondering if this has to do with the combinations of the code and the concrete lib version. Has anyone seen this error before? I didn’t find similar reporting in the forum. Here is the backtrace

PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  _mlir.cpython-39-darwin.so              0x00000001028a1480 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  _mlir.cpython-39-darwin.so              0x00000001028a03d8 llvm::sys::RunSignalHandlers() + 72
2  _mlir.cpython-39-darwin.so              0x00000001028a1b20 llvm::sys::PrintStackTraceOnErrorSignal(llvm::StringRef, bool) + 784
3  libsystem_platform.dylib                0x000000019e5db584 _sigtramp + 56
4  libConcretelangBindingsPythonCAPI.dylib 0x0000000107c0dad8 mlir::SymbolTable::getSymbolName(mlir::Operation*) + 28
5  libConcretelangBindingsPythonCAPI.dylib 0x0000000107c0dad8 mlir::SymbolTable::getSymbolName(mlir::Operation*) + 28
6  _concretelang.cpython-39-darwin.so      0x00000001036e8ed8 mlir::concretelang::createTFHECircuitSolutionParametrizationPass(std::__1::optional<concrete_optimizer::dag::CircuitSolution>) + 48664
7  _concretelang.cpython-39-darwin.so      0x00000001036e8890 mlir::concretelang::createTFHECircuitSolutionParametrizationPass(std::__1::optional<concrete_optimizer::dag::CircuitSolution>) + 47056
8  libConcretelangBindingsPythonCAPI.dylib 0x0000000107c1ab48 mlir::detail::walk(mlir::Operation*, llvm::function_ref<mlir::WalkResult (mlir::Operation*)>, mlir::WalkOrder) + 232
9  libConcretelangBindingsPythonCAPI.dylib 0x0000000107c1ab0c mlir::detail::walk(mlir::Operation*, llvm::function_ref<mlir::WalkResult (mlir::Operation*)>, mlir::WalkOrder) + 172
10 _concretelang.cpython-39-darwin.so      0x00000001036de7e0 mlir::concretelang::createTFHECircuitSolutionParametrizationPass(std::__1::optional<concrete_optimizer::dag::CircuitSolution>) + 5920
11 _concretelang.cpython-39-darwin.so      0x00000001036ddd1c mlir::concretelang::createTFHECircuitSolutionParametrizationPass(std::__1::optional<concrete_optimizer::dag::CircuitSolution>) + 3164
12 libConcretelangBindingsPythonCAPI.dylib 0x0000000107aed4ec mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) + 412
13 libConcretelangBindingsPythonCAPI.dylib 0x0000000107aedbc4 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) + 312
14 libConcretelangBindingsPythonCAPI.dylib 0x0000000107aef764 mlir::PassManager::run(mlir::Operation*) + 1124
15 _concretelang.cpython-39-darwin.so      0x00000001034badd4 mlir::concretelang::pipeline::parametrizeTFHE(mlir::MLIRContext&, mlir::ModuleOp&, std::__1::optional<mlir::concretelang::V0FHEContext>&, std::__1::function<bool (mlir::Pass*)>) + 1172
16 _concretelang.cpython-39-darwin.so      0x00000001034cb264 mlir::concretelang::CompilerEngine::compile(mlir::ModuleOp, mlir::concretelang::CompilerEngine::Target, std::__1::optional<std::__1::shared_ptr<mlir::concretelang::CompilerEngine::Library>>) + 3736
17 _concretelang.cpython-39-darwin.so      0x00000001034ce938 mlir::concretelang::CompilerEngine::compile(mlir::ModuleOp, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, bool, bool, bool, bool) + 420
18 _concretelang.cpython-39-darwin.so      0x00000001034ce810 mlir::concretelang::CompilerEngine::compile(mlir::ModuleOp, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, bool, bool, bool, bool) + 124
19 _concretelang.cpython-39-darwin.so      0x000000010339d838 PyInit__concretelang + 95960
20 _concretelang.cpython-39-darwin.so      0x000000010339d358 PyInit__concretelang + 94712
21 _concretelang.cpython-39-darwin.so      0x00000001033f0418 PyInit__concretelang + 434872
22 _concretelang.cpython-39-darwin.so      0x00000001033905e0 PyInit__concretelang + 42112
23 Python                                  0x0000000101618340 cfunction_call + 60
24 Python                                  0x00000001015d1824 _PyObject_MakeTpCall + 132
25 Python                                  0x00000001015d4e10 method_vectorcall + 604
26 Python                                  0x00000001016ab4f8 call_function + 128
27 Python                                  0x00000001016a6128 _PyEval_EvalFrameDefault + 22388
28 Python                                  0x000000010169fb70 _PyEval_EvalCode + 416
29 Python                                  0x00000001015d24bc _PyFunction_Vectorcall + 344
30 Python                                  0x00000001016ab4f8 call_function + 128
31 Python                                  0x00000001016a4fc0 _PyEval_EvalFrameDefault + 17932
32 Python                                  0x000000010169fb70 _PyEval_EvalCode + 416
33 Python                                  0x00000001015d24bc _PyFunction_Vectorcall + 344
34 Python                                  0x00000001016ab4f8 call_function + 128
35 Python                                  0x00000001016a1f04 _PyEval_EvalFrameDefault + 5456
36 Python                                  0x00000001015d241c _PyFunction_Vectorcall + 184
37 Python                                  0x00000001016ab4f8 call_function + 128
38 Python                                  0x00000001016a4fc0 _PyEval_EvalFrameDefault + 17932
39 Python                                  0x000000010169fb70 _PyEval_EvalCode + 416
40 Python                                  0x00000001015d24bc _PyFunction_Vectorcall + 344
41 Python                                  0x00000001015d1ba8 _PyObject_FastCallDictTstate + 96
42 Python                                  0x0000000101637e60 slot_tp_init + 192
43 Python                                  0x000000010163ca7c type_call + 300
44 Python                                  0x00000001015d1824 _PyObject_MakeTpCall + 132
45 Python                                  0x00000001016ab584 call_function + 268
46 Python                                  0x00000001016a1810 _PyEval_EvalFrameDefault + 3676
47 Python                                  0x000000010169fb70 _PyEval_EvalCode + 416
48 Python                                  0x00000001015d24bc _PyFunction_Vectorcall + 344
49 Python                                  0x00000001016ab4f8 call_function + 128
50 Python                                  0x00000001016a4fc0 _PyEval_EvalFrameDefault + 17932
51 Python                                  0x00000001015d241c _PyFunction_Vectorcall + 184
52 Python                                  0x00000001016ab4f8 call_function + 128
53 Python                                  0x00000001016a1810 _PyEval_EvalFrameDefault + 3676
54 Python                                  0x000000010169fb70 _PyEval_EvalCode + 416
55 Python                                  0x00000001016ec468 run_eval_code_obj + 136
56 Python                                  0x00000001016ec398 run_mod + 112
57 Python                                  0x00000001016eadb8 pyrun_file + 168
58 Python                                  0x00000001016ea7f4 pyrun_simple_file + 252
59 Python                                  0x00000001016ea6b8 PyRun_SimpleFileExFlags + 80
60 Python                                  0x00000001017043a4 pymain_run_file + 316
61 Python                                  0x0000000101703c84 Py_RunMain + 972
62 Python                                  0x0000000101704d08 Py_BytesMain + 40
63 dyld                                    0x000000019e2220e0 start + 2360

Also when running the full install of concrete-python, using pip install concrete-python[full] it complains about not finding the package

❯ pip install concrete-python[full]
zsh: no matches found: concrete-python[full]

Hi @ajay_m

For the segfault, we have released a fix (2.6.2) in our own package index, you can already install it using pip install --extra-index-url https://pypi.zama.ai. It should be soon available in PyPI as well.

2 Likes

Thanks @Ayoub. The new release 2.6.2 works