Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arcs, aux_labels = _fsa_from_str(s, acceptor, True), got Segmentation fault (core dumped) #515

Closed
hegc opened this issue Dec 16, 2020 · 13 comments

Comments

@hegc
Copy link

hegc commented Dec 16, 2020

Hi, I run the example snowfall, this line got Segmentation fault (core dumped), how to solve the problem?
arcs, aux_labels = _fsa_from_str(s, acceptor, True)

@qindazhu
Copy link
Collaborator

qindazhu commented Dec 16, 2020

mm, can you show us the stack trace? I can't figure out where did you get the error (though I guess you get crash when loading G at the begining of train.py, not sure if you install k2 correctly or not)

It's also better if you ask questions about snowfall under the repo of snowfall.

@qindazhu
Copy link
Collaborator

you can do gdb --args python3 train.py, and when crash, type bt

@csukuangfj
Copy link
Collaborator

Please at least take a screenshot of the error log.

@hegc
Copy link
Author

hegc commented Dec 16, 2020

image

@csukuangfj
Copy link
Collaborator

Please show the output of:

python3 -m k2.version
python3 -m torch.utils.collect_env

you can do gdb --args python3 train.py, and when crash, type bt

And the output of bt

@hegc
Copy link
Author

hegc commented Dec 16, 2020

env:
PyTorch version: 1.7.1+cu101
Is debug build: False
CUDA used to build PyTorch: 10.1
ROCM used to build PyTorch: N/A

OS: CentOS Linux release 7.7.1908 (Core) (x86_64)
GCC version: (crosstool-NG fa8859cb) 7.2.0
Clang version: Could not collect
CMake version: version 3.19.1

Python version: 3.7 (64-bit runtime)
Is CUDA available: True
CUDA runtime version: 10.1.243
GPU models and configuration:
GPU 0: Tesla P40

Nvidia driver version: 418.87.00
cuDNN version: /usr/local/cuda-9.2/targets/x86_64-linux/lib/libcudnn.so.7.1.4
HIP runtime version: N/A
MIOpen runtime version: N/A

Versions of relevant libraries:
[pip3] numpy==1.19.4
[pip3] torch==1.7.1+cu101
[pip3] torchaudio==0.7.0
[pip3] torchvision==0.8.2+cu101
[conda] numpy 1.19.4 pypi_0 pypi
[conda] torch 1.7.1+cu101 pypi_0 pypi
[conda] torchaudio 0.7.0 pypi_0 pypi
[conda] torchvision 0.8.2+cu101 pypi_0 pypi

@hegc
Copy link
Author

hegc commented Dec 16, 2020

(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x00007fff39771d81 in void k2::Eval<__nv_hdl_wrapper_t<false, false, __nv_dl_tag<void (k2::Array1::)(int), &k2::Array1::operator=, 1u>, void (int), int, int const> >(CUstream_st*, int, __nv_hdl_wrapper_t<false, false, __nv_dl_tag<void (k2::Array1::)(int), &k2::Array1::operator=, 1u>, void (int), int, int const>&) () from /env3.7/lib/python3.7/site-packages/libk2context.so
#2 0x00007fff397b5045 in k2::FsaFromArray1(k2::Array1k2::Arc&, bool*) () from /env3.7/lib/python3.7/site-packages/libk2context.so
#3 0x00007fff397e274c in k2::FsaFromString(std::string const&, bool, k2::Array1*) () from /env3.7/lib/python3.7/site-packages/libk2context.so
#4 0x00007fff3ca58676 in ?? () from /env3.7/lib/python3.7/site-packages/_k2.cpython-37m-x86_64-linux-gnu.so
#5 0x00007fff3ca3b708 in ?? () from /env3.7/lib/python3.7/site-packages/_k2.cpython-37m-x86_64-linux-gnu.so
#6 0x00005555556b5114 in _PyMethodDef_RawFastCallKeywords () at /tmp/build/80754af9/python_1578510683607/work/Objects/call.c:694
#7 0x00005555556b5231 in _PyCFunction_FastCallKeywords (func=0x7fff3cda49b0, args=args@entry=0x7ffff7e6aba8, nargs=nargs@entry=3, kwnames=kwnames@entry=0x0)
at /tmp/build/80754af9/python_1578510683607/work/Objects/call.c:734
#8 0x0000555555719324 in call_function (kwnames=0x0, oparg=3, pp_stack=) at /tmp/build/80754af9/python_1578510683607/work/Python/ceval.c:4568
#9 _PyEval_EvalFrameDefault () at /tmp/build/80754af9/python_1578510683607/work/Python/ceval.c:3124
#10 0x000055555566e9da in _PyEval_EvalCodeWithName () at /tmp/build/80754af9/python_1578510683607/work/Python/ceval.c:3930
#11 0x00005555556b4917 in _PyFunction_FastCallKeywords () at /tmp/build/80754af9/python_1578510683607/work/Objects/call.c:433
#12 0x00005555557160a6 in call_function (kwnames=0x7ffff09a83d0, oparg=, pp_stack=) at /tmp/build/80754af9/python_1578510683607/work/Python/ceval.c:4616
#13 _PyEval_EvalFrameDefault () at /tmp/build/80754af9/python_1578510683607/work/Python/ceval.c:3139
#14 0x00005555556b468b in function_code_fastcall (globals=, nargs=0, args=, co=) at /tmp/build/80754af9/python_1578510683607/work/Objects/call.c:283
#15 _PyFunction_FastCallKeywords () at /tmp/build/80754af9/python_1578510683607/work/Objects/call.c:408
#16 0x0000555555714fd6 in call_function (kwnames=0x0, oparg=, pp_stack=) at /tmp/build/80754af9/python_1578510683607/work/Python/ceval.c:4616
#17 _PyEval_EvalFrameDefault () at /tmp/build/80754af9/python_1578510683607/work/Python/ceval.c:3124
#18 0x000055555566e6f9 in _PyEval_EvalCodeWithName () at /tmp/build/80754af9/python_1578510683607/work/Python/ceval.c:3930
#19 0x000055555566f5f4 in PyEval_EvalCodeEx () at /tmp/build/80754af9/python_1578510683607/work/Python/ceval.c:3959
#20 0x000055555566f61c in PyEval_EvalCode (co=co@entry=0x7ffff09501e0, globals=globals@entry=0x7ffff7f4cbe0, locals=locals@entry=0x7ffff7f4cbe0)
at /tmp/build/80754af9/python_1578510683607/work/Python/ceval.c:524
#21 0x0000555555770974 in run_mod () at /tmp/build/80754af9/python_1578510683607/work/Python/pythonrun.c:1035
#22 0x000055555577acf1 in PyRun_FileExFlags () at /tmp/build/80754af9/python_1578510683607/work/Python/pythonrun.c:988
#23 0x000055555577aee3 in PyRun_SimpleFileExFlags () at /tmp/build/80754af9/python_1578510683607/work/Python/pythonrun.c:429
#24 0x000055555577afad in PyRun_AnyFileExFlags () at /tmp/build/80754af9/python_1578510683607/work/Python/pythonrun.c:84
#25 0x000055555577bf95 in pymain_run_file (p_cf=0x7fffffffe0e0, filename=0x5555558b1370 L"train.py", fp=0x555555930600) at /tmp/build/80754af9/python_1578510683607/work/Modules/main.c:434
#26 pymain_run_filename (cf=0x7fffffffe0e0, pymain=0x7fffffffe1f0) at /tmp/build/80754af9/python_1578510683607/work/Modules/main.c:1613
#27 pymain_run_python (pymain=0x7fffffffe1f0) at /tmp/build/80754af9/python_1578510683607/work/Modules/main.c:2874
#28 pymain_main () at /tmp/build/80754af9/python_1578510683607/work/Modules/main.c:3414
#29 0x000055555577c0bc in _Py_UnixMain () at /tmp/build/80754af9/python_1578510683607/work/Modules/main.c:3449
#30 0x00007ffff7813505 in __libc_start_main () from /lib64/libc.so.6
#31 0x0000555555724990 in _start () at ../sysdeps/x86_64/elf/start.S:103

@csukuangfj
Copy link
Collaborator

And the output of

python3 -m k2.version

?

@hegc
Copy link
Author

hegc commented Dec 16, 2020

No module named k2.version...lol
I use the Release 0.1

@csukuangfj
Copy link
Collaborator

Please install k2 with

pip install --pre k2

or refer to https://k2.readthedocs.io/en/latest/installation.html for how to install k2.

@hegc
Copy link
Author

hegc commented Dec 16, 2020

I install k2 from source, pip install dist/k2-0.0.1.dev20201216-cp37-cp37m-linux_x86_64.whl

@hegc
Copy link
Author

hegc commented Dec 16, 2020

I will try the newest source.

@hegc
Copy link
Author

hegc commented Dec 16, 2020

I use the newest K2 source code to build, now I can run the demo, thx for your help.

@hegc hegc closed this as completed Dec 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants