Cytnx-dev / Cytnx

Project Cytnx, A Cross-section of Python & C++,Tensor network library
Apache License 2.0
36 stars 14 forks source link

matplotlib show() Segmentation fault when cytnx is imported #348

Open chiamin opened 1 year ago

chiamin commented 1 year ago

I have a strange error. If I import cytnx, I got Segmentation fault when using matplotlib show(). This happened for either build-from-scratch or conda build. See a demo as follows

import cytnx
import matplotlib.pyplot as plt

xs = [0, 1]
fs = [0, 1]
plt.plot (xs, fs)
plt.show()
j9263178 commented 1 year ago

it looks similar to https://github.com/Cytnx-dev/Cytnx/issues/244.

chiamin commented 1 year ago

If I compile Cytnx without using conda, there is no problem. Segmentation fault appears only in the conda environment.

jeffry1829 commented 1 year ago

If I compile Cytnx without using conda, there is no problem. Segmentation fault appears only in the conda environment.

Sorry, what do you mean compile Cytnx without using conda? Do you mean you compile all dependencies without conda? Thanks!

j9263178 commented 1 year ago

@chiamin Sorry I cannot reproduce it on our machines, could you try gdb and paste what's going on?

chiamin commented 1 year ago

I used lldb can got the following results

Process 193489 launched: '/home/chiamin/miniconda3/envs/cytnx/bin/python3' (x86_64)
warning: (x86_64) /home/chiamin/miniconda3/envs/cytnx/lib/libstdc++.so.6 unsupported DW_FORM value: 0x1e
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
Process 193489 stopped
* thread #1, name = 'python3', stop reason = signal SIGSEGV: invalid address (fault address: 0x555d5624adf8)
    frame #0: 0x00007fffe9dcb5f2 libmkl_avx512.so.2`mkl_blas_avx512_xdcopy + 466
libmkl_avx512.so.2`mkl_blas_avx512_xdcopy:
->  0x7fffe9dcb5f2 <+466>: movq   (%r10,%r15), %r15
    0x7fffe9dcb5f6 <+470>: movq   %r15, (%r11,%rdi)
    0x7fffe9dcb5fa <+474>: movq   0x80(%rsp), %r15
    0x7fffe9dcb602 <+482>: movq   0x78(%rsp), %rdi
  thread #11, name = 'python3', stop reason = signal SIGSEGV: invalid address (fault address: 0x556f5624adf8)
    frame #0: 0x00007fffe9dcb5e5 libmkl_avx512.so.2`mkl_blas_avx512_xdcopy + 453
libmkl_avx512.so.2`mkl_blas_avx512_xdcopy:
->  0x7fffe9dcb5e5 <+453>: movq   (%r10,%r15), %r15
    0x7fffe9dcb5e9 <+457>: movq   %r15, (%r11,%r13)
    0x7fffe9dcb5ed <+461>: movq   0x58(%rsp), %r15
    0x7fffe9dcb5f2 <+466>: movq   (%r10,%r15), %r15
  thread #12, name = 'python3', stop reason = signal SIGSEGV: invalid address (fault address: 0x55895624ae10)
    frame #0: 0x00007fffe9dcb5e5 libmkl_avx512.so.2`mkl_blas_avx512_xdcopy + 453
libmkl_avx512.so.2`mkl_blas_avx512_xdcopy:
->  0x7fffe9dcb5e5 <+453>: movq   (%r10,%r15), %r15
    0x7fffe9dcb5e9 <+457>: movq   %r15, (%r11,%r13)
    0x7fffe9dcb5ed <+461>: movq   0x58(%rsp), %r15
    0x7fffe9dcb5f2 <+466>: movq   (%r10,%r15), %r15
  thread #13, name = 'python3', stop reason = signal SIGSEGV: invalid address (fault address: 0x55a35624ae28)
    frame #0: 0x00007fffe9dcb5e5 libmkl_avx512.so.2`mkl_blas_avx512_xdcopy + 453
libmkl_avx512.so.2`mkl_blas_avx512_xdcopy:
->  0x7fffe9dcb5e5 <+453>: movq   (%r10,%r15), %r15
    0x7fffe9dcb5e9 <+457>: movq   %r15, (%r11,%r13)
    0x7fffe9dcb5ed <+461>: movq   0x58(%rsp), %r15
    0x7fffe9dcb5f2 <+466>: movq   (%r10,%r15), %r15
Process 193489 exited with status = -1 (0xffffffff) debugserver died with an exit status of 0x00000000
chiamin commented 1 year ago

If I compile Cytnx without using conda, there is no problem. Segmentation fault appears only in the conda environment.

Sorry, what do you mean compile Cytnx without using conda? Do you mean you compile all dependencies without conda? Thanks!

Yes, that is what I mean.