Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Valued Contributor
FT398
Posts: 94
Registered: ‎03-09-2003
Message 1 of 14 (270 Views)

Reactor triggers fatal error

270 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?

Distinguished Mentor
Moshe-A
Posts: 784
Registered: ‎09-14-2003
Message 2 of 14 (260 Views)

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

 

 

 

Valued Contributor
FT398
Posts: 94
Registered: ‎03-09-2003
Message 3 of 14 (257 Views)

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.

Distinguished Mentor
Moshe-A
Posts: 784
Registered: ‎09-14-2003
Message 4 of 14 (255 Views)

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?

Distinguished Mentor
Moshe-A
Posts: 784
Registered: ‎09-14-2003
Message 5 of 14 (253 Views)

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?

Valued Contributor
FT398
Posts: 94
Registered: ‎03-09-2003
Message 6 of 14 (253 Views)

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.

Distinguished Mentor
Moshe-A
Posts: 784
Registered: ‎09-14-2003
Message 7 of 14 (244 Views)

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

 

*Expert Elite*
dbroad
Posts: 1,625
Registered: ‎08-16-2007
Message 8 of 14 (227 Views)

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 ?

Valued Contributor
FT398
Posts: 94
Registered: ‎03-09-2003
Message 9 of 14 (212 Views)

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.

Valued Contributor
FT398
Posts: 94
Registered: ‎03-09-2003
Message 10 of 14 (187 Views)

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.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!