-
Notifications
You must be signed in to change notification settings - Fork 14.6k
[flang][runtime] Refine state associated with child I/O #150461
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see my comment in issue #149885 .
Child I/O state needs to carry a pointer to the original non-type-bound defined I/O subroutine table, so that nested defined I/O can call those defined I/O subroutines. It also needs to maintain a mutableModes instance for the whole invocation of defined I/O, instead of having a mutableModes local to list-directed child I/O, so that a top-level data transfer statement with (say) DECIMAL='COMMA' propagates that setting down to nested child I/O data transfers. Fixes llvm#149885.
hi @klausler ran into a regression in our hpc2021 testing, bisects to this PR. Thread 1 "weather_base.cl" received signal SIGSEGV, Segmentation fault. at ../sysdeps/nptl/libc_start_call_main.h:58 #7 0x00007ffff7429e40 in __libc_start_main_impl (main=0x228000 , argc=9, argv=0x7fffffffe6b8, init=, fini=, rtld_fini=, stack_end=0x7fffffffe6a8) at ../csu/libc-start.c:392 #8 0x00000000002216b5 in _start () |
small reproducer, requires an openmpi compiler invocation, so some kind of interaction
$ OMPI_FC=/COD/2025-07-26/trunk/bin/flang /opt/openmpi-5.0.6-flang-new/bin/mpif90 -O2 goo.f90 -g |
Works fine for me here. Could you try it with valgrind in your environment? (This patch affects the input side of user-defined derived type I/O, so perhaps it exposes something in your setup, but I don't see anything in it that would be at risk of smashing memory in the runtime support library's open unit map, and your stack traceback looks like that's what led to the crash.) |
==2250846== Conditional jump or move depends on uninitialised value(s) |
Thanks for that. I'm not seeing it here with valgrind myself, using a flang-rt built with gcc 9.3.0 for x86-64. What are you building with? (It might be a red herring.) |
i think its a mismatch of using an openmpi build that is slightly out of date with respect to latest flang sources. Just now I rebuilt openmpi using todays local build of llvm/main . test passes and valgrind errors no longer present. i think we can close this out as stale build. |
I'm happy if you're happy. Thanks for the help. |
Child I/O state needs to carry a pointer to the original non-type-bound defined I/O subroutine table, so that nested defined I/O can call those defined I/O subroutines. It also needs to maintain a mutableModes instance for the whole invocation of defined I/O, instead of having a mutableModes local to list-directed child I/O, so that a top-level data transfer statement with (say) DECIMAL='COMMA' propagates that setting down to nested child I/O data transfers. Fixes llvm#149885.
Child I/O state needs to carry a pointer to the original non-type-bound defined I/O subroutine table, so that nested defined I/O can call those defined I/O subroutines. It also needs to maintain a mutableModes instance for the whole invocation of defined I/O, instead of having a mutableModes local to list-directed child I/O, so that a top-level data transfer statement with (say) DECIMAL='COMMA' propagates that setting down to nested child I/O data transfers. Fixes llvm#149885.
Child I/O state needs to carry a pointer to the original non-type-bound defined I/O subroutine table, so that nested defined I/O can call those defined I/O subroutines. It also needs to maintain a mutableModes instance for the whole invocation of defined I/O, instead of having a mutableModes local to list-directed child I/O, so that a top-level data transfer statement with (say) DECIMAL='COMMA' propagates that setting down to nested child I/O data transfers.
Fixes #149885.