查看单个帖子
旧 2009-05-04, 03:18 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】abnormal program termination

abnormal program termination
abnormal program termination
hi.
it becomes an [abnormal program termination] when outputting it with the v1.14 odwriteex sample.
it is time when it outputed data that exceeds capacity on the disk where capacity is a little.
v1.13.02 odwriteex sample is err(efilewriteerror), and it ends normally.
isn't there evasion method?
thanks.
i failed to reproduce it with several 1.14 builds.
which build number you have problems with, which compiler?
(i was experimenting with floppy disk).
sergey slezkin
hi,
i have vc6/vc8 of windows(32-bit) platform.
i also is experimenting on the floppy disk.
vc6 or vc8?
static linking or dll?
if static which library (ml, mt, md)
debug or release
1.14.0, 1.14.1, 1.14.2, .... ?
writeex saves dxf or dwg?
to which autocad file version?
sergey slezkin
it is 1.14.2 vc6(md) debug that i tried.
the tried sample is examples\odwriteex.
autocad file type & version is 2000 dxf.
the bug is in odfilebuf.cpp
code:
void odbasefilebuf:utbytes(const void* buffer, oduint32 nlen)
{
oda_trace("putbytes(%p, %u)", buffer, nlen);
dword dwbytes = 0;
if( !::writefile(m_hfile, buffer, nlen, &dwbytes, null) || dwbytes != nlen )
{
oda_trace("putbytes() can't write bytes");
throw oderror_fileexception(efilewriteerror, m_sfilename);
}
m_bfilewritten = true;
}
if writing failed exception is thrown. but when odwrfilebuf destructor is invoked it calls flush() which results in one more exception because again calls putbytes().
sergey slezkin
i understood!
isn't there evasion method in v1.14?
odfilebuf source is available (extensions/exservices).
you can add an error flag which is zeroed in constructor and turned on before throwing exception.
close() should not call flush() if the flag is on.
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)