www.digitalmars.com         C & C++   DMDScript  

c++ - A DMC bug causing "abnormal program termination"? - test.cpp

reply Wu Yongwei <Wu_member pathlink.com> writes:
Compiled with:

sc -Ae test.cpp -I d:\dm\stlport\stlport stlport_dm_static.lib

it will report "abnormal program termination" when run.  It compiles, run well,
and report:

Exception caught: Boom
3
4
6

under MSVC 6, GCC 2.95.3, and GCC 3.3.1.

Sorry I cannot reduce it to a smaller test case.  The problem will not show up
if I simply replace my fc_queue with the standard std::queue.  According to what
the debugging procedure (in MSVC 6) showed, DMC failed to catch the
runtime_error thrown by f.push(5);

I am using v838, and I also tested with v836, with the same results.

Best regards,

Wu Yongwei


begin 0644 test.cpp
M(VEN8VQU9&4 /&EO<W1R96%M/ T*(VEN8VQU9&4 /'-T9&5X8V5P=#X-"B\O
M(&)E9VEN<R`C:6YC;'5D92`B9F-?<75E=64N:"(-" T*+RH-"B`J(&9C7W%U




M968N:#X-"B-I;F-L=61E(#QN97
M3D9)1U](*0T*(R!I;F-L=61E(#QS=&PO='EP95]T<F%I=',N:#X-"B, :68 




M<R]T>7!E7W1R86ET<RYH/ T*(V5L<V4-"B, :6YC;'5D92`\='EP95]T<F%I
M=',N:#X-

M7U1P/ T*8VQA<W, 9F-?<75E=64-"GL-"G!U8FQI8SH-" ET>7!E9&5F(%]4
M<`D)"0D)=F%L=65?='EP93L-" ET>7!E9&5F('-I>F5?=`D)"0ES:7IE7W1Y

M9B!C;VYS="!V86QU95]T>7!E* EC;VYS=%]P;VEN=&5R.PT*"71Y<&5D968 


M92AS:7IE7W1Y<&4 7U]M87A?<VEZ92D-" D)"3H 7TU?9G)O;G0H3E5,3"DL
M(%]-7V)A8VLH3E5,3"D-" D)"2P 7TU?<VEZ92 P*2P 7TU?;6%X7W-I>F4H

M7V%R<F%Y(#T ;F5W(%].;V1E6U]?;6%X7W-I>F5=.PT*"0EF;W( *%]?:2`]

M7V%R<F%Y6U]?:5TN7TU?;F5X="`](%]-7VYO9&5S7V%R<F%Y("L 7U]I("L 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G1A:6YS*&-O;G-T('9A;'5E7W1Y

M<F]N=#L-" D)=VAI;&4 *%]?;F]D92D-" D)>PT*"0D):68 *%]?>"`]/2`J
M*&-O;G-T7W!O:6YT97(I*"9?7VYO9&4M/E]-7V1A=&$I*0T*"0D)"7)E='5R
M;B!T<G5E.PT*"0D)7U]N;V1E(#T






M;WDH=F]I9"H 7U]P;VEN=&5R+"!?7W1R=65?='EP92D-" E[?0T*"79O:60 
M7U]D97-T<F]Y*'9O:60J(%]?<&]I;G1E<BP 7U]F86QS95]T>7!E*0T*"7L-


M97(L(%]?='EP95]T<F%I=',\7U1P/CHZ:&%S7W1R:79I86Q?9&5S=')U8W1O


M*%]?=F%L=64I.PT*"7T-" T*<')I=F%T93H-" EF8U]Q=65U92AC;VYS="!F
M8U]Q=65U928I.PT*"69C7W%U975E)B!O<&5R871O<CTH8V]N<W0 9F-?<75E



M*2`Z('9A;'5E7RAN*2![?0T*"4]B:F5C="AC;VYS="!/8FIE8W0F(&]B:BD-

M97)R;W(H(D)O;VTB*3L-" D)=F%L=65?(#T
M9G)I96YD(&]S=')E86TF(&]P97)A=&]R/#PH;W-T<F5A;28L(&-O;G-T($]B
M:F5C="8I.PT*<')I=F%T93H-" EI;G0 =F%L=65?.PT*"7-T871I8R!I;G0 
M<U]C;W5N=#L-
M<W1R96%M)B!O<&5R871O<CP\*&]S=')E86TF(&]S+"!C;VYS="!/8FIE8W0F
M(&]B:BD-"GL-" EO<R`\/"!O8FHN=F%L=65?.PT*"7)E='5R;B!O<SL-"GT-
M" T*:6YT(&UA:6XH*0T*>PT*"69C7W%U975E/$]B:F5C=#X 9B S*3L-" ET



M875G:'0Z("( /#P 92YW:&%T*"D /#P 96YD;#L-

L(#P
`
end
Jan 14 2004
parent Wu Yongwei <Wu_member pathlink.com> writes:
Ah, I found it out myself.  It seems to be caused by an old placement operator
new bug: when construct(void*, const _Tp&) fails by an exception, the code
generated will (erroneously) call operator delete, which caused the abortion.

Best regards,

Wu Yongwei

In article <bu5848$m4g$1 digitaldaemon.com>, Wu Yongwei says...
Compiled with:

sc -Ae test.cpp -I d:\dm\stlport\stlport stlport_dm_static.lib

it will report "abnormal program termination" when run
Jan 14 2004