pcall() considered harmful

Case number:845829-2003657
Topic:Crash/Hang
Opened by:LociOiling
Status:Open
Type:Bug
Opened on:Wednesday, April 5, 2017 - 07:32
Last modified:Wednesday, April 5, 2017 - 18:18

The pcall function is built in to Lua. It's intended to catch errors. A Foldit recipe can use pcall to trap errors that would otherwise terminate the recipe.

The following Lua code now crashes the client:

for ii = 1, 9999 do
   print ( "test # " .. ii )
   pcall ( selection.SelectRange, -1, 9999 )
end

This command does not crash the client:

selection.SelectRange ( -1, 9999 )

Also, this version does not cause a crash:

for ii = 1, 9999 do
   print ( "test # " .. ii )
   pcall ( selection.SelectRange, 1, 10 )
end

So it seems to have something to do with a Foldit function, called via pcall, that throws an error.

This is somewhat new behavior. I have test script that checks around 100 boundary conditions. I hadn't run the script since September 2015, but it was working at the time. Now it crashes somewhat consistently after about 75 pcalls, not all of which are expected to produce an error.

The loop example above causes a crash much more quickly, although it's hard to tell exactly how many tests it completes.

Release 20170320-3ecbad1b35-win_x86

(Wed, 04/05/2017 - 07:32  |  1 comment)


LociOiling's picture
User offline. Last seen 5 hours 23 min ago. Offline
Joined: 12/27/2012
Groups: Beta Folders

Log file attached. No debug.txt is generated.

Event log error:

Log Name: Application
Source: Application Error
Date: 4/5/2017 1:12:24 PM
Event ID: 1000
Task Category: (100)
Level: Error
Keywords: Classic
User: N/A
Computer: XXXXXXXX
Description:
Faulting application name: Foldit.exe, version: 0.0.0.0, time stamp: 0x546d537b
Faulting module name: game_library.dll, version: 0.0.0.0, time stamp: 0x58d0ce35
Exception code: 0xc0000005
Fault offset: 0x009ba8ce
Faulting process id: 0x716ac
Faulting application start time: 0x01d2ae380ca351fd
Faulting application path: C:\Foldit\Foldit\Foldit.exe
Faulting module path: C:\Foldit\Foldit\cmp-binary-723ed6cab4ebe4776d6b41b7c6f68bf6\game_library.dll
Report Id: 023790ad-5c7f-42dc-907f-c0dc0d21c856
Faulting package full name:
Faulting package-relative application ID:

Sitemap

Developed by: UW Center for Game Science, UW Institute for Protein Design, Northeastern University, Vanderbilt University Meiler Lab, UC Davis
Supported by: DARPA, NSF, NIH, HHMI, Microsoft, Adobe, RosettaCommons