Re[3]: [Gc] Bus error && Deallocation of excessively large block ..

Ivan Maidanski ivmai at mail.ru
Sat Jul 14 01:23:32 PDT 2012


Hi Arote,

"Collecting unknown thread" means you call some GC function from a thread not registered by GC.

What's your target platform?
Check that pthread_create is redirected to GC_pthread_create.

The given code fragment seems to be valid (Are there any other places GC is called?) 

Regards,
Ivan

Sat, 14 Jul 2012 13:46:02 +0530 Arote Uddhav <aroteuddhav at gmail.com>:
> No luck.. !
> 
> On Sat, Jul 14, 2012 at 1:29 PM, Ivan Maidanski <ivmai at mail.ru> wrote:
> 
> > Hi Arote,
> >
> > Please ensure that you have in the code:
> >
> > #define GC_THREADS
> > #include <gc.h>
> >
> > ...
> >
> > main() {
> > GC_INIT();
> >
> > Regards,
> > Ivan
> >
> > Wed, 11 Jul 2012 15:11:12 +0530 Arote Uddhav <aroteuddhav at gmail.com>:
> > > Hi All ,
> > >  I am trying gc with my program. I need to create threads at run time.
> > >
> > >
> > >    <code>
> > >                 while(1)
> > >                 {
> > >  pthread *t = (pthread_t  *) GC_MALLOC( num_of_files * sizeof (pthread_t
> > ));
> > >    int  *iret = (int *) GC_MALLOC(  num_of_files * sizeof (int ));
> > >
> > >                       .........
> > >
> > >                      while( ( dirp = readdir( d )) != NULL )
> > >             {
> > >  if ( ( stat( dirp->d_name , &stat_buf) != -1 ) &&  (S_ISREG(
> > > stat_buf.st_mode ) ))
> > > {
> > >  iret [ fileCounter  ]  = pthread_create ( &t [ fileCounter ] , NULL ,
> > > callPluginHandle , (void *)(dirp->d_name) ) ;
> > >  fileCounter ++;
> > >    }
> > >              }
> > >                     ...........
> > >    }
> > >   </code>
> > >
> > >    This is a code  prototype which I am trying to write. But I get run
> > time
> > > problmes
> > >  ----- Bus error
> > >  ----- Deallocation exclusively large block
> > >  ----- Collecting unknown thread
> > >
> > > I am not doing any free or deallocation .. I am relying on gc for all
> > > memory freeing !
> > > Help required ! :)
> > >
> > > --
> > > *Uddhav Arote*
> > >
> > > Mob Number :  +91 9767168079
> > > *Vidyavardhini College Of Engg. and Tech,Mumbai(MAHARASHTRA).*
> >
> 
> 
> 
> -- 
> *Uddhav Arote*
> 
> Mob Number :  +91 9767168079
> *Vidyavardhini College Of Engg. and Tech,Mumbai(MAHARASHTRA).*
> 
> 
> Life is no brief candle for me. It is a sort of splendid torch which I have
> got hold of for the moment, and I want to make it burn as brightly as
> possible before handing it on to future generations.
>      -George Bernard Shaw
> 
> * <Email-id%3Aaroteuddhav at gmail.com>*
> 
> 



More information about the Gc mailing list