Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6054] Titanium.Filesystem.File.exists function crashes after being called for many times

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionWon't Fix
Resolution Date2011-11-10T14:39:41.000+0000
Affected Version/sn/a
Fix Version/sSprint 2011-45
ComponentsiOS
Labelsn/a
ReporterQing Gao
AssigneeReggie Seagraves
Created2011-11-07T13:41:45.000+0000
Updated2017-03-03T22:50:52.000+0000

Description

Titanium.Filesystem.File.exists() function crashes after being repeatedly called. The crash log is attached. This bug has been fixed in 1.8.0.

Repro Steps

Run the following code snippet on the iPhone emulator and it will get crashed.
var dir, i;
for (i = 0; i <= 1000; i++) {
  dir = Ti.Filesystem.getFile(Ti.Filesystem.applicationSupportDirectory, "myfolder");
  if (!dir.exists()) {
    dir.createDirectory();
  }
}
alert("done");

Associated Helpdesk Ticket

http://appc.me/c/APP-647367

Attachments

FileDateSize
testFileSystem_2011-11-08-100821_qgaombp.crash2011-11-08T10:12:47.000+000037545

Comments

  1. Damien Elmes 2011-11-07

    As mentioned in the helpdesk ticket, a fix for 1.7 would be greatly appreciated, as I can't drop support for iOS3 yet.
  2. Damien Elmes 2011-11-09

    In case it helps, the crash my users are getting in the app looks a little different, but also seems to be triggered by an exists() call (if I comment out the call, no crash)
       Thread 6 name:  KrollContext<kroll$2>
       Thread 6 Crashed:
       0   Anki                                0x00169322 TI::Interpreter::privateExecute(TI::Interpreter::ExecutionFlag, TI::RegisterFile*, TI::TiExcState*, TI::TiValue*) (TiCell.h:202)
       1   Anki                                0x0017645a TI::Interpreter::execute(TI::FunctionExecutable*, TI::TiExcState*, TI::TiFunction*, TI::TiObject*, TI::ArgList const&, TI::ScopeChainNode*, TI::TiValue*) (Interpreter.cpp:688)
       2   Anki                                0x00180432 TI::TiFunction::call(TI::TiExcState*, TI::TiValue, TI::ArgList const&) (TiFunction.cpp:127)
       3   Anki                                0x0013b4d0 TI::call(TI::TiExcState*, TI::TiValue, TI::CallType, TI::CallData const&, TI::TiValue, TI::ArgList const&) (CallData.cpp:46)
       4   Anki                                0x0018c12a TiObjectCallAsFunction (TiObjectRef.cpp:417)
       5   Anki                                0x00037e76 -[KrollObject invokeCallbackForKey:withObject:thisObject:] (KrollObject.m:1242)
       6   Anki                                0x00031150 -[ExpandedInvocationOperation main] (KrollContext.mm:1299)
       7   Foundation                          0x378fb39c -[__NSOperationInternal start] + 856
       8   Anki                                0x0002d238 -[KrollContext invoke:] (KrollContext.mm:828)
       9   Anki                                0x0002e568 -[KrollContext main] (KrollContext.mm:1143)
       10  Foundation                          0x378e0a8a -[NSThread main] + 66
       11  Foundation                          0x3797459a __NSThread__main__ + 1042
       12  libsystem_c.dylib                   0x36cffc16 _pthread_start + 314
       13  libsystem_c.dylib                   0x36cffad0 thread_start + 0
       
  3. Reggie Seagraves 2011-11-10

    Unfortunately the fix for this issue was actually a fix in JavaScriptCore. As it requires a new JavaScriptCore, it is not possible for us to merge this fix into the 1_7_X branch. Upgrading to 1.8 is the only resolution for the issue.
  4. Lee Morris 2017-03-03

    Closing ticket.

JSON Source