pdaughe Posted July 3, 2009 Author Posted July 3, 2009 Indeed users do not need a MAP file. All I need is the offset of the crash and I can figure out which function it was in. Users do not need the file for that. pdaughe, if you are willing, I can give you a freshly compiled version of 3.3.1.1's AutoItSC.bin. I will, of course, have the MAP file for that version. You can run it until it crashes and then tell me the offset. I might be able to work something out from there.Valik, I didn't want to take up your time until I had made every attempt to duplicate the problem. I have not been able to duplicate it, so yes, I think it will be beneficial to pursure this -- I will follow your instructions... I have discovered the problem occurs in more than one situation in my application. What I have been able to determine is that I call a function which executes an AdlibRegister; the function completes (i.e the last trace message immediately before the EndFunc is written), then the crash occurs. This is not a "rare" occurence; it happens every time, and again, in more than one situation. It's surprising (and frustrating) to me that I cannot duplicate it. I have a couple of aside comments regarding AdlibRegister/UnRegister (these comments do not have anything directly to do with the problem). First here's a version of the script I've been testing with: expandcollapse popup#include <GuiConstants.au3> #include <WindowsConstants.au3> #include <Constants.au3> AutoItSetOption ("GUIOnEventMode", 1) ;Enable event-driven processing Local $Main_Window = GUICreate ("Application Window") GUISetOnEvent ($GUI_EVENT_MOUSEMOVE, "Mouse_Move", $Main_Window) GUISetOnEvent ($GUI_EVENT_Close, "Termination", $Main_Window) Local $Main_Menu = GUICreate ("Main Menu", 200, 200, -1, -1, $WS_POPUP, -1, $Main_Window) GUISetBkColor ($Color_Red) GUISetState (@SW_SHOW, $Main_Window) GUISetState (@SW_SHOWNA, $Main_Menu) AdlibRegister ("Test01", 10) AdlibRegister ("Test02", 10) While True Sleep (60000) WEnd Func Termination () Exit EndFunc ;=================================================================================+ ; Test01 | ;=================================================================================+ Func Test01 () ConsoleWrite (@HOUR & ":" & @MIN & ":" & @SEC & "." & @MSEC & ": Test01 Function begins..." & @CRLF) ;;ConsoleWrite (@HOUR & ":" & @MIN & ":" & @SEC & "." & @MSEC & ": Test01 Function ends" & @CRLF) ;;Return Local $Window_Position = WinGetPos ($Main_Menu) For $I = 1 To 50 WinMove ($Main_Menu, "", Default, $Window_Position[1] + 6) Sleep (02) $Window_Position = WinGetPos ($Main_Menu) If $Window_Position[1] >= @DesktopHeight Then $Window_Position[1] = 0 WinSetTrans ($Main_Menu, "", 255) Else WinSetTrans ($Main_Menu, "", 255 - $I) EndIf Next ConsoleWrite (@HOUR & ":" & @MIN & ":" & @SEC & "." & @MSEC & ": Test01 Function ends" & @CRLF) EndFunc ;=================================================================================+ ; Test02 | ;=================================================================================+ Func Test02 () ConsoleWrite (@HOUR & ":" & @MIN & ":" & @SEC & "." & @MSEC & ": Test02 Function begins..." & @CRLF) ConsoleWrite (@HOUR & ":" & @MIN & ":" & @SEC & "." & @MSEC & ": Test02 Function ends" & @CRLF) EndFunc ;=================================================================================+ ; Mouse Move | ;=================================================================================+ Func Mouse_Move () ConsoleWrite (@HOUR & ":" & @MIN & ":" & @SEC & "." & @MSEC & ": Mouse Move" & @CRLF) EndFunc 1. Notice that the Test02 function is never executed once the Test01 function starts. It appears that if an AdLibRegister function takes longer to execute than it's scheduled frequency, it will dominate. If you uncomment the first two commented lines in Test01, you see both Test01 and Test02 execute. I'm not suggesting this is a "problem", just noting it for your awareness. 2. It would be "nice" if AdlibUnRegister ("") would unregister all registered Adlib functions. The application can of course keep track of registered functions, but it would be convenient. Thank you for you willingness to help. My e-mail address is: Developer@twmi.rr.com. I live in the United States, Eastern Standard Time. Paul
pdaughe Posted July 3, 2009 Author Posted July 3, 2009 (edited) Would someone else please compile and test the script below (beta required) and see if it fails? Please post -- thanks. Valik, After posting the previous reply, I thought to try one more thing: compile the test program. Oh my gosh -- after two full days, I FINALLY duplicated the problem. The reason it was so difficult to duplicate is that I was running all my tests under SciTE -- the problem only occurs if it is compiled (Update: the problem can and does occur under SciTe -- it's just harder to get it to occur. It seems to happen within the first two or three seconds, or not at all. It's more easily experienced when compiled). Here's the script that fails every time (update: strike "every time" -- strangely, "sometimes" the exe starts running and runs successfully -- other times if fails very quickly) for me: expandcollapse popup#include <GuiConstants.au3> #include <WindowsConstants.au3> #include <Constants.au3> AutoItSetOption ("GUIOnEventMode", 1);Enable event-driven processing Local $Main_Window = GUICreate ("Application Window") GUISetOnEvent ($GUI_EVENT_MOUSEMOVE, "Mouse_Move", $Main_Window) GUISetOnEvent ($GUI_EVENT_Close, "Termination", $Main_Window) Local $Main_Menu = GUICreate ("Main Menu", 200, 200, -1, -1, $WS_POPUP, -1, $Main_Window) GUISetBkColor ($Color_Red) GUISetState (@SW_SHOW, $Main_Window) GUISetState (@SW_SHOWNA, $Main_Menu) AdlibRegister ("Test01", 10) AdlibRegister ("Test02", 10) Global $Test01_Active = True While True Sleep (60000) WEnd Func Termination () Exit EndFunc ;=================================================================================+ ; Test01 | ;=================================================================================+ Func Test01 () ConsoleWrite (@HOUR & ":" & @MIN & ":" & @SEC & "." & @MSEC & ": Test01 Function begins..." & @CRLF) ;;ConsoleWrite (@HOUR & ":" & @MIN & ":" & @SEC & "." & @MSEC & ": Test01 Function ends" & @CRLF) ;;Return Local $Window_Position = WinGetPos ($Main_Menu) For $I = 1 To 50 WinMove ($Main_Menu, "", Default, $Window_Position[1] + 6) Sleep (02) $Window_Position = WinGetPos ($Main_Menu) If $Window_Position[1] >= @DesktopHeight Then $Window_Position[1] = 0 WinSetTrans ($Main_Menu, "", 255) Else WinSetTrans ($Main_Menu, "", 255 - $I) EndIf Next ConsoleWrite (@HOUR & ":" & @MIN & ":" & @SEC & "." & @MSEC & ": Test01 Function ends" & @CRLF) EndFunc ;=================================================================================+ ; Test02 | ;=================================================================================+ Func Test02 () ConsoleWrite (@HOUR & ":" & @MIN & ":" & @SEC & "." & @MSEC & ": Test02 Function begins..." & @CRLF) ConsoleWrite (@HOUR & ":" & @MIN & ":" & @SEC & "." & @MSEC & ": Test02 Function ends" & @CRLF) EndFunc ;=================================================================================+ ; Mouse Move | ;=================================================================================+ Func Mouse_Move () ConsoleWrite (@HOUR & ":" & @MIN & ":" & @SEC & "." & @MSEC & ": Mouse Move" & @CRLF) If $Test01_Active Then AdlibUnRegister ("Test01") $Test01_Active = False Else AdlibRegister ("Test01", 10) $Test01_Active = True EndIf EndFunc Edited July 3, 2009 by pdaughe
Valik Posted July 3, 2009 Posted July 3, 2009 I can reproduce it. It makes no sense, mind you, but I can reproduce it.
Valik Posted July 3, 2009 Posted July 3, 2009 2. It would be "nice" if AdlibUnRegister ("") would unregister all registered Adlib functions. The application can of course keep track of registered functions, but it would be convenient.It removes the last registered function. I'll try to figure out a way to return the size. It's tricky, though, because an Adlib can unregister itself.
Valik Posted July 3, 2009 Posted July 3, 2009 (edited) Fixed: Crash due to unregistering an Adlib while an Adlib was firing. Fixed: Adlib functions no longer dominate when more than one are registered. Changed: AdlibUnregister() now returns the count of remaining Adlib functions that are registered.I think that fixes everything... for Adlib at least. Edit: In the next beta you will be able to do this to unregister all Adlibs: While AdlibUnregister("") WEnd Edited July 3, 2009 by Valik
pdaughe Posted July 3, 2009 Author Posted July 3, 2009 I think that fixes everything... for Adlib at least. Edit: In the next beta you will be able to do this to unregister all Adlibs: While AdlibUnregister("") WEndWell, well...not the first time I've been impressed with you, and I'm sure it won't be the last! Thank you again for your help and all the time you put in on AutoIt. I'll be anxious to implement it when the fix becomes available. This functionality is a nice addition to AutoIt. Sincerely, Paul
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now