Re: Abort at program end



Well, the main() is so simple for this client at this stage, I 'll just paste it below. As far as I can tell, there wasnt enough done here to unref things additional times or anything like that, but if you spot a problem please tell me.

ALSO - notice that I am reading the IOR file into a string to get the ref. This is a more minor nit, but the other ORB's support the the file:// notation for passing IOR refs and read in the files themselves.

ALSO - if the .ref file is not present, this program exits with "Aborted", which I assume means an uncaught exception. I think the correct behavior, as exhibited by the other ORB's, is to return a CORBA nil object so that the if-block below will function.

Marc

int main(int argc, char **argv)
{
    /*
     * Start our orb
     */
    CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);

    /*
     * IOR is in ucb_svr.ref in the local directory
     */
    char pwd[256], uri[300];
    string s;
    sprintf(uri, "%s/ucb_svr.ref", getcwd(pwd, 256));
    ifstream is(uri);
    is >> s;

    /*
     * Bind to ucb_svr
     */

    CORBA::Object_var obj = orb->string_to_object(s.c_str());
    ucb_svr = Server::_narrow(obj);

    if (CORBA::is_nil (ucb_svr)) {
        cout << "oops: could not locate ucb server" << endl;
        exit (1);
    }

    /*
     * Run Tests
     */
    doBenchmark(PING);
    doBenchmark(ASYNCH_PING);
    doBenchmark(SEND_STRUCT);
    doBenchmark(ASYNCH_SEND_STRUCT);
    doBenchmark(FOOTPRINT_DSK);
    doBenchmark(FOOTPRINT_MEM);

    /*
     * Exit
     */
    return 0;
}


Bowie Owens wrote:
Marc Siegel wrote:

Here is a backtrace from a crash of a client talking to a server on the same PC (the client is the one that crashes).

** ERROR **: file orbit-object.c: line 147 (do_unref): assertion failed: (robj->refs < ORBIT_REFCOUNT_MAX && robj->refs > 0)
aborting...

This error indicates that there were too many unref's on a stub object.



This error only occurs with ORBit-cpp, things work fine on MICO and TAO.

I found them to be a bit more forgiving too. To fix the problem you need to track down where the extra unref's are occuring. The abort at the end of the program is too far after the fact. Valgrind is also useful for tracking problems down. The C++ stubs are new'ed and then deleted in _duplicate and release. So if you have a leak or a double free then that is definitely going to mess up the reference counting. If you can show that orbitcpp is non-compliant, I'll definitely fix it.



--
Marc Siegel
MIT Lincoln Laboratory, Group 63
mlsiegel ll mit edu . (781)981-5434
--



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]