callback problem



Hello, 

i've not been able to find a corba callback sample written in c. So i
started poking around myself based on orbit's mt-calculator sample.

To be able to receive callbacks on the client side i copied the
server code and activated my listener object which i then pass on to
the server. 

Now i'm cleaning up the code a bit and would like to have only one
initialisation - previously i had client init AND server init funcs
on the client. The problem is since i removed the client's
CORBA_ORB_init(single threaded) it's not working any more. There's
two variants of failure as explained below.

Maybe anyone even got a piece of code which is running multithreaded
CORBA server and client functionality in one process at hand?

Thanks, 
Rob


1st variant: failing on call which triggeres callback

(gdb) r
Starting program:
/home/robert/Desktop/Devel/cfs/test5/calculator-client
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 2469)]
[New Thread 32769 (LWP 2471)]
[New Thread 16386 (LWP 2472)]
[New Thread 32771 (LWP 2473)]
Reading service reference from file "caller.ref"
sending message 'Hello World!'
calling ...

** ERROR **: Attempted to marshal a bogus / dead object 0x1001605c
type
aborting...

Program received signal SIGABRT, Aborted.
[Switching to Thread 16384 (LWP 2469)]
0x0fbbaaa0 in kill () from /lib/libc.so.6
(gdb) bt
#0  0x0fbbaaa0 in kill () from /lib/libc.so.6
#1  0x0fe5485c in pthread_kill () from /lib/libpthread.so.0
#2  0x0fe54cd8 in raise () from /lib/libpthread.so.0
#3  0x0fbba888 in raise () from /lib/libc.so.6
#4  0x0fbbbfa0 in abort () from /lib/libc.so.6
#5  0x0fdd4948 in g_logv () from /usr/lib/libglib-2.0.so.0
#6  0x0fdd49b4 in g_log () from /usr/lib/libglib-2.0.so.0
#7  0x0ffaf550 in ORBit_marshal_object () from
/usr/lib/libORBit-2.so.0
#8  0x0ffb5834 in ORBit_marshal_value () from
/usr/lib/libORBit-2.so.0
#9  0x0ffac230 in ORBit_small_freekids () from
/usr/lib/libORBit-2.so.0
#10 0x0ffac7e4 in ORBit_small_invoke_stub () from
/usr/lib/libORBit-2.so.0
#11 0x0ffac6a4 in ORBit_small_invoke_stub_n () from
/usr/lib/libORBit-2.so.0
#12 0x0ffc1fbc in ORBit_c_stub_invoke () from
/usr/lib/libORBit-2.so.0
#13 0x10003f80 in Caller_blocking_call (_obj=Cannot access memory at
address 0x16
) at calculator-stubs.c:79
#14 0x100033f4 in client_callback (service=0x1003d510,
listener=0x1001605c,
    ev=0x7ffff910) at calculator-client.c:92
#15 0x10003c58 in main (argc=1, argv=0x7ffff9a4) at
calculator-client.c:416
(gdb) quit


2nt variant: failing even earlier, when sending simple hello message
to check connection

(gdb) r
Starting program:
/home/robert/Desktop/Devel/cfs/test5/calculator-client
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 2543)]
[New Thread 32769 (LWP 2545)]
[New Thread 16386 (LWP 2546)]
[New Thread 32771 (LWP 2547)]
Reading service reference from file "caller.ref"
sending message 'Hello World!'

** ERROR **: file giop.c: line 601 (giop_main_run): assertion failed:
(giop_thread_self () == giop_main_thread)
aborting...

Program received signal SIGABRT, Aborted.
[Switching to Thread 32771 (LWP 2547)]
0x0fbbaaa0 in kill () from /lib/libc.so.6
(gdb) bt
#0  0x0fbbaaa0 in kill () from /lib/libc.so.6
#1  0x0fe5485c in pthread_kill () from /lib/libpthread.so.0
#2  0x0fe54cd8 in raise () from /lib/libpthread.so.0
#3  0x0fbba888 in raise () from /lib/libc.so.6
#4  0x0fbbbfa0 in abort () from /lib/libc.so.6
#5  0x0fdd4948 in g_logv () from /usr/lib/libglib-2.0.so.0
#6  0x0fdd49b4 in g_log () from /usr/lib/libglib-2.0.so.0
#7  0x0ffa5928 in giop_main_run () from /usr/lib/libORBit-2.so.0
#8  0x0ffab198 in CORBA_ORB_run () from /usr/lib/libORBit-2.so.0
#9  0x100037f0 in server_run (orb=Cannot access memory at address 0xe
) at calculator-client.c:243
#10 0x10003a20 in server_in_background (data=0x7ffff8d0)
    at calculator-client.c:335
#11 0x0fde8374 in g_static_private_free () from
/usr/lib/libglib-2.0.so.0
#12 0x0fe51dd0 in pthread_start_thread () from /lib/libpthread.so.0
#13 0x0fe51e48 in pthread_start_thread_event () from
/lib/libpthread.so.0
#14 0x0fc66278 in clone () from /lib/libc.so.6
(gdb)



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