[Migrated content. Thread originally posted on 09 February 2012]
I have a trouble with changing idl in existing application.I made CORBA application that constist of a server and client parts (version 1), both are c applications (C builder).
At some point I need to change a part of IDL interface. After that I have new server and new client application (version2). Argument list in one corba object call was changed (I added new argument to existing call). So we have version 2. And this version 2 server is crashed after a call from old client application.
I understand that changes in interfaces are not advisable. But it has happened.
I agree that client and server build with different idl can not work together flawlessly. But the problem is that server application CRASHES (process exits with access violation) when it is coonected by outdated client. I want server app to be stable, to run no matter the input. If client app expects different interface - it should be problem of a client app, server must generate understandable error (marshal error), but server should not crash.
By the way, server crash in such a situation is also a flaw in security, because you can make server crash if you know it's interface details.
Is there a workaround for this problem. How can I prevent server from crashing when it is connected by a mismatched client. I wrote a version check method that runs when a client connects to server, it can help to prevent crash on subsequent calls, but stil there is a chance of server crash, if mismatched call is issued before version check is done (when first "connect" method uses different interface), or if version check is disabled.
You can reproduce this behavior by using simplest visibroker example: examples\\basic\\bank_agent. Build it "as is". then make a copy, change interface in Bank.idl, correct implementation and usage in BankImpl.h Client.C (just add argument to "balance" method).
I use visibroker for c 4.5.
version1:
interface Account {
float balance();
};
version2:
interface Account {
float balance(in string b);
};