高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】i have some dwg files that crash in safeopenobjec
i have some dwg files that crash in safeopenobject
i have some dwg files that crash in safeopenobject
it seems to be generated from a table in the dwg files
using current build of direct kit
here is my code;
//walk this layouts entities
oddbobjectiteratorptr ploiter = pbtlayout->newiterator();
for (ploiter->start(ploiter->objectid()); ! ploiter->done(); ploiter->step())
{
//if this is a block with attributes we are interested in
oddbentityptr pent = ploiter->objectid().safeopenobject();
here is a stack dump of the crash
address frame function sourcefile
7c812a5b 0012f560 raiseexception+52
004378ad 0012f5a0 _cxxthrowexception+34
0056118b 0012f5c4 ?safeopenobject@oddbobjectid@@qbe?av?$odsmartptr@v oddbobject@@@@w4openmode@oddb@@_n@z+4b
005e28bf 0012f6f0 ?composeforload@oddbtableimpl@@uaexpavoddbobject@@ w4savetype@oddb@@w4dwgversion@4@@z+6bf
006fabdd 0012f74c ?loadobjectdata@oddwgfileloader@@aaexaavoddwgfiles plitstream@@aav?$odsmartptr@voddbobject@@@@@z+2cd
006fb410 0012f780 ?loadobject@oddwgfileloader@@iae?av?$odsmartptr@vo ddbobject@@@@aavoddwgfilesplitstream@@k@z+170
006fbe03 0012f818 ?loadobject@oddwgfileloader@@mae?av?$odsmartptr@vo ddbobject@@@@k@z+63
00708ba0 0012f83c ?loadobject@oddwgr18fileloader@@mae?av?$odsmartptr @voddbobject@@@@k@z+40
006f968b 0012f858 ?queryx@odobjloadresolver@@ubepavodrxobject@@pbvod rxclass@@@z+3b
00553620 0012f86c ?cast@oddbobject@@sa?av?$odsmartptr@voddbobject@@@ @pbvodrxobject@@@z+20
0056103b 0012f89c ?openobject@oddbobjectid@@qbe?av?$odsmartptr@voddb object@@@@w4openmode@oddb@@_n@z+fb
005611a2 0012f8c8 ?safeopenobject@oddbobjectid@@qbe?av?$odsmartptr@v oddbobject@@@@w4openmode@oddb@@_n@z+62
it seems that something is wrong with the file and that you open the file partial mode. try to open the file with open and recover in odamfcapp. does it report errors?
sergey slezkin
dwg files that crash in safeopenobject
thanks sergey
i tried to build odamfcapp. it needs windirectx.lib, i cant find that.
acad can open the files. if they are saved with 2004, the problem disappears. if they are saved with 2007, it remains.
in any case, as you say, there is some level of error in the dwg itself.
i have attached some for you to get a look at.
its only 400k as a zip, they are qute small.
attached files (469.2 kb, 2 views)
the exception while opening 2004 file is caused by dd bug in processing oddbtable round-trip data.
recover can load the file but the table entity would be lost.
btw, which compiler do you use? we have odamfcapp.exe built in most binary distributions. also allexamples workspace has dependenies set to build required projects in correct order.
sergey slezkin
i use vc 2003
i probably caused my own pain (again)
i went to the odamfcapp project instead of building all the examples
no biggie there
by the way, i am able to catch the exception and continue on
probably should have been catching it anyway
with this particular file exception should not be thrown after the bug in dd is fixed. but in case of partial loading the attempt to open the object may fail if some data in file is corrupted. at the moment you open the object for the first time it's actually loaded from file.
sergey slezkin
thanks sergey
we do a partial load, in that we are extracting attribute values, layer names, and so on, but we dont really need to totally load the drawing
at one time this was a speed up - it might be that partial load no longer has an advantage for us. would you have an opinion on that?
surely if you do not process the whole drawing contents partial loading would save time. the effect depends on drawing version (with r12 - no effect, r13-r15 some speed up, r18-r21 - the most significant effect).
but if some data in file is not correct you may get exception thrown from openobject(). in case of full load you'll get this exception from inside of readfile().
recoverfile() always do full load.
btw, surely comparing time for partial and full loading you need to measure not the time spent in readfile() but the time of all processing.
sergey slezkin
|