Commit 4cecdff
Protect against multiple calls to JLINKARM_Close (#65)
* Protect against multiple calls to JLINKARM_Close
With the latest JLink DLLs (tested with 6.56b), calling jlink.close()
twice can crash. This is a problem because there is an uncoditional call
to close() inside jlink.open(). Any code that attempts to cycle a jlink
connection by calling .close() followed by .open() therefore hits a
double close and the corresponding crash.
Crash from inside JLINKARM_Close looks like:
`double free or corruption (out)`
* Indentation
* Reference counting .open() calls
* Explicitly set the refcount in test
* Remove blank lines to placate pycodestyle
* Test setup ensures .open() called in context manager1 parent b754a48 commit 4cecdff
2 files changed
+34
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
278 | 282 | | |
279 | 283 | | |
280 | 284 | | |
| |||
639 | 643 | | |
640 | 644 | | |
641 | 645 | | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
642 | 649 | | |
643 | 650 | | |
644 | 651 | | |
| |||
692 | 699 | | |
693 | 700 | | |
694 | 701 | | |
| 702 | + | |
695 | 703 | | |
696 | 704 | | |
697 | 705 | | |
| |||
719 | 727 | | |
720 | 728 | | |
721 | 729 | | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
722 | 738 | | |
723 | 739 | | |
724 | 740 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
818 | 818 | | |
819 | 819 | | |
820 | 820 | | |
821 | | - | |
822 | | - | |
| 821 | + | |
823 | 822 | | |
824 | 823 | | |
825 | 824 | | |
| |||
922 | 921 | | |
923 | 922 | | |
924 | 923 | | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
925 | 936 | | |
926 | 937 | | |
| 938 | + | |
927 | 939 | | |
928 | 940 | | |
929 | 941 | | |
| |||
934 | 946 | | |
935 | 947 | | |
936 | 948 | | |
937 | | - | |
938 | | - | |
939 | | - | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
940 | 952 | | |
| 953 | + | |
941 | 954 | | |
942 | 955 | | |
943 | 956 | | |
| |||
0 commit comments