[Bug testsuite/35677] Intermitent failure FAIL: libgomp.fortran/crayptr2.f90
--- Comment #18 from dave at hiauly1 dot hia dot nrc dot ca 2008-12-12 15:04 --- Subject: Re: Intermitent failure FAIL: libgomp.fortran/crayptr2.f90 I assume I am using emutls since I see... nm crayptr2.exe | grep emut 1cd0 t ___emutls_get_address 1c90 t ___emutls_register_common 2014 d ___emutls_v.ip.1499 1f10 t _emutls_destroy 1ed0 t _emutls_init 2090 b _emutls_key 2040 d _emutls_mutex 2094 b _emutls_size I'll try a build of current gcc trunk with your patch and see if it helps. I probably was too quick to close this PR. The emutls support in darwin's libgcc is botched. The routines are present in libgcc_eh.a but not in the shared libraries. As I understand the situation from the gcc list, the Apple darwin maintainers oppose the addition of emutls support to the shared libgcc libraries. The emutls support is licensed under GPLv2, so that shouldn't block adoption. However, Apple may still want to provide its own TLS support. On the other hand, Apple is phasing out use of gcc. So, the issue of control might be something the steering committee should discuss. From my perspective, most of the support and testing of the darwin port in recent months has come from non-Apple developpers. I think the only way forward is to disable TLS support on darwin in gcc 4.3 and 4.4. Probably, a new PR should be created for this. Any testcases that use TLS and lack a dg-require-effective-target tls_runtime comment need updating. Those changes are obvious. Dave -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35677
[Bug testsuite/35677] Intermitent failure FAIL: libgomp.fortran/crayptr2.f90
--- Comment #19 from howarth at nitro dot med dot uc dot edu 2008-12-12 17:52 --- Well, they are phasing it out in the long run perhaps but Apple is just transitioning to gcc 4.2.1 at the moment so gcc will be in use for awhile yet on darwin. I am unclear on what the clang/llvm will use for its libgcc equivalent. Perhaps Chris Lattner can enlighten us on that. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35677
[Bug testsuite/35677] Intermitent failure FAIL: libgomp.fortran/crayptr2.f90
--- Comment #20 from dave at hiauly1 dot hia dot nrc dot ca 2008-12-12 18:41 --- Subject: Re: Intermitent failure FAIL: libgomp.fortran/crayptr2.f90 Well, they are phasing it out in the long run perhaps but Apple is just transitioning to gcc 4.2.1 at the moment so gcc will be in use for awhile yet on darwin. I am unclear on what the clang/llvm will use for its libgcc equivalent. Perhaps Chris Lattner can enlighten us on that. In principle, users can install libgcc* wherever they like. I think the install path for shared libraries is hardcoded in executables (otool -L). There's also DYLD_LIBRARY_PATH and DYLD_FALLBACK_LIBRARY_PATH. As far as I know, the libgcc libraries shipped with 4.3 and in 4.4 are backwards compatible with earlier versions. My impression is that this issue is not confined to libgcc. The same problem is present for all the libraries provided by gcc. Any added features are going to make the new version incompatible with the system version, irrespective of ABI changes. Dave -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35677
[Bug testsuite/35677] Intermitent failure FAIL: libgomp.fortran/crayptr2.f90
--- Comment #21 from mrs at apple dot com 2008-12-12 18:42 --- My long term guidance would be to engineer gcc to use its copy of the libgcc_s dylib and link against it. This would mean that the newly installed libgcc_s should be found first, over /usr/lib, and that development and support mirror linux, in all the usual ways. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35677
[Bug testsuite/35677] Intermitent failure FAIL: libgomp.fortran/crayptr2.f90
--- Comment #22 from dave at hiauly1 dot hia dot nrc dot ca 2008-12-12 19:27 --- Subject: Re: Intermitent failure FAIL: libgomp.fortran/crayptr2.f90 My long term guidance would be to engineer gcc to use its copy of the libgcc_s dylib and link against it. This would mean that the newly installed libgcc_s should be found first, over /usr/lib, and that development and support mirror linux, in all the usual ways. That's certainly reasonable. However, linux style TLS support needs help from the assembler, linker and dynamic loader. So, unless this is going to happen, the best that can be achieved is that provided by the emulation layer. Tracking linux might be straight forward if the kernel supported ELF executables. Then, x86 linux tools would work essentially as is. However, I'm sure there would be issues with syscalls, etc. Dave -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35677
[Bug testsuite/35677] Intermitent failure FAIL: libgomp.fortran/crayptr2.f90
--- Comment #13 from danglin at gcc dot gnu dot org 2008-12-11 18:35 --- Subject: Bug 35677 Author: danglin Date: Thu Dec 11 18:33:48 2008 New Revision: 142687 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=142687 Log: PR testsuite/35677 * emutls.c (__emutls_get_address): Make sure offset is really zero before initializing the object's offset. Modified: trunk/gcc/ChangeLog trunk/gcc/emutls.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35677
[Bug testsuite/35677] Intermitent failure FAIL: libgomp.fortran/crayptr2.f90
--- Comment #15 from danglin at gcc dot gnu dot org 2008-12-11 23:32 --- Subject: Bug 35677 Author: danglin Date: Thu Dec 11 23:30:42 2008 New Revision: 142695 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=142695 Log: PR testsuite/35677 * emutls.c (__emutls_get_address): Make sure offset is really zero before initializing the object's offset. Modified: branches/gcc-4_3-branch/gcc/ChangeLog branches/gcc-4_3-branch/gcc/emutls.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35677
[Bug testsuite/35677] Intermitent failure FAIL: libgomp.fortran/crayptr2.f90
--- Comment #14 from danglin at gcc dot gnu dot org 2008-12-11 23:31 --- Fixed. -- danglin at gcc dot gnu dot org changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35677
[Bug testsuite/35677] Intermitent failure FAIL: libgomp.fortran/crayptr2.f90
--- Comment #16 from danglin at gcc dot gnu dot org 2008-12-11 23:38 --- *** Bug 31839 has been marked as a duplicate of this bug. *** -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35677
[Bug testsuite/35677] Intermitent failure FAIL: libgomp.fortran/crayptr2.f90
--- Comment #17 from danglin at gcc dot gnu dot org 2008-12-11 23:39 --- *** Bug 31838 has been marked as a duplicate of this bug. *** -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35677
[Bug testsuite/35677] Intermitent failure FAIL: libgomp.fortran/crayptr2.f90
--- Comment #4 from howarth at nitro dot med dot uc dot edu 2008-12-10 14:11 --- Shouldn't this be marked as a confirmed and tagged as a regression? Also, oddly I don't see this on any benchmark runs I do with a 3 GB MacBook Pro using Core 2 Duo, yet I always see it on a 4 GB MacPro with Xeon 5400 series processor. Both are building gcc trunk with configure flags: --prefix=/sw --prefix=/sw/lib/gcc4.4 --mandir=/sw/share/man --infodir=/sw/share/info --enable-languages=c,c++,fortran,objc,java --with-gmp=/sw --with-libiconv-prefix=/sw --with-ppl=/sw --with-cloog=/sw --with-system-zlib --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib --with-arch=nocona --with-tune=generic --build=i686-apple-darwin9 --host=i686-apple-darwin9 --target=i686-apple-darwin9 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35677
[Bug testsuite/35677] Intermitent failure FAIL: libgomp.fortran/crayptr2.f90
--- Comment #5 from dave at hiauly1 dot hia dot nrc dot ca 2008-12-10 15:56 --- Subject: Re: Intermitent failure FAIL: libgomp.fortran/crayptr2.f90 Shouldn't this be marked as a confirmed and tagged as a regression? Also, oddly I don't see this on any benchmark runs I do with a 3 GB MacBook Pro using Core 2 Duo, yet I always see it on a 4 GB MacPro with Xeon 5400 series processor. Both are building gcc trunk with configure flags: --prefix=/sw --prefix=/sw/lib/gcc4.4 --mandir=/sw/share/man --infodir=/sw/share/info --enable-languages=c,c++,fortran,objc,java --with-gmp=/sw --with-libiconv-prefix=/sw --with-ppl=/sw --with-cloog=/sw --with-system-zlib --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib --with-arch=nocona --with-tune=generic --build=i686-apple-darwin9 --host=i686-apple-darwin9 --target=i686-apple-darwin9 Strangely, I'm not seeing this on my early 2008 Mac Pro. Possibly, the difference is specifying --enable-threads=posix --enable-__cxa_atexit. Think the failures are more likely on SMP machines. Do seem to have more libgomp failures in 4.4 than 4.3 on hppa*-*-hpux*. Dave -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35677
[Bug testsuite/35677] Intermitent failure FAIL: libgomp.fortran/crayptr2.f90
-- danglin at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2008-12-10 16:01:39 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35677
[Bug testsuite/35677] Intermitent failure FAIL: libgomp.fortran/crayptr2.f90
--- Comment #6 from danglin at gcc dot gnu dot org 2008-12-10 18:10 --- On hppa64, I see a random segfault in crayptr2.f90 compiled at -O0: (gdb) r Starting program: /mnt/gnu/gcc/objdir/hppa64-hp-hpux11.11/libgomp/testsuite/crayptr2.xg0 warning: Private mapping of shared library text was not specified by the executable; setting a breakpoint in a shared library which is not privately mapped will not work. See the HP-UX 11i v3 chatr manpage for methods to privately map shared library text. warning: Loadable segment .tbss outside of ELF segments warning: Loadable segment .tbss outside of ELF segments warning: Loadable segment .tbss outside of ELF segments [New process 28502, lwp 2270431] [process 28502, lwp 2270431 exited] [New process 28502, lwp 2270432] [process 28502, lwp 2270432 exited] [New process 28502, lwp 2270433] [process 28502, lwp 2270433 exited] [New process 28502, lwp 2270434] [New process 28502, lwp 2270435] [New process 28502, lwp 2270436] Program received signal SIGSEGV, Segmentation fault. [Switching to process 28502, lwp 2270435] 0x40002d08 in MAIN__.omp_fn.0 (.omp_data_i=Cannot access memory at address 0x0 ) at /mnt/gnu/gcc/gcc/libgomp/testsuite/libgomp.fortran/crayptr2.f90:23 23l = p .ne. omp_get_thread_num () + 1 Current language: auto; currently fortran (gdb) p/x $pc $1 = 0x40002d08 (gdb) disass 0x40002cf8 0x40002d18 Dump of assembler code from 0x40002cf8 to 0x40002d18: 0x40002cf8 MAIN__.omp_fn.0+136: b,l 0x40002b2c .stub+60,rp 0x40002cfc MAIN__.omp_fn.0+140: nop 0x40002d00 MAIN__.omp_fn.0+144: copy r4,dp 0x40002d04 MAIN__.omp_fn.0+148: ldd 0(ret0),ret0 0x40002d08 MAIN__.omp_fn.0+152: ldw 0(ret0),ret0 0x40002d0c MAIN__.omp_fn.0+156: extrd,s ret0,63,32,ret0 0x40002d10 MAIN__.omp_fn.0+160: stw r0,18(r3) 0x40002d14 MAIN__.omp_fn.0+164: cmpb,=,n ret0,r5,0x40002d20 MAIN__.omp_fn.0+176 End of assembler dump. (gdb) p/x $ret0 $2 = 0x0 This results from the code loading indirectly data with a the pointer returned from a call to __emutls_get_address: addil LT'__emutls_v.ip.565,%r27 copy %r1,%r28 ldd RT'__emutls_v.ip.565(%r28),%r28 copy %r28,%r26 ldo -48(%r30),%r29 copy %r27,%r4 b,l __emutls_get_address,%r2 nop copy %r4,%r27 ldd 0(%r28),%r28 ldw 0(%r28),%r28 Is darwin also using EMUTLS? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35677
[Bug testsuite/35677] Intermitent failure FAIL: libgomp.fortran/crayptr2.f90
--- Comment #7 from dave at hiauly1 dot hia dot nrc dot ca 2008-12-10 22:01 --- Subject: Re: Intermitent failure FAIL: libgomp.fortran/crayptr2.f90 On Wed, 10 Dec 2008, howarth at nitro dot med dot uc dot edu wrote: I need to do some more testing but I believe the attached patch fixes the failure on hppa*-*-hpux*. Dave --- Comment #8 from dave at hiauly1 dot hia dot nrc dot ca 2008-12-10 22:01 --- Created an attachment (id=16879) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16879action=view) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35677
[Bug testsuite/35677] Intermitent failure FAIL: libgomp.fortran/crayptr2.f90
--- Comment #9 from howarth at nitro dot med dot uc dot edu 2008-12-11 00:28 --- On i686-apple-darwin9, configured as... Using built-in specs. Target: i686-apple-darwin9 Configured with: ../gcc-4.4-20081209/configure --prefix=/sw --prefix=/sw/lib/gcc4.4 --mandir=/sw/share/man --infodir=/sw/share/info --enable-languages=c,c++,fortran,objc,java --with-gmp=/sw --with-libiconv-prefix=/sw --with-ppl=/sw --with-cloog=/sw --with-system-zlib --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib --with-arch=nocona --with-tune=generic --build=i686-apple-darwin9 --host=i686-apple-darwin9 --target=i686-apple-darwin9 Thread model: posix gcc version 4.4.0 20081210 (experimental) (GCC) I get... rogram received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_PROTECTION_FAILURE at address: 0x [Switching to process 560 thread 0x313] 0x1ae9 in MAIN__.omp_fn.0 () (gdb) bt #0 0x1ae9 in MAIN__.omp_fn.0 () #1 0x0001a204 in gomp_thread_start (xdata=0xbfffe7f0) at ../../../gcc-4.4-20081209/libgomp/team.c:118 #2 0x910c4095 in _pthread_start () #3 0x910c3f52 in thread_start () I assume I am using emutls since I see... nm crayptr2.exe | grep emut 1cd0 t ___emutls_get_address 1c90 t ___emutls_register_common 2014 d ___emutls_v.ip.1499 1f10 t _emutls_destroy 1ed0 t _emutls_init 2090 b _emutls_key 2040 d _emutls_mutex 2094 b _emutls_size I'll try a build of current gcc trunk with your patch and see if it helps. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35677
[Bug testsuite/35677] Intermitent failure FAIL: libgomp.fortran/crayptr2.f90
--- Comment #10 from dave at hiauly1 dot hia dot nrc dot ca 2008-12-11 00:40 --- Subject: Re: Intermitent failure FAIL: libgomp.fortran/crayptr2.f90 I'll try a build of current gcc trunk with your patch and see if it helps. Problem looks the same. You can do a quick check without a full rebuild by removing the emultls* files from the libgcc directories, apply patch, do make in top libgcc directory, then rerun libgomp testsuite. The failures occur because multiple threads read an offset value of 0. Dave -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35677
[Bug testsuite/35677] Intermitent failure FAIL: libgomp.fortran/crayptr2.f90
--- Comment #11 from jakub at gcc dot gnu dot org 2008-12-11 00:44 --- The patch is correct if not obvious. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35677
[Bug testsuite/35677] Intermitent failure FAIL: libgomp.fortran/crayptr2.f90
--- Comment #12 from howarth at nitro dot med dot uc dot edu 2008-12-11 02:02 --- This patch appears to solve the issue on i686-apple-darwin9 from the couple testsuite runs I have done in libgomp. === libgomp Summary for unix/-m32 === # of expected passes2071 # of unsupported tests 128 === libgomp Summary for unix/-m64 === # of expected passes2071 # of unsupported tests 128 === libgomp Summary === # of expected passes4142 # of unsupported tests 256 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35677
[Bug testsuite/35677] Intermitent failure FAIL: libgomp.fortran/crayptr2.f90
--- Comment #3 from danglin at gcc dot gnu dot org 2008-11-27 02:07 --- Also see failure on hppa2.0w-hp-hpux11.11. -- danglin at gcc dot gnu dot org changed: What|Removed |Added CC||danglin at gcc dot gnu dot ||org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35677
[Bug testsuite/35677] Intermitent failure FAIL: libgomp.fortran/crayptr2.f90
--- Comment #2 from pinskia at gcc dot gnu dot org 2008-10-14 23:30 --- I still see this, though it was failing a lot more than it was passing. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35677
[Bug testsuite/35677] Intermitent failure FAIL: libgomp.fortran/crayptr2.f90
--- Comment #1 from pinskia at gcc dot gnu dot org 2008-03-30 20:12 --- I see them also on powerpc-darwin. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35677