Page 1 of 1

100% repro -- AnalysIR null dereference

Posted: Fri Jan 29, 2021 11:12 pm
by HenryGab
This is a 100% reproducible bug. If the below is insufficient to

Bug Title:
Null reference exception & silent change of device type

Steps to Repro:
00 - Using AnalysIR version 1.16.100.8137
01 - Capture a signal from the LearnIR (v1 hardware, Rev. E board)
02 - Give the signal a name, here "A"
03 - Capture the same signal again; Note automatic name "A"
04 - Rename the second capture, here "B"
05 - Capture the same signal again; Note automatic name "B"
06 - Remove the name given to this third capture
07 - Capture the same signal again

Expected Results:
A. Signal is captured again, no errors.
B. Name is left blank because that's the most recent match in history.
C. Capture Device remains as configured.

Actual Results:
A. Signal is captured, but a "soft" modal error box appears

Code: Select all

AnalysIR - error reading from device
Object reference not set to an instance of an object
B. The signal does properly have a blank name.
C. After clicking "OK" to clear the error box, the source device silently changes from "LearnIR" to "Arduino" ... causing it to seem like there are other bugs until this oddity is noticed.

Re: 100% repro -- AnalysIR null dereference

Posted: Fri Jan 29, 2021 11:18 pm
by HenryGab
08_AfterClearedErrorBox.PNG

Re: 100% repro -- AnalysIR null dereference

Posted: Sat Jan 30, 2021 4:11 pm
by AnalysIR
Hi Henry

Sure is an unusual use case, which was never considered until now...renaming the same signal & then un-naming it etc :)

I tried it with another source device and the same thing happened.

I will send some time over the next few days tracking it down. (I suspect it will be easy to resolve).


The reason the source device changes is because this error forces the serialUSB to be closed/re-opened & this always resets the Source to default of Arduino. So in summary everything is working to plan....except the initial null exception.

Thanks again for the detailed report.

Re: 100% repro -- AnalysIR null dereference

Posted: Sat Jan 30, 2021 4:30 pm
by AnalysIR
UPDATE:
It proved pretty straightforward to resolve.

We will include the fix in a future AnalysIR application update.

In the meantime the following workaround should do:

When this error is encountered, type a 'space' character into the Button column, instead of totally deleting the contents. Alternatively, give the signal a real name.

Re: 100% repro -- AnalysIR null dereference

Posted: Tue Feb 02, 2021 9:16 pm
by HenryGab
Great, thanks for the review and committing to a fix in next version.

If possible, it'd be great (if not technically difficult) to avoid resetting the device type away from the user-configured device type. I can't tell you how many times I've scratched my head, wondering what I was doing wrong, only to find the device type got reset. It's been a lot. (Then again, maybe I'm just a slow learner, and should know better by now.)

BTW, is there a place I should be looking for the lastest version?

The version I have includes a couple custom fixes, from a couple years back. I'm currently working hard to avoid reimaging my machine, as I no longer have the installer for the version with these additional fixes, and don't see a download for the version I have (or later).

Note: I'm on 1.16.100.8137, while latest official download I can find is for 8109.

Thanks again for taking the look!

Re: 100% repro -- AnalysIR null dereference

Posted: Tue Feb 02, 2021 10:37 pm
by AnalysIR
If possible, it'd be great (if not technically difficult) to avoid resetting the device type away from the user-configured device type. I can't tell you how many times I've scratched my head, wondering what I was doing wrong, only to find the device type got reset. It's been a lot. (Then again, maybe I'm just a slow learner, and should know better by now.)
It is designed to work this way because we support a large number of devices and some of them behave erratically in error conditions. So the best option for us is to reset to a known default of an Arduino device, when an error condition occurs. Sorry - this is unlikely to change.
BTW, is there a place I should be looking for the latest version?
There is an option under the help menu to check for updates. It will tell you the latest version & the latest 'DEV' version. You can request the dev version via email. (Older dev releases are remove from download when updated)

The latest dev version is ...8303. I will email that to you shortly.