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

[Bug]: Occasional segfault when throwing an error from inside a coforall #26652

Open
jabraham17 opened this issue Feb 4, 2025 · 6 comments
Open

Comments

@jabraham17
Copy link
Member

Summary of Problem

Description:
When throwing an error from inside a coforall, I am seeing it sometimes crashes with a segfault at a few places in our runtime. Sometimes the code runs to completion and sometimes it hits a segfault. The likelihood of a segfault increases with the number of locales, I find that with 4 locales I get one about every other run.

Is this issue currently blocking your progress?
yes

Steps to Reproduce

Source Code:

use CTypes;
class C {
  var id: int;
  var mem: c_ptr(int);
  proc init(id) {
    this.id = id;
    mem = allocate(int, 1);
    init this;
    writeln("init ", this.id);
  }
  proc deinit() {
    deallocate(mem);
    writeln("deinit ", this.id);
  }
  override proc serialize(writer, ref serializer) throws do
    writer.write("id is ", id, " mem ", mem, " *mem ", mem.deref());
}

proc bar() throws {
  coforall l in Locales do on l {
    var x = new C(l.id);
    if l.id == 1 then throw new Error("exception");
    writeln("printing ", l.id, ": ", x);
  }
}

proc main() {
  try {
    bar();
  } catch e {
    writeln("Exception: ", e);
  }
}

Compile command:
chpl foo.chpl

Execution command:
./foo -nl 4

Example output

init 0
printing 0: id is 0 mem 0x11543c000 *mem 2
deinit 0
init 2
init 1
*** Caught a fatal signal (proc 0): SIGSEGV(11)
*** NOTICE (proc 0): Before reporting bugs, run with GASNET_BACKTRACE=1 in the environment to generate a backtrace.
printing 2: %  

Example output with GASNET_BACKTRACE=1

init 0
printing 0: id is 0 mem 0x114e24000 *mem 2
deinit 0
init 2
init 1
init 3
*** Caught a fatal signal (proc 0): SIGSEGV(11)
[0] Invoking LLDB for backtrace...
[0] /usr/bin/lldb -p 48489 -o 'bt all' -o quit
[0] (lldb) process attach --pid 48489
[0] Process 48489 stopped
[0] * thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
[0]     frame #0: 0x00000001a82ab750 libsystem_kernel.dylib`__psynch_cvwait + 8
[0] libsystem_kernel.dylib`:
[0] ->  0x1a82ab750 <+8>:  b.lo   0x1a82ab770               ; <+40>
[0]     0x1a82ab754 <+12>: pacibsp 
[0]     0x1a82ab758 <+16>: stp    x29, x30, [sp, #-0x10]!
[0]     0x1a82ab75c <+20>: mov    x29, sp
[0] Target 0: (a.out_real) stopped.
[0] Executable module set to "/Users/jade/Development/chapel-lang/chapel/a.out_real".
[0] Architecture set to: arm64-apple-macosx-.
[0] (lldb) bt all
[0] * thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
[0]   * frame #0: 0x00000001a82ab750 libsystem_kernel.dylib`__psynch_cvwait + 8
[0]     frame #1: 0x00000001a82e8574 libsystem_pthread.dylib`_pthread_cond_wait + 1232
[0]     frame #2: 0x00000001025ad778 a.out_real`qthread_feb_blocker_func(dest=0x0000000000000000, src=0x00000001027b7f38, t=READFF) at feb.c:189:27
[0]     frame #3: 0x00000001025ae80c a.out_real`qthread_readFF(dest=0x0000000000000000, src=0x00000001027b7f38) at feb.c:1012:21
[0]     frame #4: 0x000000010256b738 a.out_real`chpl_task_callMain(chpl_main=(a.out_real`chpl_executable_init at chpl-init.c:385)) at tasks-qthreads.c:961:5
[0]     frame #5: 0x000000010254d5b8 a.out_real`main(argc=3, argv=0x000000016d98ec90) at main.c:33:3
[0]     frame #6: 0x00000001a7f8ff28 dyld`start + 2236
[0]   thread #2
[0]     frame #0: 0x00000001a82a9c08 libsystem_kernel.dylib`__workq_kernreturn + 8
[0]   thread #3
[0]     frame #0: 0x00000001a82a9c08 libsystem_kernel.dylib`__workq_kernreturn + 8
[0]   thread #4
[0]     frame #0: 0x00000001025b979c a.out_real`qthread_internal_self at qthread.c:1221:20
[0]     frame #1: 0x00000001025ba9e8 a.out_real`qthread_yield_(k=0) at qthread.c:1802:18
[0]     frame #2: 0x000000010256a35c a.out_real`chpl_task_yield at tasks-qthreads.c:203:9
[0]     frame #3: 0x00000001024c56a0 a.out_real`on_fn_chpl16(this_chpl7=chpl____wide__ref_AtomicT_int64_t @ 0x000000010e449978, val_chpl=0) at Atomics.c:780:5
[0]     frame #4: 0x00000001024dca70 a.out_real`_waitEndCount_chpl2(e_chpl=0x000000010bff4180, numTasks_chpl=4, error_out_chpl=0x000000010e44a250) at ChapelBase.c:2585:5
[0]     frame #5: 0x000000010254ccdc a.out_real`bar_chpl(error_out_chpl=0x000000010e44a630) at bar.c:1348:3
[0]     frame #6: 0x00000001024a9148 a.out_real`chpl_user_main at bar.c:1472:3
[0]     frame #7: 0x00000001024a8ef4 a.out_real`chpl_gen_main(_arg=0x00000001027be9b0) at bar.c:1499:3
[0]     frame #8: 0x0000000102563a68 a.out_real`chpl_executable_init at chpl-init.c:392:38
[0]     frame #9: 0x000000010256b874 a.out_real`chapel_wrapper(arg=0x000000010d202540) at tasks-qthreads.c:871:5
[0]     frame #10: 0x00000001025ba8cc a.out_real`qthread_wrapper(ptr=0x000000010d202500) at qthread.c:1666:26
[0]     frame #11: 0x00000001025ba4d8 a.out_real`qthread_exec(t=0x000000010b6ffe60, c=0x000000010eb44008) at qthread.c:1797:1
[0]     frame #12: 0x00000001025ba4a8 a.out_real`qthread_exec(t=0x000000010d202500, c=0x000000010b6ffe60) at qthread.c:1773:5
[0]     frame #13: 0x00000001025b8b04 a.out_real`qthread_master(arg=0x000000010b03c000) at qthread.c:445:9
[0]     frame #14: 0x00000001025b873c a.out_real`qthread_makecontext(c=0x00000001027b7f30, stack=0x00000001027b7f30, stacksize=2166162719163228150, func=0x0000000000000000, arg=0x0000000000000000, returnc=0x0000000000000000) at qthread.c:956:1
[0]   thread #5
[0]     frame #0: 0x00000001a82ab750 libsystem_kernel.dylib`__psynch_cvwait + 8
[0]     frame #1: 0x00000001a82e8574 libsystem_pthread.dylib`_pthread_cond_wait + 1232
[0]     frame #2: 0x00000001025be8cc a.out_real`qt_scheduler_get_thread(q=0x000000010b2ec600, qc=0x0000000000000000, active='\x01') at nemesis_threadqueues.c:336:38
[0]     frame #3: 0x00000001025b8888 a.out_real`qthread_master(arg=0x000000010b03c060) at qthread.c:373:9
[0]     frame #4: 0x00000001a82e7fa8 libsystem_pthread.dylib`_pthread_start + 148
[0]   thread #6
[0]     frame #0: 0x00000001a82ab750 libsystem_kernel.dylib`__psynch_cvwait + 8
[0]     frame #1: 0x00000001a82e8574 libsystem_pthread.dylib`_pthread_cond_wait + 1232
[0]     frame #2: 0x00000001025be8cc a.out_real`qt_scheduler_get_thread(q=0x000000010b2ec800, qc=0x0000000000000000, active='\x01') at nemesis_threadqueues.c:336:38
[0]     frame #3: 0x00000001025b8888 a.out_real`qthread_master(arg=0x000000010b03c0c0) at qthread.c:373:9
[0]     frame #4: 0x00000001a82e7fa8 libsystem_pthread.dylib`_pthread_start + 148
[0]   thread #7
[0]     frame #0: 0x00000001a82ab750 libsystem_kernel.dylib`__psynch_cvwait + 8
[0]     frame #1: 0x00000001a82e8574 libsystem_pthread.dylib`_pthread_cond_wait + 1232
[0]     frame #2: 0x00000001025be8cc a.out_real`qt_scheduler_get_thread(q=0x000000010b2eca00, qc=0x0000000000000000, active='\x01') at nemesis_threadqueues.c:336:38
[0]     frame #3: 0x00000001025b8888 a.out_real`qthread_master(arg=0x000000010b03c120) at qthread.c:373:9
[0]     frame #4: 0x00000001a82e7fa8 libsystem_pthread.dylib`_pthread_start + 148
[0]   thread #8
[0]     frame #0: 0x00000001a82ab750 libsystem_kernel.dylib`__psynch_cvwait + 8
[0]     frame #1: 0x00000001a82e8574 libsystem_pthread.dylib`_pthread_cond_wait + 1232
[0]     frame #2: 0x00000001025be8cc a.out_real`qt_scheduler_get_thread(q=0x000000010b2ecc00, qc=0x0000000000000000, active='\x01') at nemesis_threadqueues.c:336:38
[0]     frame #3: 0x00000001025b8888 a.out_real`qthread_master(arg=0x000000010b03c180) at qthread.c:373:9
[0]     frame #4: 0x00000001a82e7fa8 libsystem_pthread.dylib`_pthread_start + 148
[0]   thread #9
[0]     frame #0: 0x00000001a82a7fa8 libsystem_kernel.dylib`swtch_pri + 8
[0]     frame #1: 0x00000001a82e4e34 libsystem_pthread.dylib`cthread_yield + 32
[0]     frame #2: 0x00000001025f5178 a.out_real`gasneti_system_redirected_coprocess(cmd="/usr/bin/lldb -p 48489 -o 'bt all' -o quit", stdout_fd=11) at gasnet_tools.c:1755:9
[0]     frame #3: 0x00000001025f4ddc a.out_real`gasneti_bt_lldb(fd=11) at gasnet_tools.c:1870:12
[0]     frame #4: 0x00000001025eee00 a.out_real`gasneti_print_backtrace(fd=2) at gasnet_tools.c:2228:22
[0]     frame #5: 0x00000001025ef938 a.out_real`_gasneti_print_backtrace_ifenabled(fd=2) at gasnet_tools.c:2359:12
[0]     frame #6: 0x00000001027626d4 a.out_real`gasneti_defaultSignalHandler(sig=11) at gasnet_internal.c:1109:7
[0]     frame #7: 0x00000001a8316a24 libsystem_platform.dylib`_sigtramp + 56
[0]     frame #8: 0x000000010251df70 a.out_real`serialize_chpl2 [inlined] chpl_gen_comm_get(addr=0x0000000112dd4d50, node=2, raddr=0x0000000117940010, size=8, commID=4, ln=17, fn=93) at chpl-comm-compiler-macros.h:61:3
[0]     frame #9: 0x000000010251df0c a.out_real`serialize_chpl2(this_chpl7=chpl____wide_C @ 0x0000000112dd4da8, writer_chpl3=0x0000000112dd5530, serializer_chpl2=chpl____wide__ref_defaultSerializer @ 0x0000000112dd4d98, error_out_chpl=0x0000000112dd50b0) at bar.c:1102:3
[0]     frame #10: 0x000000010251d974 a.out_real`_serializeClassOrPtr_chpl3(this_chpl7=chpl____wide__ref_defaultSerializer @ 0x0000000112dd5220, writer_chpl3=0x0000000112dd5530, x_chpl=chpl____wide__ref__owned_C @ 0x0000000112dd5210, error_out_chpl=0x0000000112dd53b0) at IO.c:2527:5
[0]     frame #11: 0x000000010251d354 a.out_real`serializeValue_chpl7(this_chpl7=chpl____wide__ref_defaultSerializer @ 0x0000000112dd53e0, writer_chpl3=0x0000000112dd5530, val_chpl=chpl____wide__ref__owned_C @ 0x0000000112dd53d0, error_out_chpl=0x0000000112dd54b0) at IO.c:3147:3
[0]     frame #12: 0x000000010251d274 a.out_real`_serializeOne_chpl3(this_chpl7=0x0000000112dd6610, x_chpl=chpl____wide__ref__owned_C @ 0x0000000112dd5590, loc_chpl=0x0000000112dd5a60, error_out_chpl=0x0000000112dd5a80) at IO.c:9426:3
[0]     frame #13: 0x000000010251ca00 a.out_real`on_fn_chpl122(this_chpl7=0x0000000112dd6610, args_chpl=0x0000000112dd65c8, origLocale_chpl=0x0000000112dd65b0, error_out_chpl=chpl____wide__ref__wide_Error @ 0x0000000112dd5f38) at IO.c:14960:3
[0]     frame #14: 0x000000010247b15c a.out_real`wrapon_fn_chpl122(c_chpl=0x00000001160fbc20) at IO.c:15163:3
[0]     frame #15: 0x000000010257951c a.out_real`chpl_ftable_call(fid=135, bundle=0x00000001160fbc20) at chpl-gen-includes.h:48:3
[0]     frame #16: 0x00000001025793dc a.out_real`fork_wrapper(f=0x00000001160fbc20) at comm-gasnet-ex.c:340:3
[0]     frame #17: 0x000000010256b874 a.out_real`chapel_wrapper(arg=0x00000001160fbc20) at tasks-qthreads.c:871:5
[0]     frame #18: 0x00000001025ba940 a.out_real`qthread_wrapper(ptr=0x00000001160fbbe0) at qthread.c:1676:5
[0]     frame #19: 0x00000001025ba4d8 a.out_real`qthread_exec(t=0x000000016ddeac70, c=0x00000001134d0008) at qthread.c:1797:1
[0]     frame #20: 0x00000001025ba4a8 a.out_real`qthread_exec(t=0x00000001160fbbe0, c=0x000000016ddeac70) at qthread.c:1773:5
[0]     frame #21: 0x00000001025b8b04 a.out_real`qthread_master(arg=0x000000010b03c1e0) at qthread.c:445:9
[0]     frame #22: 0x00000001a82e7fa8 libsystem_pthread.dylib`_pthread_start + 148
[0]   thread #10
[0]     frame #0: 0x00000001025bce5c a.out_real`qt_mpool_free(pool=0x000000010b0483f0, mem=0x000000011623ca30) at mpool.c:422:1
[0]     frame #1: 0x00000001025be924 a.out_real`qt_scheduler_get_thread(q=0x000000010b2ed000, qc=0x0000000000000000, active='\x01') at nemesis_threadqueues.c:347:3
[0]     frame #2: 0x00000001025b8888 a.out_real`qthread_master(arg=0x000000010b03c240) at qthread.c:373:9
[0]     frame #3: 0x00000001a82e7fa8 libsystem_pthread.dylib`_pthread_start + 148
[0]   thread #11
[0]     frame #0: 0x00000001025c44f4 a.out_real`qt_swapctxt(oucp=0x0000000115778008, ucp=0x000000016df02c70) at context.c:145:7
[0]     frame #1: 0x00000001025baabc a.out_real`qthread_back_to_master(t=0x00000001160fc480) at qthread.c:2243:3
[0]     frame #2: 0x00000001025baa78 a.out_real`qthread_yield_(k=0) at qthread.c:1816:5
[0]     frame #3: 0x000000010256a35c a.out_real`chpl_task_yield at tasks-qthreads.c:203:9
[0]     frame #4: 0x000000010258191c a.out_real`atomic_lock_spinlock_t(lock=0x00000001104941c0) at chpl-atomics.h:294:5
[0]     frame #5: 0x0000000102581878 a.out_real`qio_lock(x=0x00000001104941c0) at qio.c:122:3
[0]     frame #6: 0x00000001025109e4 a.out_real`qio_channel_lock(ch=0x0000000110494180) at qio.h:953:10
[0]     frame #7: 0x000000010251088c a.out_real`on_fn_chpl111(this_chpl7=0x000000011507ddd8, err_chpl=chpl____wide__ref_syserr @ 0x000000011507d570) at IO.c:6254:20
[0]     frame #8: 0x000000010251be8c a.out_real`on_fn_chpl122(this_chpl7=0x000000011507e610, args_chpl=0x000000011507e5c8, origLocale_chpl=0x000000011507e5b0, error_out_chpl=chpl____wide__ref__wide_Error @ 0x000000011507df38) at IO.c:14782:5
[0]     frame #9: 0x000000010247b15c a.out_real`wrapon_fn_chpl122(c_chpl=0x00000001160fc4c0) at IO.c:15163:3
[0]     frame #10: 0x000000010257951c a.out_real`chpl_ftable_call(fid=135, bundle=0x00000001160fc4c0) at chpl-gen-includes.h:48:3
[0]     frame #11: 0x00000001025793dc a.out_real`fork_wrapper(f=0x00000001160fc4c0) at comm-gasnet-ex.c:340:3
[0]     frame #12: 0x000000010256b874 a.out_real`chapel_wrapper(arg=0x00000001160fc4c0) at tasks-qthreads.c:871:5
[0]     frame #13: 0x00000001025ba940 a.out_real`qthread_wrapper(ptr=0x00000001160fc480) at qthread.c:1676:5
[0]     frame #14: 0x00000001025ba4d8 a.out_real`qthread_exec(t=0x000000016df02c70, c=0x0000000115778008) at qthread.c:1797:1
[0]     frame #15: 0x00000001025ba4a8 a.out_real`qthread_exec(t=0x00000001160fc480, c=0x000000016df02c70) at qthread.c:1773:5
[0]     frame #16: 0x00000001025b8b04 a.out_real`qthread_master(arg=0x000000010b03c2a0) at qthread.c:445:9
[0]     frame #17: 0x00000001a82e7fa8 libsystem_pthread.dylib`_pthread_start + 148
[0]   thread #12
[0]     frame #0: 0x00000001a82b3030 libsystem_kernel.dylib`__select + 8
[0]     frame #1: 0x00000001027607c0 a.out_real`::myselect(n=10, readfds=0x000000016e01a8c4, writefds=0x0000000000000000, exceptfds=0x0000000000000000, timeout=0x000000016e01a8b0) at sockutil.cpp:589:16
[0]     frame #2: 0x00000001027606a8 a.out_real`inputWaiting(s=9, dothrow=false) at sockutil.cpp:435:16
[0]     frame #3: 0x000000010275bee4 a.out_real`::AMUDP_SPMDHandleControlTraffic(controlMessagesServiced=0x0000000000000000) at amudp_spmd.cpp:1259:5
[0]     frame #4: 0x000000010274d740 a.out_real`::AM_Poll(eb=0x0000000102cd5660) at amudp_reqrep.cpp:907:18
[0]     frame #5: 0x00000001025cb3d4 a.out_real`gasnetc_AMPoll at gasnet_core.c:660:7
[0]     frame #6: 0x0000000102571e9c a.out_real`_gasneti_AMPoll at gasnet_help.h:1315:18
[0]     frame #7: 0x000000010257a16c a.out_real`_gasnet_AMPoll at gasnet_help.h:1528:12
[0]     frame #8: 0x000000010257a09c a.out_real`am_poll_try at comm-gasnet-ex.c:756:12
[0]     frame #9: 0x000000010257a074 a.out_real`polling(x=0x0000000000000000) at comm-gasnet-ex.c:764:5
[0]     frame #10: 0x000000010256cf40 a.out_real`comm_task_wrapper(arg=0x0000000108504960) at tasks-qthreads.c:892:5
[0]     frame #11: 0x00000001a82e7fa8 libsystem_pthread.dylib`_pthread_start + 148
[0] (lldb) quit
printing 2: %

Expected correct output

init 1
init 0
init 2
deinit 1
printing 0: id is 0 mem 0x11602c000 *mem 2
init 3
deinit 0
printing 2: id is 2 mem 0x1145d4000 *mem 0
printing 3: id is 3 mem 0x114c18000 *mem 0
deinit 2
deinit 3
Exception: TaskErrors: 1 errors: Error: exception

Configuration Information

  • Output of chpl --version: 2.4 prerelease
  • Output of $CHPL_HOME/util/printchplenv --anonymize:
CHPL_TARGET_PLATFORM: darwin
CHPL_TARGET_COMPILER: llvm
CHPL_TARGET_ARCH: arm64
CHPL_TARGET_CPU: native *
CHPL_LOCALE_MODEL: flat
CHPL_COMM: gasnet *
  CHPL_COMM_SUBSTRATE: udp
  CHPL_GASNET_SEGMENT: everything
CHPL_TASKS: qthreads
CHPL_LAUNCHER: amudprun
CHPL_TIMERS: generic
CHPL_UNWIND: none
CHPL_TARGET_MEM: jemalloc *
CHPL_ATOMICS: cstdlib
  CHPL_NETWORK_ATOMICS: none
CHPL_GMP: system *
CHPL_HWLOC: system *
CHPL_RE2: bundled *
CHPL_LLVM: system
CHPL_AUX_FILESYS: none
  • Back-end compiler and version, e.g. gcc --version or clang --version: LLVM 19, clang 14
@jabraham17
Copy link
Member Author

Note that switching to a CHPL_COMM=none build and just running a coforall does not produce the segfault.

For example

coforall l in 1..100 do {
    var x = new C(l);
    if l == 1 then throw new Error("exception");
    writeln("printing ", l, ": ", x);
  }

This always seems to give the correct result. Even with CHPL_COMM=gasnet, the above version of the coforall does not segfault.

@e-kayrakli
Copy link
Contributor

Even with CHPL_COMM=gasnet, the above version of the coforall does not segfault.

Where the difference is... the lack of try/catch?

For users bumping into this (and Arkouda), what would be an acceptable workaround? Could we have a racy flag that'll be set to true in the erroring condition, which then can be checked after the coforall? Of course, if you'd like to inspect which task of the coforall produced the error etc, that will not be possible without a more synchrnoized approach, but still.

@jabraham17
Copy link
Member Author

Where the difference is... the lack of try/catch?

The difference is the lack of an on. In #26652 (comment) I was showing a change to the larger example from the OP, not just that code by itself. My point being that this problem seems specific to a coforall+on pattern, not just coforall

For users bumping into this (and Arkouda), what would be an acceptable workaround? Could we have a racy flag that'll be set to true in the erroring condition, which then can be checked after the coforall? Of course, if you'd like to inspect which task of the coforall produced the error etc, that will not be possible without a more synchrnoized approach, but still.

This sounds possible? In essence making the body of the on statement one giant try/catch, and the catch sets the boolean flag. Then after the coforall checking the boolean manually. However, I tried this a few different ways and still got segfaults

Option A

proc bar() throws {
  var err: owned Error? = nil;
  coforall l in Locales with (ref err) do on l {
    try {
    var x = new C(l.id);
    if l.id == 1 then throw new Error("exception");
    writeln("printing ", l.id, ": ", x);
    } catch e {
      err = e;
    }
  }
  if err != nil then throw err;
}

Option B

proc bar() throws {
  var err = false;
  coforall l in Locales with (ref err) do on l {
    try {
    var x = new C(l.id);
    if l.id == 1 then throw new Error("exception");
    writeln("printing ", l.id, ": ", x);
    } catch e {
      err = true;
    }
  }
  if err then writeln("exception");
}

Option C

proc bar() throws {
  var err = false;
  coforall l in Locales with (ref err) do on l {
    try {
    var x = new C(l.id);
    if l.id == 1 then throw new Error("exception");
    writeln("printing ", l.id, ": ", x);
    } catch e {
      err = true;
    }
  }
  if err then throw new Error("exception");
}

These all still segfault every other run or so.

@jhh67
Copy link
Contributor

jhh67 commented Feb 5, 2025

Have you tried it with CHPL_COMM=ofi?

@jabraham17
Copy link
Member Author

I see the same issue with CHPL_COMM=ofi (using mpirun on a Mac as well as slurm on an EX)

It sporadically hits a segfault.

init 0
printing 0: id is 0 mem 0x11b84c000 *mem 2
deinit 0
init 1
init 2
init 3
deinit 1
[HPE-D2RLK75V43:95249] *** Process received signal ***
[HPE-D2RLK75V43:95249] Signal: Segmentation fault: 11 (11)
[HPE-D2RLK75V43:95249] Signal code: Invalid permissions (2)
[HPE-D2RLK75V43:95249] Failing at address: 0x11ec14000
[HPE-D2RLK75V43:95249] *** End of error message ***

@cassella
Copy link
Contributor

cassella commented Feb 6, 2025

Noting that the segfault occurs during a call to serialize_chpl2, I think this has to do with serialize()'s unserialized access to writer. (edit: or something else between writeln() and the serializer.)

Using the option B code, I'm able to reproduce the segfault.

If I remove the writeln() in the coforall body in bar(), no segfault.

If I instead remove the definition of C.serialize(), no segfault.

If I instead remove the throw new Error line, segfault.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants