Cytnx icon indicating copy to clipboard operation
Cytnx copied to clipboard

matplotlib show() Segmentation fault when cytnx is imported

Open chiamin opened this issue 2 years ago • 6 comments

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()

chiamin avatar Nov 01 '23 02:11 chiamin

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

j9263178 avatar Nov 01 '23 02:11 j9263178

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

chiamin avatar Nov 01 '23 10:11 chiamin

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!

jeffry1829 avatar Nov 01 '23 10:11 jeffry1829

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

j9263178 avatar Nov 03 '23 02:11 j9263178

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 avatar Nov 06 '23 08:11 chiamin

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.

chiamin avatar Nov 06 '23 08:11 chiamin