[omniORB] Question about exceptions ...

Tom Gardner tomg@tomg.com
Thu, 02 Jul 1998 16:50:28 -0700


hello omniORBers:

I'm not sure why ... but I
cannot get exceptions to
work correctly ... my
servers always crash.

Anyone have any suggestions?

----------------------------
My idl is defined as:

enum ErrorT {
   NO_PERMISSION,
   DATA_NOT_FOUND
};

typedef string            ReasonT;
typedef sequence<ReasonT> ReasonSeqT;

exception operation_error {
   ErrorT     error;
   ReasonSeqT reason;
};

interface etest {
   void get_one (in string o)
      raises (operation_error);

};

----------------------------
My implementation does this:

..
   ReasonSeqT reason(1);
   reason.length(1);
   reason[0] = strdup ("erra ya moron ya");
   operation_error *Err = new operation_error (DATA_NOT_FOUND, reason);
   throw (Err);
..


A simple example is included in
the uuencoded tar file below.
It contains a complete implementation
with scripts to compile on
Solaris using gcc and Sun C++ ... 

Thanks for any help
tomg


----------------------------
The debugger's trace:

Current function is abort
(debugger) where
  [1] __sigprocmask(0x0, 0x6095e958, 0x0, 0x0, 0xffffffff, 0x0), at
0xef463460
  [2] _resetsig(0x0, 0xef475240, 0x0, 0x0, 0xeea03de0, 0x1), at
0xef45b024
  [3] _sigon(0xef479cf8, 0xef479bf8, 0xeea03e44, 0xeea037cc, 0x6, 0x8),
at 0xef45a8e8
  [4] _thrp_kill(0x0, 0x8, 0x6, 0xef475240, 0xeea03de0, 0x0), at
0xef45d4f4
  [5] kill(0x2c6a, 0x6, 0xef475240, 0xeea03894, 0xef475240, 0xef4c5de0),
at 0xef46326c
=>[6] abort(), line 748 in "tcpSocketMTfactory.cc"
  ---- hidden frames, use 'where -h' to see them all ----
  [8] unexpected(0xef4e1480, 0xef4d71e0, 0x5, 0x0, 0x6f6e6500,
0x6f6e6500), at 0xef4c5d60
  [9] eImpl::get_one(this = 0x33858, o = 0x31dc8 "mine"), line 14 in
"eImpl.cc"
  [10] _sk_etest::dispatch(this = 0x338a8, _0RL_s =  CLASS , _0RL_op =
0xeea03c28 "get_one", _0RL_response_expected = '^A'), line 220 in
"eSK.cc"
  [11] GIOP_S::HandleRequest(0x1, 0x0, 0x0, 0x33860, 0xeea03c6c,
0xeea03bd8), at 0xef6b9584
  [12] static GIOP_S::dispatcher(0x34040, 0xef6ed880, 0xef4d71e0,
0xef476c90, 0x0, 0x31dc1), at 0xef6b8218
  [13] tcpSocketWorker::run(this = 0x340d0, arg = 0x34040), line 958 in
"tcpSocketMTfactory.cc"
  [14] omni_thread_wrapper(0x340d0, 0xef303d80, 0x0, 0xef47de90, 0x1,
0xfe401000), at 0xef7620b4

----------------------------
The full example:

begin 644 e.tar.gz
M'XL(" ,;G#4" V4N=&%R .U9>T_;2!#G;W^*O115@6+'SE,*$"F$M!<5'!2'
MHE-ULHRS27QUO.ZNS4.G?O>;?=@)":5P1TDY927P[NSLS.S:\YN9C1]B+]KZ
MN<VT3+-1JVV9IFDU:A9_\JYZ0L^L;YGU6K7>J)>M>A7H5KG,^;9>H*4L\2BH
M3,AL\A ?2::8/K1)WJJF?%KEK5?2Z SI=(QV#:)E7>>CX?O9"!O3:=YW,+W"
M%.%.&. H0;N]_@#YA&)M:]->:?/)+-Y:K_];M7+N_U:U8@G_MRKFQO]?H+WY
MK7091"4VU1A.D'ZC:9V.^WO_M'M8(G%2<L[M"Q934G(Z%<,T+#Y[U+,/MQ47
M7\QI/;LSIP61'Z8C7.IT-*U_:O<6Y)%9%/0'1Y(L!.4,0I08"6%SNA(GYTYZ
M1XMS87"I*?W.84'O;<L^@EXF:K&?Z2]SXMG%<2$7RE>?;&<CI(><\Z2C.G*)
MZ"93BKU108.3R=:%L20"1TQ8<%.%#B/^%WZ@8<1"^$\Q(^$5=$9A@=LK5^;Z
M'+2=R1/3[T_:'[CD"=*OD3X#.<?NH-NUAX.V/>0#EZ_D5KDN$F,6>]2'@>BG
M$6&JWW<^=0=.KV^[[F$-*.<,GV5;T+:SUR#.)1B%9<![>&C;\C7#&T2ZC[8S
MBY Z7@="@0@2/^;KS>+P<9PRN"SQSAFY1J+DD9R;(#T?"&9QF'J8^/$U]>(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:EC*O-?^K->:__]0JLO[G]P ;
M_']!_ _(/0&@(+^/Z10J.-%M-L4#%7TH'A,%N4Q%@%()C0B*X*AXUF,8QOR3
M$Q\<SX\R,;G#+@KBF1)4C!QG[G>8O65'5)I]DB;2;X3TN=<([R#WN\A*:E>T
M)&[(D1'B:)),[Q(_FW\"*,))C=(8P 9L\-"MAV:$@C??>@IXEO%F%U)+%9.6
MIXIW,]X]I4?*46<!JW>DQSY__J?>[SK]OU*O9/5?M6$I_^=UX,;_7\#_QQ&O
MG+ ;3+4WT(/H*0>+(" !P \]QN25"&JB.+T, Q]=!31)O1"Y[(N;E4+\TY73
M32T+T:NH(6]1;&^&56JU4D$M0T->^#T1(U1Y]08@(!AO?JR^X__Y/=CZ[O^M
M//[7&E53U7^-RL;_?X'Z3X6'5U,#2IS95148#[B" I$ZYX IO<7K)3=@+K^=
MOBV"HL4:$C*:E5J(99;(0HN77.IVYSE*HO8(RA;IBE!K+&EH/KE RHOA,:R+
M &'!^,5J5R8I635,9#F<\:H41A!!#[NKC*R6Q'!Z>BN 4YX?J)I9*3<V@+MI
1F[9IF_:+M'\ Z*VGKP L   4
 
end


-- 

--------------------------------------------------------
Tom Gardner                      e-mail:  tomg@iopen.com
21120 Serene Way                 Phone:   (408) 927-6687
San Jose, CA 95120-1217          Fax:     (408) 927-6684
--------------------------------------------------------