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
M975E+F  (#$N,R`R,#`T+S`Q+S$U#0H * T*("H 1&5F:6YI=&EO;B!O9B!A
M(&9I>&5D+6-A<&%C:71Y('%U975E#0H * T*("H 0GD 5W4 66]N9W=E:0T*
M("H-"B`J+PT*#0HC:69N9&5F(%]&0U]1545515](#0HC9&5F:6YE(%]&0U]1
M545515](#0H-"B-I;F-L=61E(#QA<W-E<G0N:#X-"B-I;F-L=61E(#QS=&1D
M968N:#X-"B-I;F-L=61E(#QN97<^#0H-"B-I9B!D969I;F5D*%]35$Q07T-/
M3D9)1U](*0T*(R!I;F-L=61E(#QS=&PO='EP95]T<F%I=',N:#X-"B, :68 
M(61E9FEN960H7U-43%!?2$%37TY/7TY!34534$%#15,I#0IU<VEN9R!S=&0Z
M.E]?='EP95]T<F%I=',[#0IU<VEN9R!S=&0Z.E]?=')U95]T>7!E.PT*=7-I
M;F< <W1D.CI?7V9A;'-E7W1Y<&4[#0HC(&5N9&EF#0HC96QI9B!D969I;F5D
M*%]?1TY50U]?*2`F)B`H7U]'3E5#7U\ /CT ,RD-"B, :6YC;'5D92`\8F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V5P=&EO;B!C
M875G:'0Z("( /#P 92YW:&%T*"D /#P 96YD;#L-" E]#0H)9BYP=7-H*#8I
M.PT*"7=H:6QE(" A9BYE;7!T>2 I*2![#0H)"6-O=70 /#P 9BYF<F]N=" I
L(#P\(&5N9&P[#0H)"68N<&]P*"D[#0H)?0T*#0H)<F5T=7)N(#`[#0I]#0HI
`
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