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

Aborted (core dumped) in jt.array #609

Open
x0w3n opened this issue Dec 2, 2024 · 0 comments
Open

Aborted (core dumped) in jt.array #609

x0w3n opened this issue Dec 2, 2024 · 0 comments

Comments

@x0w3n
Copy link

x0w3n commented Dec 2, 2024

Describe the bug

A crash occurs when an invalid index value is used in the index_select operation.

Full Log

[i 1202 22:13:53.915124 80 compiler.py:956] Jittor(1.3.9.10) src: /home/miniconda3/envs/jittor/lib/python3.9/site-packages/jittor
[i 1202 22:13:53.925892 80 compiler.py:957] g++ at /usr/bin/g++(11.2.0)
[i 1202 22:13:53.926359 80 compiler.py:958] cache_path: /home/.cache/jittor/jt1.3.9/g++11.2.0/py3.9.12/Linux-5.15.0-1x30/INTELRXEONRGOLx51/ef26/default
[i 1202 22:13:53.994286 80 install_cuda.py:93] cuda_driver_version: [12, 2]
[i 1202 22:13:54.008650 80 __init__.py:412] Found /home/.cache/jittor/jtcuda/cuda12.2_cudnn8_linux/bin/nvcc(12.2.140) at /home/.cache/jittor/jtcuda/cuda12.2_cudnn8_linux/bin/nvcc.
[i 1202 22:13:54.459287 80 __init__.py:412] Found gdb(12.0.90) at /usr/bin/gdb.
[i 1202 22:13:54.462113 80 __init__.py:412] Found addr2line(2.38) at /usr/bin/addr2line.
[i 1202 22:13:54.919189 80 compiler.py:1013] cuda key:cu12.2.140_sm_89
[i 1202 22:13:56.218415 80 __init__.py:227] Total mem: 251.50GB, using 16 procs for compiling.
[i 1202 22:13:56.400181 80 jit_compiler.cc:28] Load cc_path: /usr/bin/g++
[i 1202 22:13:56.596494 80 init.cc:63] Found cuda archs: [89,]
Caught segfault at address 0x7f9d7396d400, thread_name: '', flush log...
[i 1202 22:13:57.597146 80 tracer.cc:149] stack trace for pid= 346204
[New LWP 346450]
[New LWP 346451]
[New LWP 346452]
[New LWP 346453]
[New LWP 346454]
[New LWP 346455]
[New LWP 346456]
[New LWP 346533]
[New LWP 346534]
[New LWP 346535]
[New LWP 346536]
[New LWP 346537]
[New LWP 346538]
[New LWP 346539]
[New LWP 346540]
[New LWP 346541]
[New LWP 346542]
[New LWP 346543]
[New LWP 346544]
[New LWP 346545]
[New LWP 346546]
[New LWP 346547]
[New LWP 346548]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007f9db325749f in __GI___wait4 (pid=346549, stat_loc=0x0, options=0, usage=0x0) at ../sysdeps/unix/sysv/linux/wait4.c:30
30      ../sysdeps/unix/sysv/linux/wait4.c: No such file or directory.
Traceback (most recent call last):
  File "/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30-gdb.py", line 60, in <module>
    from libstdcxx.v6 import register_libstdcxx_printers
ModuleNotFoundError: No module named 'libstdcxx'
[Current thread is 1 (Thread 0x7f9db3168740 (LWP 346204))]
#0  0x00007f9db325749f in __GI___wait4 (pid=346549, stat_loc=0x0, options=0, usage=0x0) at ../sysdeps/unix/sysv/linux/wait4.c:30
#1  0x00007f9db1a057f7 in jittor::print_trace() () from /home/.cache/jittor/jt1.3.9/g++11.2.0/py3.9.12/Linux-5.15.0-1x30/INTELRXEONRGOLx51/ef26/default/jit_utils_core.cpython-39-x86_64-linux-gnu.so
#2  0x00007f9db1a02a65 in jittor::segfault_sigaction(int, siginfo_t*, void*) () from /home/.cache/jittor/jt1.3.9/g++11.2.0/py3.9.12/Linux-5.15.0-1x30/INTELRXEONRGOLx51/ef26/default/jit_utils_core.cpython-39-x86_64-linux-gnu.so
#3  <signal handler called>
#4  jittor::GetitemOp::jit_run (this=<optimized out>) at /home/.cache/jittor/jt1.3.9/g++11.2.0/py3.9.12/Linux-5.15.0-1x30/INTELRXEONRGOLx51/ef26/default/cu12.2.140_sm_89/jit/getitem__Ti_float32__IDIM_4__ODIM_2__FOV_0__VD_1__IV0_1__IO0__1__VS0_1__VST0_int64__IV1__1___hash_cbfbcf156cdfe5f8_op.cc:132
#5  0x00007f9dab3e5520 in jittor::Profiler::record_and_run(void (*)(jittor::Op*), jittor::Op*, char const*) () from /home/.cache/jittor/jt1.3.9/g++11.2.0/py3.9.12/Linux-5.15.0-1x30/INTELRXEONRGOLx51/ef26/default/cu12.2.140_sm_89/jittor_core.cpython-39-x86_64-linux-gnu.so
#6  0x00007f9dab3ed12c in jittor::Executor::run_sync(std::vector<jittor::Var*, std::allocator<jittor::Var*> >, bool, bool) () from /home/.cache/jittor/jt1.3.9/g++11.2.0/py3.9.12/Linux-5.15.0-1x30/INTELRXEONRGOLx51/ef26/default/cu12.2.140_sm_89/jittor_core.cpython-39-x86_64-linux-gnu.so
#7  0x00007f9dab2d7414 in jittor::sync(std::vector<jittor::VarHolder*, std::allocator<jittor::VarHolder*> > const&, bool, bool) () from /home/.cache/jittor/jt1.3.9/g++11.2.0/py3.9.12/Linux-5.15.0-1x30/INTELRXEONRGOLx51/ef26/default/cu12.2.140_sm_89/jittor_core.cpython-39-x86_64-linux-gnu.so
#8  0x00007f9dab2d76f3 in jittor::VarHolder::sync(bool, bool) () from /home/.cache/jittor/jt1.3.9/g++11.2.0/py3.9.12/Linux-5.15.0-1x30/INTELRXEONRGOLx51/ef26/default/cu12.2.140_sm_89/jittor_core.cpython-39-x86_64-linux-gnu.so
#9  0x00007f9dab2d7b20 in jittor::VarHolder::fetch_sync() () from /home/.cache/jittor/jt1.3.9/g++11.2.0/py3.9.12/Linux-5.15.0-1x30/INTELRXEONRGOLx51/ef26/default/cu12.2.140_sm_89/jittor_core.cpython-39-x86_64-linux-gnu.so
Undefined command: "py-bt".  Try "help".
[Inferior 1 (process 346204) detached]
Segfault, exit
terminate called without an active exception
Aborted (core dumped)

Minimal Reproduce

import jittor as jt
from jittor.models.alexnet import alexnet

input_tensor = jt.rand(1, 3, 224, 224)
index_tensor = jt.array([-1], dtype=jt.int64)
output_tensor = input_tensor.index_select(1, index_tensor)
print(output_tensor)

Expected behavior

Index values need to be checked to prevent crashes.

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

1 participant