几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】memory corruption (http://www.dimcax.com/hust/showthread.php?t=17165)

yang686526 2009-05-06 05:34 PM

【转帖】memory corruption
 
memory corruption
memory corruption
hi everyone,
this was originally in another thread, but the name of the thread was probably not descriptive enough, so here i try again :-) ...
we have recently moved to 2.0.2 -> 2.1.0, and i had started to note some funny problems with our product. since opendwg is wrapped in our activex control for our product, i have researched constantly, and finally created a brand new activex control from scratch (ie moving all my code out of the equation.)
when you compile the debug build of the attached project, linked with 2.1.0 and adt equivilant libraries, and try and do a regsvr32.exe against the result ocx, i get the following message :
loadlibrary ("c:\....\activexxtest.ocx") failed - invalid access to memory location.
however if i remove the following lines from the control :
// the following is for brep support
odrx_declare_static_module_entry_point(modelermodu le);
// adtdirect
odrx_declare_static_module_entry_point(aecarchbase );
odrx_declare_static_module_entry_point(aecarchdach base);
odrx_declare_static_module_entry_point(aecareacalc ulationbase);
odrx_declare_static_module_entry_point(aecbase);
odrx_declare_static_module_entry_point(aecschedule );
odrx_declare_static_module_entry_point(aecschedule data);
odrx_declare_static_module_entry_point(aecstructur ebase);
odrx_begin_static_module_map()
odrx_define_static_application(dd_t("modelergeomet ry"), modelermodule)
// adt direct
odrx_define_static_application(dd_t("aecarchbase") , aecarchbase)
odrx_define_static_application(dd_t("aecarchbase40 "), aecarchbase)
odrx_define_static_application(dd_t("aecarchdachba se"), aecarchdachbase)
odrx_define_static_application(dd_t("aecarchdachba se40"), aecarchdachbase)
odrx_define_static_application(dd_t("aecareacalcul ationbase"), aecareacalculationbase)
odrx_define_static_application(dd_t("aecareacalcul ationbase40"), aecareacalculationbase)
odrx_define_static_application(dd_t("aecbase"), aecbase)
odrx_define_static_application(dd_t("aecbase40"), aecbase)
odrx_define_static_application(dd_t("aecschedule") , aecschedule)
odrx_define_static_application(dd_t("aecschedule40 "), aecschedule)
odrx_define_static_application(dd_t("aecscheduleda ta"), aecscheduledata)
odrx_define_static_application(dd_t("aecscheduleda ta40"), aecscheduledata)
odrx_define_static_application(dd_t("aecstructureb ase"), aecstructurebase)
odrx_define_static_application(dd_t("aecstructureb ase40"), aecstructurebase)
odrx_end_static_module_map()
everything works perfectly fine, and the regsvr32.exe succeeds?
please let me know if i can help any further with this problem, as this is quite an urgent issue for us.
cheers
jason
attached files
hello, jason
could you please check what happens if only the following remains?
odrx_begin_static_module_map()
odrx_define_static_application(dd_t("modelergeomet ry"), modelermodule)
odrx_end_static_module_map()
it will make clear what caused the problem (adtdirect or dwgdirect).
regards,
vladimir alekseev
vladimir,
it all works perfectly if this is the only module loaded.
i then also put the aec modules back, and it instantly crashed again.
cheers
jason
quote:
originally posted by vladimir alekseev
hello, jason
could you please check what happens if only the following remains?
odrx_begin_static_module_map()
odrx_define_static_application(dd_t("modelergeomet ry"), modelermodule)
odrx_end_static_module_map()
it will make clear what caused the problem (adtdirect or dwgdirect).
regards,
vladimir alekseev
hello, jason
it is adtdirect bug. it will be fixed in 2.1.1.
also if you are interested in immediate fix please e-mail me(valekseev@softdev.spb.ru) which configurations you are using (vc6 lib?) and the location to upload fixed version to.
regards,
vladimir alekseev
ok, this problem was fixed with the new libs from vladimir, however, i still get another crash/memory problem, and this time i removed the adt libraries, and the crash still happens.
i use the project attached at the beginning of this thread, and open it in tstcon32.exe from microsoft, and bang it crashs with the following output from debugview.exe :
00000000 0.00000000 [1176] detected memory leaks!
00000001 0.00003352 [1176] dumping objects ->
00000002 0.00007906 [1176] {56}
00000003 0.00012432 [1176] normal block at 0x09203e98, 20 bytes long.
00000004 0.00017796 [1176] data: < > 01 00 00 00 03 00 00 00 03 00 00 00 00 00 00 00
00000005 0.00025506 [1176] {55}
00000006 0.00030786 [1176] normal block at 0x09203e40, 36 bytes long.
00000007 0.00035116 [1176] data: <@> = @> > 40 3e 20 09 e8 3d 20 09 40 3e 20 09 cd cd cd cd
00000008 0.00039698 [1176] {54}
00000009 0.00044894 [1176] normal block at 0x09203de8, 36 bytes long.
00000010 0.00049252 [1176] data: < > 00 00 00 00 00 00 00 00 00 00 00 00 cd cd cd cd
00000011 0.00053834 [1176] {53}
00000012 0.00059030 [1176] normal block at 0x09203da0, 24 bytes long.
00000013 0.00063332 [1176] data: <s i m p l e x . > 73 00 69 00 6d 00 70 00 6c 00 65 00 78 00 2e 00
00000014 0.00067914 [1176] {52}
00000015 0.00073138 [1176] normal block at 0x09203d58, 20 bytes long.
00000016 0.00077580 [1176] data: < = > 01 00 00 00 0b 00 00 00 0b 00 00 00 a0 3d 20 09
00000017 0.00082329 [1176] {44}
00000018 0.00087665 [1176] client block at 0x09203a90, subtype 0, 64 bytes long.
00000019 0.00092107 [1176] a cdynlinklibrary object at $09203a90, 64 bytes long
00000020 0.00096716 [1176] {37}
00000021 0.00101270 [1176] client block at 0x09202580, subtype 0, 64 bytes long.
00000022 0.00105768 [1176] a cdynlinklibrary object at $09202580, 64 bytes long
00000023 0.07240166 [1176] object dump complete.
00000024 0.12481922 [1176] detected memory leaks!
00000025 0.12487397 [1176] dumping objects ->
00000026 0.12492007 [1176] {56}
00000027 0.12496532 [1176] normal block at 0x09203e98, 20 bytes long.
00000028 0.12501924 [1176] data: < > 01 00 00 00 03 00 00 00 03 00 00 00 00 00 00 00
00000029 0.12509663 [1176] {55}
00000030 0.12510948 [1176] normal block at 0x09203e40, 36 bytes long.
00000031 0.12516283 [1176] data: <@> = @> > 40 3e 20 09 e8 3d 20 09 40 3e 20 09 cd cd cd cd
00000032 0.12520781 [1176] {54}
00000033 0.12525251 [1176] normal block at 0x09203de8, 36 bytes long.
00000034 0.12530727 [1176] data: < > 00 00 00 00 00 00 00 00 00 00 00 00 cd cd cd cd
00000035 0.12538549 [1176] {53}
00000036 0.12543801 [1176] normal block at 0x09203da0, 24 bytes long.
00000037 0.12548187 [1176] data: <s i m p l e x . > 73 00 69 00 6d 00 70 00 6c 00 65 00 78 00 2e 00
00000038 0.12553160 [1176] {52}
00000039 0.12554389 [1176] normal block at 0x09203d58, 20 bytes long.
00000040 0.12559725 [1176] data: < = > 01 00 00 00 0b 00 00 00 0b 00 00 00 a0 3d 20 09
00000041 0.12567435 [1176] {44}
00000042 0.12572268 [1176] client block at 0x09203a90, subtype 0, 64 bytes long.
00000043 0.12576738 [1176] a cdynlinklibrary object at $09203a90, 64 bytes long
00000044 0.12581348 [1176] {37}
00000045 0.12585845 [1176] client block at 0x09202580, subtype 0, 64 bytes long.
00000046 0.12590706 [1176] a cdynlinklibrary object at $09202580, 64 bytes long
00000047 0.13783065 [1176] object dump complete.
the microsoft test container errors with :
failed to create control: unspecified error.
now this is only at the creation of the control, also i get it on only a few of the computers in the office.
any ideas on what is wrong, and once again i still suspect something wrong in opendwg initialization sequence.
as a note, i also removed the modelergeometry module, and still it crashed.
cheers
jason
anyone can help? as this is quite urgent.
cheers
jason
i could not reproduce the error in debug mode.
do you get the crash in debug or release?
as i see, you are using opengl. perhaps the crash is gl-related.
did you try to comment out system services class, and do not link with dd at all.
will it work ok then, on these computers you got a crash prevoiusly?
vladimir
last edited by vkalinin; 16th october 2006 at 03:13 amfff">.
i seemed to have fixed it by simply applying visual studio service pack six to my dev environment, and all seems fixed.
sorry for any inconvenience caused.
cheers
jason


所有的时间均为北京时间。 现在的时间是 12:21 PM.