Reproducer:
use CTypes;
class foo {
var bar : int(64);
};
proc main() {
var myFoo = new unmanaged foo();
myFoo.bar = 8675309;
writeln("myFoo: ", myFoo);
var myPtr = c_ptrTo(myFoo);
writeln("myPtr: ", myPtr);
//Assertion fails on this deref:
var myDeref = myPtr.deref();
writeln("myDeref: ", myDeref);
delete myFoo;
}
Compiles fine with flags -g --devel --verify
, when run produces:
myFoo: {bar = 8675309}
myPtr: 0x7fff867fee10
comm-none.c:171: void chpl_comm_get(void *, c_nodeid_t, void *, size_t, int32_t, int, int32_t): Assertion `node==0' failed.
chpl
is compiled with DEBUG=1 OPTIMIZE=0 CHPL_LLVM=system CHPL_LOCALE_MODEL=gpu CC=clang CXX=clang++
. System Clang/LLVM is version 14
Backtrace:
#0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=140737307996160) at ./nptl/pthread_kill.c:44
#1 __pthread_kill_internal (signo=6, threadid=140737307996160) at ./nptl/pthread_kill.c:78
#2 __GI___pthread_kill (threadid=140737307996160, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3 0x00007ffff5df0476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4 0x00007ffff5dd67f3 in __GI_abort () at ./stdlib/abort.c:79
#5 0x00007ffff5dd671b in __assert_fail_base (fmt=0x7ffff5f8b150 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55555579d665 "node==0", file=0x55555579d366 "comm-none.c", line=171,
function=<optimized out>) at ./assert/assert.c:92
#6 0x00007ffff5de7e96 in __GI___assert_fail (assertion=0x55555579d665 "node==0", file=0x55555579d366 "comm-none.c", line=171,
function=0x55555579d58f "void chpl_comm_get(void *, c_nodeid_t, void *, size_t, int32_t, int, int32_t)") at ./assert/assert.c:101
#7 0x0000555555677550 in chpl_comm_get ()
#8 0x000055555566462c in chpl_gen_comm_get(void*, int, void*, unsigned long, int, int, int) ()
#9 0x00005555555fe7db in writeThisFieldsDefaultImpl_chpl2 (writer=<optimized out>, x=..., first=<optimized out>, error_out=<optimized out>)
at /home/psath/chapelWorkspace/tool-installs/chapel-1.29.0-build.gdb-talos/share/chapel/1.29/modules/standard/ChapelIO.chpl:187
#10 0x0000555555600203 in writeThisDefaultImpl_chpl (writer=<optimized out>, x=..., error_out=<optimized out>)
at /home/psath/chapelWorkspace/tool-installs/chapel-1.29.0-build.gdb-talos/share/chapel/1.29/modules/standard/ChapelIO.chpl:261
#11 0x0000555555663bb1 in _auto_foo_write_chpl (this=..., f=<optimized out>, error_out=<optimized out>) at .//repro.chpl:3
#12 0x000055555564e1ee in _write_one_internal_chpl11 (_channel_internal=<optimized out>, x=..., loc=<optimized out>, error_out=<optimized out>)
at /home/psath/chapelWorkspace/tool-installs/chapel-1.29.0-build.gdb-talos/share/chapel/1.29/modules/standard/IO.chpl:3978
#13 0x000055555564a12a in _writeOne_chpl7 (this=<optimized out>, x=..., loc=<optimized out>, error_out=<optimized out>)
at /home/psath/chapelWorkspace/tool-installs/chapel-1.29.0-build.gdb-talos/share/chapel/1.29/modules/standard/IO.chpl:3794
#14 0x0000555555653ad7 in on_fn_chpl101 (this=<optimized out>, args=..., origLocale=<optimized out>, error_out=...)
at /home/psath/chapelWorkspace/tool-installs/chapel-1.29.0-build.gdb-talos/share/chapel/1.29/modules/standard/IO.chpl:5921
#15 0x0000555555657efd in writeln_chpl4 (this=<optimized out>, _e0_args=<optimized out>, _e1_args=..., error_out=<optimized out>)
at /home/psath/chapelWorkspace/tool-installs/chapel-1.29.0-build.gdb-talos/share/chapel/1.29/modules/standard/IO.chpl:5974
#16 0x0000555555600da8 in writeln_chpl2 (_e0_args=<optimized out>, _e1_args=...) at /home/psath/chapelWorkspace/tool-installs/chapel-1.29.0-build.gdb-talos/share/chapel/1.29/modules/standard/ChapelIO.chpl:717
#17 0x000055555566409c in chpl_user_main () at .//repro.chpl:14
#18 0x0000555555663d26 in chpl_gen_main () at .//repro.chpl:7
#19 0x000055555566ebb5 in chpl_executable_init ()
#20 0x000055555567618d in chapel_wrapper ()
#21 0x00005555556d4f91 in qthread_wrapper ()
#22 0x0000000000000000 in ?? ()