crash reading dwf on unix
crash reading dwf on unix
we're having a problem reading dwf files on unix. with build 1.13.02 of dwgdirect, it appears to work fine on windows, but not on solaris or mac os x. (i haven't yet tried the other unices.)
the crash occurs somewhere in the destruction of a wt_string object, during the destruction of a wt_text object. when i use libmallocdebug on mac os x, buffer ovverruns are reported and the crash is averted.
i strongly suspect that the problem is related to differences in the size of wchar_t on the various platforms (two bytes on windows, four bytes on unix). my evidence is that (1) we have only seen the problem with dwf files; (2) the problem *appears* to be related to character strings; (3) the dwftoolkit library appears to make liberal use of wcscpy(), wcslen(), wcscat(), etc., unlike the rest of opendwg; and (4) there is an apparent buffer overrun, which guarded memory allocations avoid.
i will have to check with our customer to determine whether i can provide a copy of the dwf that is causing the problem.
the stack trace at the time of the crash looks like the following on mac os x. it is slightly different in solaris, but still within wt_file::get_next_object.
#0 0x90006cec in szone_free ()
#1 0x0625f5dc in odrxfree ()
#2 0x0625f480 in operator delete[] ()
#3 0x061d4b24 in wt_string::set ()
#4 0x061d48e8 in wt_string:

perator= ()
#5 0x061d4454 in wt_string::~wt_string ()
#6 0x061d4420 in wt_string::~wt_string ()
#7 0x062137c0 in wt_text::~wt_text ()
#8 0x06213698 in wt_text::~wt_text ()
#9 0x061ee2c0 in wt_file::get_next_object_shell ()
#10 0x061ee09c in wt_file::get_next_object ()
#11 0x061edf8c in wt_file:

rocess_next_object ()
#12 0x0619811c in dwfimporter::loadstream ()
#13 0x06194fe0 in dwfimporter::loadw2dext ()
#14 0x06196be0 in dwfimporter::loadpackage ()
#15 0x06195270 in dwfimporter::import ()
#16 0x06146a8c in acad2004_importdwf ()
...
please send a dwf file that causes this problem to happen, to , and we will look into it.