This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: OpenMP (gomp) crash at gomp_resolve_num_threads - gcc 4.4


OK, maybe no-one here is an OpenMP user? Well in case it helps anyone,
here's a thread on the Core Audio mailing list which has some
tentative answers to my issue:
http://lists.apple.com/archives/coreaudio-api/2009/May/msg00035.html

Dan

2009/4/29 Dan S <d.a.n.stowell+gcc@gmail.com>:
> Hi -
>
> I'm adding libgomp parallellisation to an existing piece of software.
> Mac 10.4.11 ppc, scons build using gcc 4.4.0 ("gcc44" from macports).
> Build goes fine and the app runs normally. However it crashes when my
> parallel code is called:
>
> (gdb) continue
> [Switching to process 1297 thread 0x8703]
> [Switching to process 1297 thread 0x8703]
> Program received signal: ?"EXC_BAD_ACCESS".
> (gdb) bt
> #0 ?gomp_resolve_num_threads (specified=0, count=0) at
> ../../../gcc-4.4.0/libgomp/libgomp.h:380
> #1 ?0x0047fb34 in GOMP_parallel_start (fn=0x219c34
> <Group_Calc_parallel.omp_fn.0>, data=0xf070d6bc, num_threads=104) at
> ../../../gcc-4.4.0/libgomp/parallel.c:107
> #2 ?0x002180fc in Group_Calc_parallel (inGroup=0x3264100) at
> Source/server/SC_Group.cpp:105
>
> Here's the offending code:
>
> void Group_Calc_parallel(Group *inGroup)
> {
> ? ? ? ?Node *firstChild = inGroup->mHead;
> ? ? ? ?Node *aChild = firstChild;
> ? ? ? ?int numChildren = 0;
>
> ? ? ? ?while (aChild) {
> ? ? ? ? ? ? ? ?++numChildren;
> ? ? ? ? ? ? ? ?aChild = aChild->mNext;
> ? ? ? ?}
>
> ? ? ? ?if(numChildren != 0){
> ? ? ? ? ? ? ? ?#pragma omp parallel for
> ? ? ? ? ? ? ? ?for (int i=0; i < numChildren; ++i) {
> ? ? ? ? ? ? ? ? ? ? ? ?Node *llChild = firstChild;
> ? ? ? ? ? ? ? ? ? ? ? ?for(int j=0; j<i; ++j)
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?llChild = llChild->mNext;
> ? ? ? ? ? ? ? ? ? ? ? ?(*llChild->mCalcFunc)(llChild);
> ? ? ? ? ? ? ? ?} // end of parallellable "for" loop
> ? ? ? ?}
> }
>
>
> GCC versions in use:
> $ gcc-mp-4.4 --version
> gcc-mp-4.4 (GCC) 4.4.0
> $ g++-mp-4.4 --version
> g++-mp-4.4 (GCC) 4.4.0
>
>
> Any suggestions on what I can do to diagnose/fix this?
>
> Thanks
> Dan
> --
> http://www.mcld.co.uk
>



-- 
http://www.mcld.co.uk


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]