couchbase-python-client icon indicating copy to clipboard operation
couchbase-python-client copied to clipboard

Tensorflow and Couchbase Segmentation fault

Open patrizok opened this issue 11 months ago • 1 comments

Hello, I am trying to use tensorflow but when I import library it cause segmentation fault.

import faulthandler

faulthandler.enable()
import tensorflow

from couchbase.cluster import Cluster
from couchbase.options import QueryOptions, ClusterOptions, ClusterTimeoutOptions, Compression, RemoveOptions, SearchOptions
from couchbase.auth import PasswordAuthenticator

cluster = Cluster.connect('couchbase://X.X.X.X', ClusterOptions(PasswordAuthenticator('Administrator', 'xxxxxxxxx')))

print("Success")

This is the example code for test purpose. And fault shown below. I use Python 3.11.0rc1 with Ubuntu 22.04.5 LTS because of tensorflow's docker.


2025-01-30 07:15:02.705956: I tensorflow/core/util/port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2025-01-30 07:15:02.738876: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
Fatal Python error: Segmentation fault

Current thread 0x00007f8b005b2280 (most recent call first):
  File "/usr/local/lib/python3.11/dist-packages/couchbase/logic/cluster.py", line 407 in _connect_cluster
  File "/usr/local/lib/python3.11/dist-packages/couchbase/cluster.py", line 105 in _connect
  File "/usr/local/lib/python3.11/dist-packages/couchbase/logic/wrappers.py", line 82 in wrapped_fn
  File "/usr/local/lib/python3.11/dist-packages/couchbase/cluster.py", line 101 in __init__
  File "/usr/local/lib/python3.11/dist-packages/couchbase/cluster.py", line 824 in connect
  File "/usr/src/app/project_face/tensortest.py", line 10 in <module>

Extension modules: numpy._core._multiarray_umath, numpy._core._multiarray_tests, numpy.linalg._umath_linalg, google._upb._message, charset_normalizer.md, requests.packages.charset_normalizer.md, requests.packages.chardet.md, h5py._errors, h5py.defs, h5py._objects, h5py.h5, h5py.utils, h5py.h5t, h5py.h5s, h5py.h5ac, h5py.h5p, h5py.h5r, h5py._proxy, h5py._conv, h5py.h5z, h5py.h5a, h5py.h5d, h5py.h5ds, h5py.h5g, h5py.h5i, h5py.h5o, h5py.h5f, h5py.h5fd, h5py.h5pl, h5py.h5l, h5py._selector, PIL._imaging, couchbase.pycbc_core (total: 33)
Segmentation fault

patrizok avatar Jan 30 '25 07:01 patrizok

Hi @patrizok -- I have created PYCBC-1653 to track the investigation in our JIRA system.

I believe I will have some follow-up questions, but I will first try and see what I an potentially reproduce w/ tensorflow in a Linux environment.

thejcfactor avatar Feb 08 '25 01:02 thejcfactor