Jump to content


Photo

AHK_L Crashing


  • Please log in to reply
12 replies to this topic

#1 crazyace

crazyace
  • Members
  • 155 posts

Posted 18 May 2012 - 04:33 PM

I have been working on a project now for about 9 months. From time to time, we get users that have AHK_L crash no matter what. Here is the info that we get from the crash.

<?xml version="1.0" encoding="UTF-16"?>
<DATABASE>
<EXE NAME="AutoHotkey.exe" FILTER="GRABMI_FILTER_PRIVACY">
    <MATCHING_FILE NAME="AU3_Spy.exe" SIZE="14368" CHECKSUM="0x392EA871" BIN_FILE_VERSION="1.0.3.0" BIN_PRODUCT_VERSION="1.0.3.0" PRODUCT_VERSION="1.0" FILE_DESCRIPTION="AutoIt3 Window Info Spy" COMPANY_NAME="DaloozaSoft" PRODUCT_NAME="AU3_Spy" FILE_VERSION="1.0" ORIGINAL_FILENAME="AU3_Spy.exe" INTERNAL_NAME="AU3_Spy" LEGAL_COPYRIGHT="Copyright © 2003 DaloozaSoft" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="1.0.3.0" UPTO_BIN_PRODUCT_VERSION="1.0.3.0" LINK_DATE="01/29/2006 23:28:34" UPTO_LINK_DATE="01/29/2006 23:28:34" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="AutoHotkey.exe" SIZE="890880" CHECKSUM="0x4649615E" BIN_FILE_VERSION="1.1.7.3" BIN_PRODUCT_VERSION="1.1.7.3" PRODUCT_VERSION="1.1.07.03" FILE_DESCRIPTION="AutoHotkey_L" PRODUCT_NAME="AutoHotkey_L" FILE_VERSION="1.1.07.03" ORIGINAL_FILENAME="AutoHotkey.exe" INTERNAL_NAME="AutoHotkey_L" LEGAL_COPYRIGHT="Copyright (C) 2010" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0xDA288" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="1.1.7.3" UPTO_BIN_PRODUCT_VERSION="1.1.7.3" LINK_DATE="03/25/2012 03:03:02" UPTO_LINK_DATE="03/25/2012 03:03:02" VER_LANGUAGE="English (United States) [0x409]" />
    <MATCHING_FILE NAME="uninst.exe" SIZE="51678" CHECKSUM="0x26055BA8" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x60000" LINK_DATE="12/05/2009 22:50:46" UPTO_LINK_DATE="12/05/2009 22:50:46" />
    <MATCHING_FILE NAME="Compiler\Ahk2Exe.exe" SIZE="832512" CHECKSUM="0x67159D3C" BIN_FILE_VERSION="1.1.7.3" BIN_PRODUCT_VERSION="1.1.7.3" PRODUCT_VERSION="1.1.07.03" FILE_DESCRIPTION="" PRODUCT_NAME="" FILE_VERSION="1.1.07.03" ORIGINAL_FILENAME="" INTERNAL_NAME="" LEGAL_COPYRIGHT="" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="1.1.7.3" UPTO_BIN_PRODUCT_VERSION="1.1.7.3" LINK_DATE="03/25/2012 03:03:16" UPTO_LINK_DATE="03/25/2012 03:03:16" VER_LANGUAGE="English (United States) [0x409]" />
</EXE>
<EXE NAME="kernel32.dll" FILTER="GRABMI_FILTER_THISFILEONLY">
    <MATCHING_FILE NAME="kernel32.dll" SIZE="989696" CHECKSUM="0x2D998938" BIN_FILE_VERSION="5.1.2600.5781" BIN_PRODUCT_VERSION="5.1.2600.5781" PRODUCT_VERSION="5.1.2600.5781" FILE_DESCRIPTION="Windows NT BASE API Client DLL" COMPANY_NAME="Microsoft Corporation" PRODUCT_NAME="Microsoft® Windows® Operating System" FILE_VERSION="5.1.2600.5781 (xpsp_sp3_gdr.090321-1317)" ORIGINAL_FILENAME="kernel32" INTERNAL_NAME="kernel32" LEGAL_COPYRIGHT="© Microsoft Corporation. All rights reserved." VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0xFE572" LINKER_VERSION="0x50001" UPTO_BIN_FILE_VERSION="5.1.2600.5781" UPTO_BIN_PRODUCT_VERSION="5.1.2600.5781" LINK_DATE="03/21/2009 14:06:58" UPTO_LINK_DATE="03/21/2009 14:06:58" VER_LANGUAGE="English (United States) [0x409]" />
</EXE>
</DATABASE>

If anyone could help us understand why this is crashing that would be fantastic.

#2 engunneer

engunneer
  • Fellows
  • 9162 posts

Posted 18 May 2012 - 04:47 PM

hi. We're going to need more info about your code, environment, and AHK_L version.

at what time does it crash? as soon as it is opened?

Is it the same between compiled and uncompiled?

#3 crazyace

crazyace
  • Members
  • 155 posts

Posted 18 May 2012 - 04:56 PM

hi. We're going to need more info about your code, environment, and AHK_L version.

at what time does it crash? as soon as it is opened?

Is it the same between compiled and uncompiled?


The OS is Windows XP 32 bit SP3.

AHK_L version: 1.1.7.3

Anytime that the script is called it will cause AHK_L to crash. If the user reboots the computer sometimes the issue will go away and sometimes it will not.

I uploaded our full project. What crashes is the Emails - Agent.ahk file

#4 crazyace

crazyace
  • Members
  • 155 posts

Posted 21 May 2012 - 04:14 AM

Anyone else want to take a stab at this?

#5 sinkfaze

sinkfaze
  • Moderators
  • 6089 posts

Posted 21 May 2012 - 02:44 PM

AHK_L version: 1.1.7.3

Is that the 32-bit ANSI, 32-bit Unicode or 64-bit Unicode version?

#6 Thermopyle

Thermopyle
  • Members
  • 135 posts

Posted 22 May 2012 - 12:17 PM

Sinkfaze: Unicode 32bit.

#7 crazyace

crazyace
  • Members
  • 155 posts

Posted 23 May 2012 - 08:30 PM

Anyone have any ideas or how I could supply more info?

#8 sinkfaze

sinkfaze
  • Moderators
  • 6089 posts

Posted 23 May 2012 - 08:35 PM

You say that the script crashes "whenever it is called", but does there tend to be a common hotkey/function that is being called when it crashes?

#9 crazyace

crazyace
  • Members
  • 155 posts

Posted 30 May 2012 - 04:27 PM

You say that the script crashes "whenever it is called", but does there tend to be a common hotkey/function that is being called when it crashes?


When this function is called it will crash. This only happens some times but when it does, it normally requires a reboot of the computer in order to be resolved. This has happened to about 6 different users out of 40 so far. We have no issues on Windows 7 systems.

returnDataSR() {
  
  ControlGetText, url, Edit1, ahk_class IEFrame
  
  For win in ComObjCreate("Shell.Application").Windows
    if   (win.LocationURL = url)
      pwb :=   win
  Until   (win.LocationURL = url)
  pWin :=   pwb   ; passing the pointer to a different var strictly for dealing with the frames
  For each, f in ["_sweclient","_swecontent","_sweview"]
    frame :=   pWin.document.all[f].contentWindow, pWin :=   frame
  Loop %   pWin.document.frames.length   ; should search only the final set of frames where the _svf frame is
    if   InStr(pWin.document.frames.item[A_Index-1].name,"_svf")   ;
    {
      frame :=   pWin.document.all[pWin.document.frames.item[A_Index-1].name].contentWindow
      if frame.document.all["s_1_1_51_0"].getAttribute("value") != ""
      {
        pWin :=   frame
        break
      }
    }
 
  if RegExMatch(pWin.document.all["s_1_1_50_0"].getAttribute("value"), "@")
  {
	global name, LName, Tag, SR, SREmail, Owner, OwnerEmail, OwnerFullName
	name := RegExReplace(RegExReplace(pWin.document.all["s_1_1_51_0"].value, "s)^(\s*)(.)(.*)$", "$1$U2$L3"),  "([^\w.']|\R)([a-z])", "$1$U2") 
	LName := RegExReplace(RegExReplace(pWin.document.all["s_1_1_47_0"].value, "s)^(\s*)(.)(.*)$", "$1$U2$L3"),  "([^\w.']|\R)([a-z])", "$1$U2") 
	if Tag = 
	   Tag := pWin.document.all["s_1_1_46_0"].value
	SR := pWin.document.all["s_1_1_36_0"].value
	SREmail := pWin.document.all["s_1_1_50_0"].value
	
	Owner := RegExReplace(RegExReplace(pWin.document.all["s_1_1_74_0"].value, "s)^(\s*)(.)(.*)$", "$1$U2$L3"),  "([^\w.']|\R)([a-z])", "$1$U2")
	OwnerEmail = %Owner%@dell.com
	OwnerFullName := RegExReplace(Owner, "_", " ")
	StringLower, OwnerFullName, OwnerFullName, T
	delim := Instr(Owner, "_")
	Owner := SubStr(Owner, 1, delim-1)
  }
  else
  {
	msgbox,, Error!, The service request page is not detected!`nIf you are there, please make sure the Email field has a valid email address and then run the script again.
	exitapp
  }
}


#10 sinkfaze

sinkfaze
  • Moderators
  • 6089 posts

Posted 30 May 2012 - 08:21 PM

It could be a side effect of some coding inefficiencies, test this modified code on a safe machine and see if it performs properly:

returnDataSR() {
  
	global	name, LName, Tag, SR, SREmail, Owner, OwnerEmail, OwnerFullName
	static	frameSet :=	["_sweclient","_swecontent","_sweview"]
	 , elementSet :=	{"s_1_1_36_0":"","s_1_1_46_0":"","s_1_1_47_0":"","s_1_1_50_0":"","s_1_1_51_0":"","s_1_1_74_0":""}
	 , regex1 :=	"s)^(\s*)(.)(.*)$", repl1 :=	"$1$U2$L3", regex2 :=	"([^\w.']|\R)([a-z])", repl2 :=	"$1$U2"
	ControlGetText, url, Edit1, ahk_class IEFrame
  
	For win in ComObjCreate("Shell.Application").Windows
	{}	Until	(win.LocationURL = url)

[color=#FF0000]	if   (win.LocationURL <> url)
	{
		MsgBox, 48, Warning, The window could not be located, the script will now exit.
		ExitApp
	}[/color]
	pWin :=   win	[color=#00BF00]; passing the pointer to a different var strictly for dealing with the frames[/color]

	For each, f in frameSet
		frame :=	pWin.document.all[f].contentWindow, pWin :=   frame

	Loop %	pWin.document.frames.length		[color=#00BF00]; should search only the final set of frames where the _svf frame is[/color]
		if	InStr(pWin.document.frames.item[A_Index-1].name,"_svf")
			frame :=	pWin.document.all[pWin.document.frames.item[A_Index-1].name].contentWindow
	Until	(frame.document.all["s_1_1_51_0"].getAttribute("value") != "")

[color=#FF0000]	if   (frame.document.all["s_1_1_51_0"].getAttribute("value") != "")
	{
		MsgBox, 48, Warning, The "_svf" window frame could not be located, the script will now exit.
		ExitApp
	}[/color]

	pWin :=	frame 

	For elementName, value in elementSet
		elementSet[elementName] :=	pWin.document[elementName].value

	if	InStr(elementSet["s_1_1_50_0"],"@")
	{
		For globalVar, value in {name:elementSet["s_1_1_51_0"],LName:elementSet["s_1_1_47_0"],Owner:elementSet["s_1_1_74_0"]}
			Loop, 2
				%globalVar% :=	RegExReplace((A_Index=1) ? value : %globalVar%,regex%A_Index%,repl%A_Index%)

		Tag :=	!Tag ? elementSet["s_1_1_46_0"] : Tag, SR :=	elementSet["s_1_1_36_0"], SREmail :=	elementSet["s_1_1_50_0"]
		 , OwnerEmail :=	Owner "@dell.com", OwnerFullName :=	RegExReplace(RegExReplace(Owner, "_", " "),"^.+$","$T0")
		 , Owner := SubStr(Owner, 1, Instr(Owner, "_")-1)
	}
	else
	{
		MsgBox,, Error!, The service request page is not detected!`nIf you are there, please make sure the Email field has a valid email address and then run the script again.
		ExitApp
	}
}


#11 crazyace

crazyace
  • Members
  • 155 posts

Posted 31 May 2012 - 03:11 PM

Thanks for the reply. AHK_L is still crashing :( Also we had to remove the != "_sfv" and change it to = "_sfv". After doing that we got the following error

---------------------------
Emails - Agent.ahk
---------------------------
Error in #include file AutoSweet\SubScripts\functions.ahk":
     0x80020003 - Member not found.

Source:                 (null)
Description:        Member not found.


HelpFile:                              C:\WINNT\system32\mshtml.hlp
HelpContext:     0

Specifically: document

                Line#
                106: if (frame.document.all["s_1_1_51_0"].getAttribute("value") != "")  
                107: {
                108: MsgBox,48,Warning,The "_svf" window frame could not be located, the script will now exit.
                109: ExitApp
                110: }
                112: pWin := frame
                114: For elementName,value in elementSet
--->        115: elementSet[elementName] :=   pWin.document[elementName].value  
                117: if InStr(elementSet["s_1_1_50_0"],"@")  
                118: {
                119: For globalVar,value in {name:elementSet["s_1_1_51_0"],LName:elementSet["s_1_1_47_0"],Owner:elementSet["s_1_1_74_0"]}
                120: Loop,2
                121: %globalVar% := RegExReplace((A_Index=1) ? value : %globalVar%,regex%A_Index%,repl%A_Index%)
                123: Tag :=   !Tag ? elementSet["s_1_1_46_0"] : Tag, SR :=   elementSet["s_1_1_36_0"], SREmail :=   elementSet["s_1_1_50_0"], OwnerEmail :=   Owner "@dell.com", OwnerFullName :=   RegExReplace(RegExReplace(Owner, "_", " "),"^.+$","$T0"), Owner := SubStr(Owner, 1, Instr(Owner, "_")-1)  
                126: }

Continue running the script?
---------------------------
Yes   No   
---------------------------


#12 crazyace

crazyace
  • Members
  • 155 posts

Posted 04 June 2012 - 06:47 PM

Thanks for the reply. AHK_L is still crashing :( Also we had to remove the != "_sfv" and change it to = "_sfv". After doing that we got the following error

---------------------------
Emails - Agent.ahk
---------------------------
Error in #include file AutoSweet\SubScripts\functions.ahk":
     0x80020003 - Member not found.

Source:                 (null)
Description:        Member not found.


HelpFile:                              C:\WINNT\system32\mshtml.hlp
HelpContext:     0

Specifically: document

                Line#
                106: if (frame.document.all["s_1_1_51_0"].getAttribute("value") != "")  
                107: {
                108: MsgBox,48,Warning,The "_svf" window frame could not be located, the script will now exit.
                109: ExitApp
                110: }
                112: pWin := frame
                114: For elementName,value in elementSet
--->        115: elementSet[elementName] :=   pWin.document[elementName].value  
                117: if InStr(elementSet["s_1_1_50_0"],"@")  
                118: {
                119: For globalVar,value in {name:elementSet["s_1_1_51_0"],LName:elementSet["s_1_1_47_0"],Owner:elementSet["s_1_1_74_0"]}
                120: Loop,2
                121: %globalVar% := RegExReplace((A_Index=1) ? value : %globalVar%,regex%A_Index%,repl%A_Index%)
                123: Tag :=   !Tag ? elementSet["s_1_1_46_0"] : Tag, SR :=   elementSet["s_1_1_36_0"], SREmail :=   elementSet["s_1_1_50_0"], OwnerEmail :=   Owner "@dell.com", OwnerFullName :=   RegExReplace(RegExReplace(Owner, "_", " "),"^.+$","$T0"), Owner := SubStr(Owner, 1, Instr(Owner, "_")-1)  
                126: }

Continue running the script?
---------------------------
Yes   No   
---------------------------



Anyone have any comments?

#13 Guests

  • Guests

Posted 05 June 2012 - 09:01 PM

I actually suspect that the issue is not with AHK, but rather a problem with the webpage. We've run into two very intermittent issues with our scripts; the first is that sometimes the error-checking of the script will trigger and say that one of the field values is not found, even when it is present, and then the issue we're describing here in the thread. The first issue is resolved by simply closing and re-opening the webpage. The second (the one in this thread) we usually have to reboot the system for.

Now, we know that the Siebel implementation we're being forced to use is absolute crap, and there's nothing we can do about it, but does anybody have a suggestion for how to deal with the scripting side on how to prevent AHK from crashing when the page generates garbage data that we're not able to see somehow?