access violation crash in recoverfile(file.dxf)
access violation crash in recoverfile(file.dxf)
hi,
using odamfcapp, and also in my code, i get "access violation" crash in recoverfile() when called on the attached dxf drawings.
i'm using dd version 2.4.2.0, odamfcapp built with debug vc2003mdd libs, my app built with debug vc8mdd libs.
test files description:
1) gcctest-2004.dxf: valid drawing containing aec, no problems calling readfile(), audit shows all ok, crashes in recoverfile()
2) visitctr.dxf: corrupted drawing (dim system vars), problems calling readfile() with final msgbox: "invalid index!", crashes in recoverfile()
to reproduce in odamfcapp:
- file/recover... menu
- select attached file
-> crash
while i don't get a crash on 1) in my app, because i first open it by readfile() before attempting to recover, i will always get crash on 2).
however, if 1) was corrupted and readfile was throwing exception, i'd also end up calling recoverfile, and get a crash.
can you please let me know how to safely avoid this problem (without catch(...))? this problem has highest priority and i just don't know how to get rid of it.
thanks very much in advance!
filip jerabek
---------------------------
call stack:
1) access violation reading location 0x00000008:
odamfcapp.exe!oddbdatabase::newregapp() line 448 + 0x3 c++
odamfcapp.exe!oddbobjectimpl::dxfinxdata() line 1869 + 0x1b c++
odamfcapp.exe!oddbobject::dxfin() line 1028 c++
odamfcapp.exe!oddbdxfloader::loadobject() line 1089 + 0x45 c++
odamfcapp.exe!oddbsymboltable::dxfin() line 451 + 0x38 c++
odamfcapp.exe!oddbdxfloader::loadtables() line 589 + 0x2d c++
odamfcapp.exe!oddbdxfloader::loadcontents() line 271 c++
odamfcapp.exe!oddbdxfloader::loaddrawing() line 189 + 0x8 c++
odamfcapp.exe!oddbdxfloader::enddbloading() line 113 c++
odamfcapp.exe!oddbdatabase::closeinput() line 621 + 0x1e c++
odamfcapp.exe!oddbdatabase::readfile() line 527 c++
odamfcapp.exe!oddbhostappservices::recoverfile() line 612 c++
> odamfcapp.exe!codamfcappapp

enfile() line 1887 + 0xc6 c++
2) access violation reading location 0x00000001:
> odamfcapp.exe!odsmartptr<odresbuf>::internaladdref () line 96 + 0xa c++
odamfcapp.exe!odsmartptr<odresbuf>:

dsmartptr<odr esbuf>() line 212 c++
odamfcapp.exe!oderror_invalidsysvarvalue::limmin() line 86 + 0x14 c++
odamfcapp.exe!oddbdxfloader::loadheader() line 1672 + 0x12 c++
odamfcapp.exe!oddbdxfloader::loaddrawing() line 173 c++
odamfcapp.exe!oddbdxfloader::enddbloading() line 113 c++
odamfcapp.exe!oddbdatabase::closeinput() line 621 + 0x1e c++
odamfcapp.exe!oddbdatabase::readfile() line 527 c++
odamfcapp.exe!oddbhostappservices::recoverfile() line 612 c++
odamfcapp.exe!codamfcappapp

enfile() line 1887 + 0xc6 c++
odamfcapp.exe!codamfcappdoc:

nopendocument() line 311 + 0x12 c++
where m_pobject==0x8 in internaladdref()
attached files
hi again,
referring to the above 2 drawings, readfile() throws oderror instance with einvalidindex error code.
so the workaround would be not to call recoverfile() if this exception was thrown during previous readfile. but this would prevent other, possibly recoverable files (with einvalidindex prb), to be recovered.
is it correct to state "if einvalidindex prb exists, the file is never recoverable"?
thanks!
filip
the problem with recovering the first file is fixed in 2.5
the second file has revealed another problem that will be fixed in the next update (2.5.2, sheduled on march)
thanks for your report.
vladimir
thanks
filip