Re: Seg fault in PortableServer_POA_activate_object function



K.

Lots of things could be causing your segfault, but chances are you
didn't initialize something properly or allocate space for your ev
struct.  It's hard to say without seeing your code.  

A while ago I wrote a similar test program (only for ORBit 0.5.12) with
an interface called Fortune to return fortunes from remote servers.  My
server initialization code looked something like this:

#define THROW if (ev->_major != CORBA_NO_EXCEPTION) {           \
g_error("CORBA Exception:  %s", CORBA_exception_id(ev)); }

...

    /* Initialize the CORBA environment. */

    ev = g_new0(CORBA_Environment, 1);
    CORBA_exception_init(ev);
    THROW;
    orb = CORBA_ORB_init(&argc, argv, "orbit-local-orb", ev);
    THROW;

    /* Snag the root POA and instantiate my server. */
    root_poa = (PortableServer_POA)CORBA_ORB_resolve_initial_references
        (orb, "RootPOA", ev);
    THROW;
    fortune = impl_Fortune__create(root_poa, ev);
    THROW;

Notice two things:  first, I've allocated space for my ev struct;
second, I *always* checked for failures after each ORB call that might
report one...  It's possible you're trying to use the root POA after
having failed to get a reference.





On Wed, 2002-04-24 at 09:51, Katherine Goude wrote:
> Thanks to everyone for helping me with my Makefile problem yesterday -
> my server and client programs now successfully compile! :-)
> 
> But! ...when I run the server program I get a segmentation fault and it
> crashes. I've added debug code and I've found the point where the seg
> fault occurs. It occurs at the line:
> 
> objid = PortableSever_POA_activate_object(poa, newservent, ev)
> 
> Which is inside my impl_Calculator__create function (it's my first ever
> program using ORBit2 so I'm just attempting a simple calculator).
> 
> Any ideas what might cause this error?
> 
> Thanks in advance,
> Katherine
> 
> _______________________________________________
> orbit-list mailing list
> orbit-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/orbit-list
-- 
Mark Pedersen
ITA Software, Inc.





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