Runtime error (on the 18th iteration of a loop)

Bug #596546 reported by Abdullah
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
SikuliX
New
Undecided
Unassigned

Bug Description

The loop in the following script runs for 17 times, and on the 18th iteration it crashes on the line 9 (or when the wait event on line 8 finished):

switchApp("simulator")
1: for i in range ( 121, 626):
2: print "runing project %d" % (i)
3: type("o", KEY_CTRL)
4: paste("project" + str(i))
5: type(Key.ENTER) #load project
6: doubleClick("project icon")
7: click("run button")
8: wait("finish run", 30)
9: type("u", KEY_CTRL) #unload project

Sikuli version 0.10.1
OS winxp 64

the error message is

---------------------------
Microsoft Visual C++ Runtime Library
---------------------------
Runtime Error!

Program: C:\Program Files (x86)\Java\jre6\bin\java.exe

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

---------------------------
OK
---------------------------

Abdullah (abdullah512)
summary: - Runtime error (on the 18 iteration of a loop)
+ Runtime error (on the 17 iteration of a loop)
summary: - Runtime error (on the 17 iteration of a loop)
+ Runtime error (on the 17th iteration of a loop)
Abdullah (abdullah512)
summary: - Runtime error (on the 17th iteration of a loop)
+ Runtime error (on the 18th iteration of a loop)
description: updated
Revision history for this message
Rodney Carvalho (rodneyjcarvalho) wrote :

I'm having this issue, too. It happens on a loop, but I can't tell exactly where it's crashing.

Revision history for this message
P (pcd) wrote :

I am also having this problem.

If anyone has a solution, please post it.

Revision history for this message
Stefani (stefani-home) wrote :

For me, this happens when I have a long wait operation.

img = Pattern("xyz.png").similar(0.99)
if wait(img, 440):
    # do something

The problem seems to be related to Bug #575585, https://bugs.launchpad.net/sikuli/+bug/575585

I can observe that while the wait() is ongoing, memory usage rapidly increases. Ate up at least 600MB during the wait time eventually crashing when 1.284GB used by process.

Error message on command line is:
OpenCV Error: Insufficient memory (Failed to allocate 31160204 bytes) in OutOfMemoryError, file cxcore/cxalloc.cpp, line 52

The runtime error noted by other bug reporters above is shown in a popup to the user. It's just the windows message.

When I change code above to use sleep in place of wait, I do not get the crash.
sleep(400)
if wait(img, 40):
    # do something

I had the original code in place for a while before I saw the crashing. It only appeared after I added other test steps before this one. Now it is always reproducible.

And, my suspicion is that it is only a problem when I use img = Pattern("aaaa.png").similar(0.xx).
If I were to have a long wait where I used img = "aaa.png" (i.e. without Pattern()), I don't think I would have the problem. Not sure. Just a guess.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.