[Bug fortran/87838] Segmentation fault with function pointer to contained function
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87838 kargl at gcc dot gnu.org changed: What|Removed |Added Status|WAITING |RESOLVED CC||kargl at gcc dot gnu.org Resolution|--- |WORKSFORME --- Comment #5 from kargl at gcc dot gnu.org --- No feedback from OP. Works for me on FreeBSD. Closing.
[Bug fortran/87838] Segmentation fault with function pointer to contained function
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87838 --- Comment #4 from Dominique d'Humieres --- > Could you please compile with the -g flag, in order to get a more meaningful > backtrace? Alternatively try running the executable via gdb or valgrind > for further debugging. Any progress before closing the PR as WORKSFORME?
[Bug fortran/87838] Segmentation fault with function pointer to contained function
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87838 janus at gcc dot gnu.org changed: What|Removed |Added CC||janus at gcc dot gnu.org --- Comment #3 from janus at gcc dot gnu.org --- (In reply to menospaamthereaper from comment #2) > Thank you Dominique for testing this on a Mac. So perhaps the problem is > specific to Linux. I just compiled the test case on Ubuntu 18.04 with gfortran versions 5, 6, 7, 8 and trunk. I don't see a segfault with any of these. Also gdb and valgrind don't show any kind of problem. > Additional information that might help with debugging the segmentation fault: > > 1) Compiling this code with > > gfortran -ffree-form -std=f2003 test.f > > gives the error > > test.f:12:13: > > f_ptr => f1 > 1 > Error: Fortran 2008: Internal procedure ‘f1’ is invalid in procedure pointer > assignment at (1) This error is correct. That's just not allowed in Fortran 2003. All fine. > 2) However, > > gfortran -ffree-form -std=f2008 test.f > > compiles successfully but gives a segmentation fault. > > ./a.out > > Program received signal SIGSEGV: Segmentation fault - invalid memory > reference. > > Backtrace for this error: > #0 0x7fe7aae3b31a > #1 0x7fe7aae3a503 > #2 0x7fe7aaa5ef1f > #3 0x7fffed8fe6c0 > Segmentation fault (core dumped) Could you please compile with the -g flag, in order to get a more meaningful backtrace? Alternatively try running the executable via gdb or valgrind for further debugging.
[Bug fortran/87838] Segmentation fault with function pointer to contained function
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87838 --- Comment #2 from menospaamthereaper at hotmail dot com --- Thank you Dominique for testing this on a Mac. So perhaps the problem is specific to Linux. Additional information that might help with debugging the segmentation fault: 1) Compiling this code with gfortran -ffree-form -std=f2003 test.f gives the error test.f:12:13: f_ptr => f1 1 Error: Fortran 2008: Internal procedure ‘f1’ is invalid in procedure pointer assignment at (1) (this code is within gcc/fortran/expr.c: if (attr.proc == PROC_INTERNAL && !gfc_notify_std(GFC_STD_F2008, "Internal procedure %qs " "is invalid in procedure pointer assignment " "at %L", rvalue->symtree->name, >where)) ) 2) However, gfortran -ffree-form -std=f2008 test.f compiles successfully but gives a segmentation fault. ./a.out Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Backtrace for this error: #0 0x7fe7aae3b31a #1 0x7fe7aae3a503 #2 0x7fe7aaa5ef1f #3 0x7fffed8fe6c0 Segmentation fault (core dumped)
[Bug fortran/87838] Segmentation fault with function pointer to contained function
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87838 Dominique d'Humieres changed: What|Removed |Added Status|UNCONFIRMED |WAITING Last reconfirmed||2018-11-03 Ever confirmed|0 |1 --- Comment #1 from Dominique d'Humieres --- WORKSFORME on x86_64-apple-darwin18.2. I don't get any segmentation fault with the various revisions I have tested (from 5.5 up to trunk).