KEMBAR78
"Segmentation Fault" happened when import faiss · Issue #2465 · facebookresearch/faiss · GitHub
Skip to content

"Segmentation Fault" happened when import faiss #2465

@loner233

Description

@loner233

Summary

"Segmentation Fault" happened when use azure tts sdk and faiss at the same time.
截屏2022-09-13 14 07 49

截屏2022-09-13 14 07 36

Platform

I'm not sure this problem can be reproducted on other platform
OS: Ubuntu 18.04

Faiss version: 1.7.2

Installed from: anaconda

Faiss compilation options: Not compiled from source
conda install -c pytorch faiss-cpu

Running on:

  • CPU
  • GPU

Interface:

  • C++
  • Python

Reproduction instructions

import azure.cognitiveservices.speech as speechsdk
import faiss
import faulthandler
faulthandler.enable()

speech_config = speechsdk.SpeechConfig(subscription="hidden", region="chinanorth2")
synthesizer = speechsdk.SpeechSynthesizer(speech_config=speech_config, audio_config=None)
result = synthesizer.speak_text_async('hello, world').get()
(test3) root@yinjiakang-devbox:/mnt3/demo/test# python test.py 
Fatal Python error: Segmentation fault

Current thread 0x00007f4f8f21a0c0 (most recent call first):
  File "/root/miniconda3/envs/test3/lib/python3.6/site-packages/faiss/swigfaiss_avx2.py", line 94 in __next__
  File "/root/miniconda3/envs/test3/lib/python3.6/site-packages/azure/cognitiveservices/speech/speech_py_impl.py", line 5428 in audio_data
  File "/root/miniconda3/envs/test3/lib/python3.6/site-packages/azure/cognitiveservices/speech/speech.py", line 1039 in __init__
  File "/root/miniconda3/envs/test3/lib/python3.6/site-packages/azure/cognitiveservices/speech/speech.py", line 504 in get
  File "test.py", line 8 in <module>
Segmentation fault

And if I comment the import faiss, the code is passed

import azure.cognitiveservices.speech as speechsdk
# import faiss
import faulthandler
faulthandler.enable()

speech_config = speechsdk.SpeechConfig(subscription="hidden", region="chinanorth2")
synthesizer = speechsdk.SpeechSynthesizer(speech_config=speech_config, audio_config=None)
result = synthesizer.speak_text_async('hello, world').get()

And if I comment the azure tts code, the code is passed too

# import azure.cognitiveservices.speech as speechsdk
import faiss
import faulthandler
faulthandler.enable()

# speech_config = speechsdk.SpeechConfig(subscription="hidden", region="chinanorth2")
# synthesizer = speechsdk.SpeechSynthesizer(speech_config=speech_config, audio_config=None)
# result = synthesizer.speak_text_async('hello, world').get()
print("everything is ok")

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions