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.scatter #608

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

Aborted (core dumped) in jt.scatter #608

x0w3n opened this issue Dec 2, 2024 · 0 comments

Comments

@x0w3n
Copy link

x0w3n commented Dec 2, 2024

Describe the bug

jt.scatter crashes when the index value is a large negative number.

Full Log

[i 1202 22:06:04.409335 80 compiler.py:956] Jittor(1.3.9.10) src: /home/miniconda3/envs/jittor/lib/python3.9/site-packages/jittor
[i 1202 22:06:04.416845 80 compiler.py:957] g++ at /usr/bin/g++(11.2.0)
[i 1202 22:06:04.416900 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:06:04.504203 80 install_cuda.py:93] cuda_driver_version: [12, 2]
[i 1202 22:06:04.518905 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:06:04.779799 80 __init__.py:412] Found gdb(12.0.90) at /usr/bin/gdb.
[i 1202 22:06:04.782767 80 __init__.py:412] Found addr2line(2.38) at /usr/bin/addr2line.
[i 1202 22:06:04.997342 80 compiler.py:1013] cuda key:cu12.2.140_sm_89
[i 1202 22:06:06.005564 80 __init__.py:227] Total mem: 251.50GB, using 16 procs for compiling.
[i 1202 22:06:06.238457 80 jit_compiler.cc:28] Load cc_path: /usr/bin/g++
[i 1202 22:06:06.487411 80 init.cc:63] Found cuda archs: [89,]
Caught segfault at address 0x7f73639f6bc0, thread_name: '', flush log...
[i 1202 22:06:07.309287 80 tracer.cc:149] stack trace for pid= 344699
[New LWP 344957]
[New LWP 344958]
[New LWP 344959]
[New LWP 344960]
[New LWP 344961]
[New LWP 344962]
[New LWP 344963]
[New LWP 345052]
[New LWP 345053]
[New LWP 345054]
[New LWP 345055]
[New LWP 345056]
[New LWP 345057]
[New LWP 345058]
[New LWP 345059]
[New LWP 345060]
[New LWP 345061]
[New LWP 345062]
[New LWP 345063]
[New LWP 345064]
[New LWP 345065]
[New LWP 345066]
[New LWP 345067]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007f73a214b49f in __GI___wait4 (pid=345068, 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 0x7f73a205c740 (LWP 344699))]
#0  0x00007f73a214b49f in __GI___wait4 (pid=345068, stat_loc=0x0, options=0, usage=0x0) at ../sysdeps/unix/sysv/linux/wait4.c:30
#1  0x00007f73a08f97f7 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  0x00007f73a08f6a65 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  0x00007f739c002300 in jittor::SetitemOp::jit_run (this=0x5628b720e3d0) 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/setitem__OP_void__Td_int32__BMASK_3__Ti_int32__IDIM_2__ODIM_2__FOV_0__VD_2__IV0_0__IO0__1____hash_c44d3833810b592c_op.cc:132
#5  0x00007f739e466520 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  0x00007f739e46e12c 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  0x00007f739e358414 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  0x00007f739e3586f3 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  0x00007f739e358b20 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 344699) detached]
Segfault, exit
terminate called without an active exception
Aborted (core dumped)

Minimal Reproduce

import jittor as jt
import numpy as np

x = jt.zeros((3, 5), dtype=jt.int32)
index = jt.array([[0, -10000, 2], [0, 1, 4]])
src = jt.array([[0, 10, 20, 30, 40], [50, 60, 70, 80, 90]])
result = jt.scatter(x, 1, index, src)
print(result)

Expected behavior

The index parameters 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