On Fri, 2007-03-16 at 13:56 +1100, skaller wrote:
> On Fri, 2007-03-16 at 13:53 +1100, skaller wrote:
> 
> > there's a bug in Felix itself I think: assertion failures
> > don't return an error code, or, the build script doesn't
> > test them: 
> 
> It's Felix:
> 
> [EMAIL PROTECTED]:/work/felix/svn/felix/felix/trunk$ LD_LIBRARY_PATH=rtl
> bin/flx_run test/regress/rt-1.01.54-0.so
> Assertion2 Failure
> Felix location: ./lpsrc/flx_regress.pak 2266[1]-2266[26]
> C++ location  : test/regress/rt-1.01.54-0.cpp 76
> Felix location: ./lib/flx_tclass.flxh 70[3]-70[3]
> C++ location  : test/regress/rt-1.01.54-0.cpp 76
> [EMAIL PROTECTED]:/work/felix/svn/felix/felix/trunk$ echo $?
> 0
> 
> Shouldn't be returning 0 there... :)
> 

Ah yes, here's the problem in the driver:

void doflx (void *data) {

.....................

    if(debug_driver)fprintf(stderr,"Out of jobs\n");
  cleanup:;
  }
  catch (flx_exception_t &x) { flx_exception_handler (&x); }
  catch (std::exception &x) { std_exception_handler (&x); }
  catch (...) { fprintf(stderr,"Unknown exception in thread!\n"); }

  try
  {
    if(debug_driver)fprintf(stderr,"Terminating Felix subsystem\n");
    delete async;
    delete active;
  }
  catch (...) { fprintf(stderr,"Unknown exception deleting async!\n"); }



But this code is correct:

int run_felix( 
..................

  catch (flx_exception_t &x)
  {
    return flx_exception_handler(&x);
  }
  catch (...)
  {
    fprintf(stderr,"flx_run driver ends with unknown EXCEPTION\n");
    return 4;
  }
  return 0;
}


Now, doflx spawns a thread .. there's no way to get an error
code back from a thread. Here's the spawn code:

      case svc_spawn_pthread:
      {
        fthread_t *ftx = *(fthread_t**)ss.request->data;
        if(debug_driver)fprintf(stderr,"Spawn pthread %p\n",ftx);
        gcp->collector->add_root(ftx);
        std::list<fthread_t*> *pactive =new std::list<fthread_t*>;
        pactive->push_front(ftx);
        void *data = new doflx_data(debug_driver, gcp, pactive,
thread_control);
        flx_detached_thread_t dummy;
        if(debug_driver)fprintf(stderr,"Starting new pthread, thread
counter= %ld\n",thread_control->thread_count());
        thread_control->add_thread();
        dummy.init( doflx,data);
      }
      goto process_active;

This is a detached thread, it can't return an error code.

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to