[v1.1.36.0] Invalid memory read/write with switch Topic is solved

Report problems with documented functionality
User avatar
RaptorX
Posts: 378
Joined: 06 Dec 2014, 14:27
Contact:

[v1.1.36.0] Invalid memory read/write with switch

Post by RaptorX » 01 Dec 2022, 15:08

I have been having this error come up very often on v1.1.36.0
1.1.36.00 32bit
5
Critical Error: Invalid memory read/write.

Line#
306: Return,Trim(data, "
")
307: }
310: {
313: Gui,main:Default
314: Gui,Submit,NoHide
316: sci.SetText(false, "")
318: preview := HrefLink.Convert(source ? source : HrefType)
---> 320: Switch preview
321: {
322: Case ERRNONHTML:
323: MsgBox,"The script couldnt access the HTML clipboard on this computer."
324: Return,false
325: Case ERRNONLINKS:
326: MsgBox,"The text selected doesnt contain HTML."
327: Return,false

The program is now unstable and will exit.
I cant reproduce exactly when this would be triggered but is really frequent at the moment.

EDIT:

well, there seem to be a type mismatch between my variable and the switch case value:
image.png
image.png (36.28 KiB) Viewed 975 times
The interesting thing is that my function actually returns a variable that contains a number, so im not sure why the preview variable is set as a string.
image.png
image.png (2.74 KiB) Viewed 975 times
Projects:
AHK-ToolKit

User avatar
mikeyww
Posts: 26851
Joined: 09 Sep 2014, 18:38

Re: [v1.1.36.0] Invalid memory read/write with switch

Post by mikeyww » 01 Dec 2022, 21:16

Same here. I was just copying the code to paste it here, when the error occurred again. It's back to 1.1.35.00, build number "ASAP"!

Code: Select all

clipChanged(type := "") {
 Global
 If !clipFile || clipsProcessing || clipText || !clipStarted
  Return
 ; tip2("clipsB = " clipsB)
 Switch clipsB {
  Case False: Gosub, ClipsInsert ; Clipboard source is not listview, so insert text into listview
  Case True : Gosub, ClipsPaste  ; Clipboard source is listview, so paste the text
 }
 clipsB := False
}
image221201-2115-001_cr.png
Error message
image221201-2115-001_cr.png (101.21 KiB) Viewed 912 times

Code: Select all

Operating system           : Microsoft Windows 10 Pro
OS version                 : 10.0.19044
PC model                   : ASUS EXPERTBOOK B9400CEAV_B9450CEA
CPU                        : Intel64 Family 6 Model 140 Stepping 1
OS bitness                 : 64
CPU bitness                : 64
BIOS manufacturer          : ASUSTeK COMPUTER INC.
BIOS name                  : B9400CEAV.308
Motherboard manufacturer   : ASUSTeK COMPUTER INC.
Motherboard product        : B9400CEAV
Motherboard version        : 1.0       
Display                    : Citrix Indirect Display Adapter
Display width              : 1920
Display height             : 1080
DPI                        : 96
AHK version                : 1.1.36.00

User avatar
JoeWinograd
Posts: 2198
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: [v1.1.36.0] Invalid memory read/write with switch

Post by JoeWinograd » 01 Dec 2022, 22:39

Raptor and Mikey,

Does this also NOT happen with the 32-bit version, as Raptor discovered at my bug report:

viewtopic.php?f=14&t=111067

Regards, Joe

User avatar
mikeyww
Posts: 26851
Joined: 09 Sep 2014, 18:38

Re: [v1.1.36.0] Invalid memory read/write with switch

Post by mikeyww » 01 Dec 2022, 22:43

Sorry, Joe, I already pulled the plug! I will assume that you are correct, and await the next round. Thanks for your coordination surrounding this issue.

lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: [v1.1.36.0] Invalid memory read/write with switch  Topic is solved

Post by lexikos » 02 Dec 2022, 04:32

This has the same cause as Switch bug introduced in 1.1.36, fixed by v1.1.36.01.

Post Reply

Return to “Bug Reports”