Boards /
Runtime/AutoLISP /
Topic 2121
Fatal Error 2010
Started by jbuzbee ·
2014-04-04 19:10 UTC ·
57 replies · SMF topic #2121
jbuzbee
2014-04-04 19:10 UTC
I'm getting a pretty nasty fatal error in Acad 2010 when the OpenDCL.arx is loaded. I've painstakingly isolated it to OpenDCL. It happens when closing a document and executing the "new" command. At first I thought it was my command reactor but ruled that out as well.
Has anyone else seen this?
jb
bazzacad
2014-04-04 19:12 UTC
What version of OpenDCL are you using?
jbuzbee
2014-04-04 19:21 UTC
8.0.0.5
Also happened with 7.0.1.4
owenwengerd
2014-04-04 23:12 UTC
I could not reproduce the problem with AutoCAD 2010 64 bit on Windows 7 64 bit. I started AutoCAD 2010, entered OPENDCL to load OpenDCL Runtime 8.0.0.5, entered QNEW and started a new drawing, entered CLOSE to close the second drawing, entered NEW to start another new drawing. All worked as expected.
jbuzbee
2014-04-08 15:25 UTC
Ok, everyone knows that if I proclaim the problem is solved with the latest version the problem will return with a vengeance. >:(
So, I'm not going to say the problem is solved - that's not what I'm saying at all. ;)
jbuzbee
2014-04-08 17:22 UTC
DAMN IT >:( >:( >:( >:( >:(
jbuzbee
2014-04-16 15:42 UTC
Could someone load the attached and see if you can repeat what I'm seeing.
1. Open AutoCAD with a single drawing opened.
2. In the VLIDE editor load the attached lisp
3. command "kbadt"
4. Close the only opened drawing . . . Fatal Error
Thanks for any help.
jb
AutoCAD Architecture 2010
OpenDCL 8.0.0.5
Windows 7 64 bit
This didn't happen on ACA 2009, Opendcl 7, WinXP
owenwengerd
2014-04-16 16:40 UTC
I can reproduce it in plain AutoCAD 2010. Have you narrowed down which code causes it? I'll have a look under the debugger later today to see if I can tell from there.
jbuzbee
2014-04-16 17:45 UTC
It's difficult for me to narrow done any suspect code because it worked flawlessly in 2009. I'm not doing anything weird like reactors or accessing AEC via com. It's pretty straight forward stuff.
Thanks for your help Owen!
jb
owenwengerd
2014-04-16 19:31 UTC
I've narrowed the problem down to your (dcl_Form_Close) call in OnEnteringNoDocState. It appears to be a bug in AutoCAD that occurs when an asynchronous event is fired while entering no-document state. Offhand I don't see any easy way to detect and prevent it in the OpenDCL code, but I'll keep looking. A workaround in the meantime would be to set your form's Event Invoke property to Synchronous so that the OnClose fires synchronously instead of asynchronously.
BTW, the code you attached creates registry keys when executed. It's not really a good idea to upload code for testing that modifies the registry or file system, as it adds more time that I have to spend cleaning the code before I can test it. In this case it wasn't too difficult, but worth mentioning in case you had not thought about it.
owenwengerd
2014-04-17 03:15 UTC
For the next build, I've implemented an experimental fix for this problem. I added code to force synchronous event handling when a form is closing. This seems reasonable, since an asynchronous event handler will no longer be able to access the form (because the form will be closed before the handler executes). It does prevent this crash from occurring; hopefully it doesn't introduce any unwanted new problems.
jbuzbee
2014-04-17 14:37 UTC
Thank you Owen. I don't know what I would do without OpenDCL and obviously you.
Thank you again 8)
jb
p.s. sorry about the registry stuff
jbuzbee
2014-04-18 12:48 UTC
8.0.0.6 seems to have fixed the bug - Thanks again Owen
jbuzbee
2014-04-22 18:54 UTC
Well, now I have another Fatal Error: this one is, however, random. Same palette as posted here, multiple drawings opened, upon closing a drawing - bang.
Any thoughts?
jb
owenwengerd
2014-04-22 20:08 UTC
See if you can narrow it down to a specific piece of code like I did with the other crash. If you can get to where you can reproduce fairly reliably, then try Synchronous to see if that resolves it. If it does, then we'll know it's probably the same thing as before, just a different trigger.
fred_tomke
2014-04-22 20:13 UTC
Hi, what does the dmpuserinfo.xml say?
Regards, Fred
jbuzbee
2014-04-23 12:34 UTC
Couldn't find one Fred
jbuzbee
2014-04-23 12:46 UTC
Well, that's weird - OnEnteringNoDocState, the OnClose event fires.
Nevermind - I had that event selected in the editor . . ..
jbuzbee
2014-04-23 15:15 UTC
Owen the only thing I can think of is the OnDocActivated event?
owenwengerd
2014-04-23 15:47 UTC
That's plausible. Test your theory by removing the event. Did anything change when you tested Synchronous? If not, then it's probably something completely different.
jbuzbee
2014-04-23 16:25 UTC
Did anything change when you tested Synchronous?
No.
I'll try removing the event - thanks Owen
jbuzbee
2014-04-23 16:43 UTC
I cannot replicate the fatal error with the OnDocActivated event turned off.
jb
owenwengerd
2014-04-23 17:13 UTC
Does it still crash if you define the OnDocActivated event handler, but with only a (princ) and nothing else? And no change at all between Synchronous vs. Asynchronous?
jbuzbee
2014-04-23 17:34 UTC
no change between making the form synchronous or asynchronous
jbuzbee
2014-04-23 18:43 UTC
Well now I can't get it to crash at all - this morning was bad, but now, nothing. :o
jbuzbee
2014-04-24 14:15 UTC
Can I get any help on this - I'm in production on 4 stations and it's causing havoc - any help will be greatly appreciated.
Thank you very much.
James Buzbee
owenwengerd
2014-04-24 15:24 UTC
Unless I or someone else can reproduce the problem, I'm afraid you're the only one that can debug the problem. I have some additional ideas of things to try, but the next step depends on your answer to my earlier question about OnDocActivated.
jbuzbee
2014-04-24 15:40 UTC
Ok just happened. OnDocActivated didn't crash with just a princ so it must be in my code in the event call. I'll revise the code to effectively turn of the event for now.
(defun c:ADT/ADTPalette#OnDocActivated (/ dwg path)
(dcl_Tree_Clear ADT_ADTPalette_StyleTreeControl)
(kb:Propogate_00_StyleTreeControl)
(princ)
(princ))
(defun kb:Propogate_00_StyleTreeControl ( / llist doors hmlist sclist allist sllist fd1list
fd2list fd3list fd4list otlist)
(dcl_Tree_AddParent
ADT_ADTPalette_StyleTreeControl
(list (list "Walls" "wall" 0 0 0)
(list "Doors" "door" 1 1 1)
(list "Storefront" "doorwinass" 2 2 2)
(list "Windows" "window" 3 3 3)
(list "Curtain Wall" "curtain" 4 4 4)
(list "Spaces" "space" 5 5 5)
(list "Stairs" "stair" 6 6 6)
(list "Railings" "rail" 7 7 7)
(list "Roofs" "roof" 8 8 8)
(list "Slabs" "slab" 9 9 9)
(list "Masses" "mass" 10 10 10)
(list "Schedule Tags" "schdtag" 11 11 11)
(list "Schedules" "schd" 12 12 12)
(list "Tags and Symbols" "tags" 13 13 13)
(list "Mask Blocks" "mbks" 14 14 14)))
(dcl_Tree_AddChild
ADT_ADTPalette_StyleTreeControl
(list (list "door" "Metal Doors" "HM" 1 1 1)
(list "door" "Wood Doors" "SC" 1 1 1)
(list "door" "Aluminum & Glass Doors" "AL" 1 1 1)
(list "door" "other Doors" "OT" 1 1 1)
(list "door" "Fire Doors" "FD" 1 1 1)))
(dcl_Tree_AddChild
ADT_ADTPalette_StyleTreeControl
(list (list "FD" "1 hour doors" "FD1" 1 1 1)
(list "FD" "2 hour doors" "FD2" 1 1 1)
(list "FD" "3 hour doors" "FD3" 1 1 1)
(list "FD" "4 hour doors" "FD4" 1 1 1)))
;;; Propogate Doors ;
(setq doorlist (kb:getlocalObjectList "AEC_DOOR_STYLES"))
(foreach
x doorlist
(cond ((= (substr x 1 2) "HM") (setq hmlist (append (list x) hmlist)))
((= (substr x 1 2) "SC") (setq sclist (append (list x) sclist)))
((= (substr x 1 2) "AL") (setq allist (append (list x) allist)))
((= (substr x 1 2) "SL") (setq sllist (append (list x) sllist)))
((= (substr x 1 3) "FD1") (setq fd1list (append (list x) fd1list)))
((= (substr x 1 3) "FD2") (setq fd2list (append (list x) fd2list)))
((= (substr x 1 3) "FD3") (setq fd3list (append (list x) fd3list)))
((= (substr x 1 3) "FD4") (setq fd4list (append (list x) fd4list)))
(t (setq otlist (append (list x) otlist)))))
(if hmlist
(foreach
i hmlist
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "HM" i i 1 1 1)))
(if sclist
(foreach
i sclist
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "SC" i i 1 1 1)))
(if allist
(foreach
i allist
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "AL" i i 1 1 1)))
(if sllist
(foreach
i sllist
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "AL" i i 1 1 1)))
(if otlist
(foreach
i otlist
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "OT" i i 1 1 1)))
(if fd1list
(foreach
i fd1list
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "FD1" i i 1 1 1)))
(if fd2list
(foreach
i fd2list
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "FD2" i i 1 1 1)))
(if fd3list
(foreach
i fd3list
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "FD3" i i 1 1 1)))
(if fd4list
(foreach
i fd4list
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "FD4" i i 1 1 1)))
;;; Propogate DoorWinAssembly ;
(setq llist (kb:getlocalObjectList "AEC_WINDOW_ASSEMBLY_STYLES"))
(foreach
x llist
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "DoorWinAss" x x 2 2 2))
;;; Propogate Walls ;
(setq llist (kb:getlocalObjectList "AEC_WALL_STYLES"))
(foreach
x llist
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "wall" x x 0 0 0))
;;; Propogate CurtainWalls ;
(setq llist (kb:getlocalObjectList "AEC_CURTAIN_WALL_LAYOUT_STYLES"))
(foreach
x llist
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "curtain" x x 4 4 4))
;;; Propogate Windows ;
(setq llist (kb:getlocalObjectList "AEC_WINDOW_STYLES"))
(foreach
x llist
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "window" x x 3 3 3))
;;; Propogate Spaces ;
(setq llist (kb:getlocalObjectList "AEC_SPACE_STYLES"))
(foreach
x llist
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "space" x 5 5 5))
;;; Propogate Stairs ;
(setq llist (kb:getlocalObjectList "AEC_STAIR_STYLES"))
(foreach
x llist
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "stair" x x 6 6 6))
;;; Propogate Railings ;
(setq llist (kb:getlocalObjectList "AEC_RAILING_STYLES"))
(foreach
x llist
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "rail" x x 7 7 7))
;;; Propogate Roof ;
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "roof" "standard" 8 8 8)
(setq llist (kb:getlocalObjectList "AEC_ROOF_SLAB_STYLES"))
(foreach
x llist
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "roof" x x 8 8 8))
;;; Propogate Slab ;
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "slab" "standard" 9 9 9)
(setq llist (kb:getlocalObjectList "AEC_SLABE_STYLES"))
(foreach
x llist
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "slab" x x 9 9 9))
;;; Propogate Mass ;
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "mass" "standard" 10 10 10)
(setq llist (kb:getlocalObjectList "AEC_MASS_ELEM_STYLES"))
(foreach
x llist
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "mass" x x 10 10 10))
;;; Propogate Mask Blocks ;
(setq llist (kb:getlocalObjectList "AEC_MASKBLOCK_DEFS"))
(foreach
x llist
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "mbks" x x 14 14 14))
;;; Propogate Schedules ;
(setq llist (kb:getlocalObjectList "AEC_SCHEDULE_TABLE_STYLES"))
(foreach
x llist
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "schd" x x 12 12 12))
;;; Propogate Schedule Tags ;
(setq llist (kb:getlocaltaglist))
(foreach
x llist
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "schdtag" x x 11 11 11))
;;; Propogate Anno Tags ;
(dcl_Tree_AddChild
ADT_ADTPalette_StyleTreeControl
(list (list "tags" "Annotation" "anno" 13 13 13)
(list "tags" "Layout Blocks" "lay" 13 13 13)
(list "tags" "Appliances" "appl" 13 13 13)
(list "tags" "Furniture" "furn" 13 13 13)
(list "tags" "Lighting" "lite" 13 13 13)
(list "tags" "Power" "powr" 13 13 13)
(list "tags" "HVAC" "hvac" 13 13 13)
(list "tags" "Plumbing" "plmb" 13 13 13)
(list "tags" "Fire" "fire" 13 13 13)
(list "tags" "Equipment" "eqmt" 13 13 13)))
(setq llist (kb:GetLocalSymbolBlocks "TAG_*"))
(foreach
x llist
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "anno" x x 13 13 13))
(setq llist (kb:GetLocalSymbolBlocks "LAY_*"))
(foreach
x llist
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "lay" x x 13 13 13))
(setq llist (kb:GetLocalSymbolBlocks "I_APPL*"))
(foreach
x llist
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "appl" x x 13 13 13))
(setq llist (kb:GetLocalSymbolBlocks "I_APPL*"))
(foreach
x llist
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "appl" x x 13 13 13))
(setq llist (kb:GetLocalSymbolBlocks "I_FURN*"))
(foreach
x llist
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "furn" x x 13 13 13))
(setq llist (kb:GetLocalSymbolBlocks "E_LIGHT*"))
(foreach
x llist
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "lite" x x 13 13 13))
(setq llist (kb:GetLocalSymbolBlocks "E_POWER*"))
(foreach
x llist
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "powr" x x 13 13 13))
(setq llist (kb:GetLocalSymbolBlocks "M_HVAC*"))
(foreach
x llist
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "hvac" x x 13 13 13))
(setq llist (kb:GetLocalSymbolBlocks "M_PLUMB*"))
(foreach
x llist
(dcl_Tree_AddChild ADT_ADTPalette_StyleTreeControl "plmb" x x 13 13 13))
(princ)
(princ))
owenwengerd
2014-04-24 15:55 UTC
Ok, that helps narrow it down to the tree control. Next thing to try would be just a normal button (could even be a separate toolbar button) that runs the same code when you press the button, then see if the crash occurs only during OnDocActivated, or also when pressing the button. Also it would be useful if you can determine some pattern to when it crashes vs. when it doesn't.
jbuzbee
2014-04-24 16:05 UTC
I already have a refresh button which calls the OnInitialize event (which is the exact same code as the OnDocActivated event) - will that do?
owenwengerd
2014-04-24 17:25 UTC
Yes, that will work. The idea is to see whether the problem occurs in the same code regardless of context, or whether it only happens during the OnDocActivated context. This is similar to the purpose for testing whether Synchronous vs. Asynchronous had any effect.
jbuzbee
2014-04-24 18:10 UTC
Ok just happened again this time with the OnDocActivated event with just a (princ). The button never caused a crash - I think it's in the event handler.
(defun c:ADT/ADTPalette#OnDocActivated ( / )
;(dcl_Tree_Clear ADT_ADTPalette_StyleTreeControl)
; (kb:Propogate_00_StyleTreeControl)
;(princ)
(princ "OnDocActivated"))
owenwengerd
2014-04-24 18:29 UTC
Notice any patterns? Activating drawings a certain way? Windows maximized? Clicking the mouse vs. typing commands?
jbuzbee
2014-04-24 18:48 UTC
Windows maximized, activating drawings from the "Switch Windows" pull-down on the ribbon, and quite often when opening a drawing from the Project Navigator another window will pop-up over AutoCAD like Microsoft Outlook.
Closing a drawing with the "x"
owenwengerd
2014-04-24 19:34 UTC
So just to clarify: have you seen it crash when closing drawings *and* when switching drawings? Does it crash only when switching drawings via ribbon, or also when switching drawings in other ways? It might be useful to analyze a screen shot when it crashes, along with an explanation of the exact steps that lead up to it. Your goal is to figure out how to reproduce it reliably enough that I can reproduce it here.
jbuzbee
2014-04-24 20:26 UTC
Ok this happens fairly consistently: more than 4 drawings opened, closing a drawing with the "x" boom
The fatal error only happens on close with the "x"
owenwengerd
2014-04-25 00:08 UTC
I've attached a test project. See if you can reproduce the crash with the test project. Just (vl-load-all "DocActivatedCrash") to get started.
jbuzbee
2014-04-28 16:29 UTC
I can't get a fatal error DocActivatedCrash
owenwengerd
2014-04-28 16:35 UTC
Apparently there is something else needed. I'd sure like to get his figured out. Please keep me posted.
owenwengerd
2014-04-28 16:37 UTC
Are you calling (command) anywhere in your code? If so, see if anything changes after you switch to (command-s).
jbuzbee
2014-04-28 17:15 UTC
(command) - no. I'm still on 2010
jbuzbee
2014-04-29 12:44 UTC
Owen, still random fatal errors on closing one of multiple drawings opened. Sorry - nothing new.
jbuzbee
2014-04-30 15:56 UTC
Don't know if this matters but the fatal error seems to happen when 6 or more drawings are opened. 2 or 3 drawings no problem.
owenwengerd
2014-04-30 16:14 UTC
That's certainly worth noting, but I'm not able to reproduce it even with 10 drawings open. I hope you can figure out what the other missing ingredients are.
jbuzbee
2014-05-08 14:34 UTC
Well I've been using this routine with the OnDocActivated call-back only with (princ) with no fatal errors. So that means there is a problem with:
(defun c:ADT/ADTPalette#OnDocActivated ( / )
(dcl_Tree_Clear ADT_ADTPalette_StyleTreeControl)
(kb:Propogate_00_StyleTreeControl)
(princ)
)
?
owenwengerd
2014-05-08 14:58 UTC
I would start adding things one small piece at a time until the error returns, then back up and keep adding smaller chunks until the error returns again, and so on until hopefully you've narrowed it down to a specific line of code.
jbuzbee
2014-05-08 15:18 UTC
Got it - I'm on it
jbuzbee
2014-05-21 16:47 UTC
Well I'm on another system (the other was temp) and everything seems to be operating fine. Windows 8, AutoCAD 2014, Dell Server
owenwengerd
2014-05-21 17:05 UTC
Thanks for following up. So far there haven't been any other similar reports, so maybe it was just a hiccup in that particular setup. Please let us know if you see the error crop up again.
jbuzbee
2014-09-12 18:24 UTC
Well I've found the culprit but it's a pretty intense routine: a Block Manager. See attached
Thanks, jb
owenwengerd
2014-09-13 03:40 UTC
What is the relationship of this code with the call to (dcl_Tree-Clear) in your OnDocActivated event? In any case, I'd like to have a stripped down sample, ideally at a bare minimum so that removing anything at all makes the problem go away. At the very least, I need all registry access removed so I can test on my development system. Also, it wouldn't hurt to reiterate the exact steps I need to perform in order to reproduce the fatal error.
jbuzbee
2014-09-15 12:23 UTC
Attached is a stripped down version - Thanks for any help
owenwengerd
2014-09-15 14:32 UTC
What are the steps to reproduce the crash? I have a feeling your issue is related to
{2}.
jbuzbee
2014-09-16 12:06 UTC
Yes that sounds very similar. With the kbBlockManager docked on the left side of the screen, open several drawings. Upon closing the drawings, usually with the first one - but not always - fatal error.
command "kbBlockManager"
AutoCAD 2015 Win 8 64 bit
jb
owenwengerd
2014-09-16 17:07 UTC
I've made some changes for the next build of OpenDCL that I think will fix this crash issue. I don't have a timetable yet, but please test and report back when the next build is released.
jbuzbee
2014-09-16 18:50 UTC
Thank you Owen - will do!
jb
jbuzbee
2014-09-18 18:08 UTC
8.0.0.8 same problem
jbuzbee
2015-02-12 20:11 UTC
Well I decided to fix the problem by moving from a palette form (always opened) to a modeless form. The modeless form is closed at the end of several operations so there is no possibility of the fatal error when documents are opened and closed. Works for me.
jb