• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Visual LISP, AutoLISP and General Customization

    Reply
    Valued Contributor
    Posts: 75
    Registered: ‎03-09-2003

    Reactor triggers fatal error

    193 Views, 13 Replies
    06-15-2012 03:28 AM

    OK, I'm fairly new to the world of reactors and have run into a problem which I'm hoping somebody can help me with.

     

    I have created a very basic reactor as a test. As you can see, it doesn't actually do anything other than set a variable so I know the error isn't caused by something I'm doing with the reactor.

     

    (defun np:test (reactor callbackdata / )
      (setq abc 123)
    )
    (if (not np:reactor1) 
      (setq np:reactor1 
        (vlr-command-reactor nil '((:vlr-commandwillstart . np:test)))
      )
    )

     

     

    OK, so the problem I have found is that if I load this reactor into a drawing and then use the MVSETUP command but escape out without completing the command, AutoCAD throws an error and becomes unusable. When I then close AutoCAD down I am met with multiple unhandled exception errors before the app finally closes.

     

    I then altered the reactor from a vlr-command-reactor to a vlr-editor-reactor and found that with this, I am no longer met with the same error while escaping out of MVSETUP. However, when I close CAD down I am eventually left with an 'AutoCAD Application has stopped working' error dialog on screen which reports that acad.exe as crashed.

     

    I am working on AutoCAD Architecture 2012 (although I have tried it on 2013 to with the same results) on Windows 7 64bit. I have also tried this on ACA2012 x32 and found the same error exists.

     

    Is there anybody out there who can confirm whether they get the same errors as me or whether I am doing something fundamentally wrong in the way I am handling reactors?

    Please use plain text.
    Distinguished Mentor
    Moshe-A
    Posts: 679
    Registered: ‎09-14-2003

    Re: Reactor triggers fatal error

    06-15-2012 07:48 AM in reply to: FT398

    Hi,

     

     (defun np:test (reactor callbackdata / )
      (setq abc 123)
    )
    (if (not np:reactor1)
      (setq np:reactor1
        (vlr-command-reactor nil '((:vlr-commandwillstart . np:test)))
      )

     

     the only thing i found that might be a problem is the extra slash (in red)

    otherwise it is working good

     

    Moshe

     

     

     

    Please use plain text.
    Valued Contributor
    Posts: 75
    Registered: ‎03-09-2003

    Re: Reactor triggers fatal error

    06-15-2012 07:55 AM in reply to: FT398

    Still crashes without - and that slash would normally be needed to clear out any localised variables in your reactor code. It's just that my example doesn't have any local variables in it for simplicity.

    Please use plain text.
    Distinguished Mentor
    Moshe-A
    Posts: 679
    Registered: ‎09-14-2003

    Re: Reactor triggers fatal error

    06-15-2012 08:01 AM in reply to: FT398

    Just to make sure...have you got other lisp files/programs that define more reactors?

    Please use plain text.
    Distinguished Mentor
    Moshe-A
    Posts: 679
    Registered: ‎09-14-2003

    Re: Reactor triggers fatal error

    06-15-2012 08:03 AM in reply to: FT398

    does the error occur also with other commans beside MVSETUP?

    Please use plain text.
    Valued Contributor
    Posts: 75
    Registered: ‎03-09-2003

    Re: Reactor triggers fatal error

    06-15-2012 08:04 AM in reply to: Moshe-A

    I certainly have none of my own reactors. I have even tried a clean out-of-the-box install and tried this directly after install and still get the crash.

     

    MVSETUP is the only command I have found that causes the error. A bit of testing has shown some odd behaviour with it. If I make a CommandCancelled reactor, this flags when I cancel any command EXCEPT when I cancel MVSETUP and this just seems to close quietly without triggering the reactor.

    Please use plain text.
    Distinguished Mentor
    Moshe-A
    Posts: 679
    Registered: ‎09-14-2003

    Re: Reactor triggers fatal error

    06-15-2012 08:29 AM in reply to: FT398

    sounds like a problem in MVSETUP on R2012

    your code is good

     

    Please use plain text.
    *Expert Elite*
    Posts: 848
    Registered: ‎08-16-2007

    Re: Reactor triggers fatal error

    06-15-2012 12:02 PM in reply to: FT398

    I can confirm that mvsetup triggers a fatal error if a command reactor with a :vlr-commandwillstart event is active.

     

    Sounds like a bug. Have you reported it at autodesk.com/submitbug ?

    Please use plain text.
    Valued Contributor
    Posts: 75
    Registered: ‎03-09-2003

    Re: Reactor triggers fatal error

    06-15-2012 08:18 PM in reply to: dbroad

    I hadn't reported it yet as I wanted to make sure other people could replicate it and also that it wasn't down to me doing something wrong. I'll report the bug now and see if anything comes of it. In the meantime I need to find a way around this because while there are any CommandWillStart reactors loaded, it means that MVSETUP will always trigger this error.

    Please use plain text.
    Valued Contributor
    Posts: 75
    Registered: ‎03-09-2003

    Re: Reactor triggers fatal error

    06-18-2012 06:54 AM in reply to: FT398

    Seems that the EDGE command also triggers the same fatal error. Interestingly, both of these routines are old legacy lisp routines so at least I may be able to pinpoint the trigger point within the files.

    Please use plain text.