100% repro -- AnalysIR null dereference

Post Reply
HenryGab
Posts: 5
Joined: Thu Aug 20, 2015 4:20 pm

100% repro -- AnalysIR null dereference

Post 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.
You do not have the required permissions to view the files attached to this post.

HenryGab
Posts: 5
Joined: Thu Aug 20, 2015 4:20 pm

Re: 100% repro -- AnalysIR null dereference

Post by HenryGab »

08_AfterClearedErrorBox.PNG
You do not have the required permissions to view the files attached to this post.

User avatar
AnalysIR
Site Admin
Posts: 656
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: 100% repro -- AnalysIR null dereference

Post 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.

User avatar
AnalysIR
Site Admin
Posts: 656
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: 100% repro -- AnalysIR null dereference

Post 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.

HenryGab
Posts: 5
Joined: Thu Aug 20, 2015 4:20 pm

Re: 100% repro -- AnalysIR null dereference

Post 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!

User avatar
AnalysIR
Site Admin
Posts: 656
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: 100% repro -- AnalysIR null dereference

Post 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.

Post Reply