BlockView - Fatal Error

Started by jb, May 30, 2008, 12:33:11 PM

Previous topic - Next topic

jb

4.1.2.2
AutoCAD Architecture 2009
WinXP Pro (32)

Load the 012-odcl.lsp into two(2) opened drawings. Call the command "test".  A modeless form appears with a list of the active documents blocks and a blockView control.  Select one of the blocks to display in the Blockview.  No close out of that drawing.  I get a Fatal Error.

???
James Buzbee
Managing Memeber
Black Horse Development, LLC

owenwengerd

The BlockView code is pretty bad and needs a major rewrite. I have fixed this particular issue for Alpha 17, but I wouldn't be surprised if there are other scenarios that result in the same crash.

jb

That's ashame, one of the nicest features of OpenDCL . . ..

Any work-arounds??
James Buzbee
Managing Memeber
Black Horse Development, LLC

owenwengerd

Quote from: jb on May 31, 2008, 07:14:22 AM
Any work-arounds??

Nothing that I can think of off the top of my head.

jb

The following seems to work - I'll keep testing throughout the day . . ..


(vl-load-com)
;;; BeginClose ;
(defun jb:BeginClose(calling-reactor event / )
   (if (dcl_Form_IsActive jb006_00)
    (dcl_BlockView_Clear jb006_00_BlockView1))
(if (dcl_Form_IsActive jb003_00)
    (progn(dcl_BlockView_Clear jb003_00_DwgView)
      (dcl_BlockView_Clear jb003_00_BlockView)
      )
  )
   (if (dcl_Form_IsActive jb004_00)
    (dcl_BlockView_Clear jb004_00_BlockView))
   (princ)
   )

;;; Construct the BeginClose Reactor ;
(defun jb::ConstructBeginCloseReactor  (/)
  (if (= (type *jbBeginCloseReactor*) 'VLR-Dwg-Reactor)
    (progn (vlr-remove *jbBeginCloseReactor*) (setq *jbBeginCloseReactor* nil)))
  (if (/= (type *jbBeginCloseReactor*) 'VLR-Dwg-Reactor)
    (setq *jbBeginCloseReactor*
           (VLR-Dwg-Reactor
             "jbTools Begin Close Event Reactor" ; Data associated with the editor reactor
             ;; call backs
             '
              ((:vlr-beginClose . jb:BeginClose)
               )) ;_ end of vlr-editor-reactor
          ))

  (if (not (vlr-added-p *jbBeginCloseReactor*))
    (progn
    (vlr-add *jbBeginCloseReactor*)
    (vlr-set-notification *jbBeginCloseReactor* 'active-document-only)));added 09.26.2003
  (princ))


;;; load reactors ;

(if jb::ConstructBeginCloseReactor
  (jb::ConstructBeginCloseReactor))

James Buzbee
Managing Memeber
Black Horse Development, LLC

mr nick

I know this is reviving a very old thread but I'm having a problem with the blockview control.

I wrote a routine a few years back and it's worked without a hitch up until I ran it on a machine running AutoCAD 2012 on Win7 x64. All of a sudden I started getting fatal errors when closing the drawing or when opening a new tab. It took me a while to track the source but I found it was triggered when the dialog showed the blockview. If I commented that line out I got no crashes.

I then created a simple dialog with nothing more than a blockview and a close button. I then used this in a drawing with just one block and sure enough I get the same fatal errors.

I haven't seen any other mention of this problem other than this post so I'm not sure whether it's still considered to be a bit of an iffy control or whether it has been tidied up and no longer problematic.

Can anybody confirm whether or not there are any known issues with the blockview control and specifically on x64 2012?

owenwengerd

It is still open (see here: http://sourceforge.net/tracker/?func=detail&aid=3432079&group_id=187950&atid=923363), but I could not reproduce it. I'll have another look. Do you have sample code as well to reproduce the problem?

mr nick

#7
This is the simple dialog I created to check it wasn't something in my larger routine that triggered the crash. This is just a simple dialog that displays a block found in a drawing with a button that then closes the dialog. Once the dialog has been displayed, open a new drawing and 9 times out of 10 I get a fatal error immediately. Sometimes it may take 2-3 new sheets before a crash. If the dialog is opened and closed more than once and then a new sheet is opened I am pretty much guaranteed a fatal error.

Please note that this error ONLY exists as far as I can see on 64bit AutoCAD 2012. The same (original) routine has run for a few years without a problem on AutoCAD 2010, 2011 and 2012 on the 32 bit platform and also runs on 2011 64bit. I note that on the bugtracker page that you (Owen) said "I could not reproduce this on Windows 7 x64 using AutoCAD 2011" and that is indeed right as the bug is only recorded as happening on 2012.

Code (autolisp) Select

(defun c:bvt ( / bvdia )
 (setq bvdia
'("YWt6A6wMAAAbjV1wBuLDKDcxKj9ugHgZ3vtPZGy7/ThsTwQObGY4L/EU8vT2Ntyv7m4YP+4fPi9e"
"IJ5YkCAiHIJ30Pelp+2ggn9gQmSp5U8vZ9UE+IkgAW7gVRGMIImpKyOjIyshi1JTMGkvANWsZjtJ"
"MF/5b4c4fsLUfGg11Zz4sxa/aIVIHFXk7z5RBNqT6yA0OMxcNzalVcHiisysyPY43eva7mqiUmzF"
"Ii9TiLbG8Er1ILfcsLCmIDQYWxtCX0QXl0mki0j3CGgzTOxqw1jP4OvvVhSq1pDGJAkleW0/e7Tx"
"9hzFTvrtZmq1mHsUGVobaw0uUnpgTR8zp5nTkqqqhIbYirItYSWDufrhbgA6hsXB4HSyJyoH5auL"
"qETl8ZDo85Wxwgq4H0iGCNHU42HW4k8Vm8ljwkT9Ew4donOhT6MWOX9Futt7DxNwB5eZO0RcA000"
"6OFdaEZ+shXs8UcGq9HSwjmgAO+KtXCMjEPdlSg4IsWhFuMPaaVKJl/WOPns4nirpZP3TGa+Xydf"
"+U8338ds3Hy4dah6e5F6e1+Ux9xqsgghwSDtm39bqT28q+py/xplKAKkyRGL0a2Cm8DAEKRijo/q"
"nCVKwf2K0e/DiQrAC9rBQe4KBMAojLFAvBP6iWyY2iAxgHZah9qcRtu+bLxPNOeFWsE1hmCfRV/X"
"AOaa6XbhXQL/jge8OXZhW6I7ht2Z0WzgiIJrz4CEmh3FoXEgD1efeOSBp43RE1P7aDdZ0Bad0jTk"
"aPRo+s7T37p3bp/VnDS5LvtLT3FHkh/mYnu5OMJz49bpybGo1cKKCbSJ5j3cBMbazwi8Nr1a5/lq"
"7Q43z4wh7nxvCcEBOexLH4upcZSyU95rJpXaIMmB4ywHNKd/vP0A9ACvhQ/2mrl3TZto/EwLVoGH"
"NrPEC0TTSYvxtGGjRJGKtv8lOKv9mpQtYih7xxT4b/E9sl+b7g3258ZijH4/uU95P9m2IOROKZ9+"
"3+m/W4raHNDUIgsRbsA8hgw2q8GG5SvhEfdwpEEpg87qm2qZ/DtXZeSc/3yJchD/Bf37w4v5tZMx"
"HbbMLw==")
 )
 (dcl_project_import bvdia nil nil)
 (dcl_Form_Show bv_test_Form3)
 (dcl_Project_Unload "bv_test" t)
 (princ)
)
;;-----------------------------------------------------------------------------
(defun c:bv_test_Form3_OnInitialize ( / bloks indblok )
 (setq bloks (ssget "x" '((0 . "INSERT"))))
 (if bloks
   (progn
     (setq indblok (cdr (assoc 2 (entget (ssname bloks 0)))))
     (dcl_BlockView_DisplayBlock bv_test_Form3_BlockView1 indblok 0 0.9)
   )
   (alert "No blocks found")
 )
)
;;-----------------------------------------------------------------------------
(defun c:bv_test_Form3_btnOK_OnClicked (/)
 (dcl_BlockView_Clear bv_test_Form3_BlockView1)
 (dcl_Form_Close bv_test_Form3)
)
;;-----------------------------------------------------------------------------

owenwengerd

Please test this in alpha 4 and let me know whether you still notice the crash.

mr nick

Quote from: owenwengerd on March 28, 2012, 01:30:48 PM
Please test this in alpha 4 and let me know whether you still notice the crash.

Looking good so far. Tried multiple times and no crashes so far.

One point of note, when I install the 7.0.0.4 studio, Avast anti-virus flags the 2013 64bit arx as malicious. All the others get installed but this one always gets binned. Not a problem as of yet but thought it may be worth mentioning.

Oh and thanks for the quick fix - very much appreciated.