OpenMP (gomp) crash at gomp_resolve_num_threads - gcc 4.4
Dan S
d.a.n.stowell+gcc@gmail.com
Wed Apr 29 15:59:00 GMT 2009
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
More information about the Gcc-help
mailing list