crash the on rc = sqlite3_prepare_v2(_db, [sql UTF8String], -1, &pStmt, 0);

206 views
Skip to first unread message

Ravi Patel

unread,
Apr 19, 2016, 11:01:34 AM4/19/16
to FMDB
when fetch the record from local DB then some time crash is happening on 

 rc = sqlite3_prepare_v2(_db, [sql UTF8String], -1, &pStmt, 0); line.



log

* thread #1: tid = 0x6084, 0x000000010274136d libsqlite3.dylib`sqlite3DbMallocRaw + 77, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x74)

    frame #0: 0x000000010274136d libsqlite3.dylib`sqlite3DbMallocRaw + 77

    frame #1: 0x00007fa1a1df1420

    frame #2: 0x00000001027c7e67 libsqlite3.dylib`selectExpander + 7047

    frame #3: 0x00000001027c0841 libsqlite3.dylib`sqlite3WalkSelect + 81

    frame #4: 0x00000001027c5d55 libsqlite3.dylib`sqlite3SelectPrep + 165

    frame #5: 0x00000001027a0336 libsqlite3.dylib`sqlite3Select + 326

    frame #6: 0x000000010278d57f libsqlite3.dylib`yy_reduce + 4191

    frame #7: 0x000000010278c35f libsqlite3.dylib`sqlite3Parser + 127

    frame #8: 0x0000000102745475 libsqlite3.dylib`sqlite3RunParser + 501

    frame #9: 0x000000010278ba61 libsqlite3.dylib`sqlite3Prepare + 529

    frame #10: 0x0000000102743e3f libsqlite3.dylib`sqlite3LockAndPrepare + 319

    frame #11: 0x0000000102743a9b libsqlite3.dylib`sqlite3_prepare_v2 + 43

  * frame #12: 0x0000000101d65dd1 SFSoftwiseFinacials`-[FMDatabase executeQuery:withArgumentsInArray:orDictionary:orVAList:](self=0x00007fa1a1ebbd90, _cmd="executeQuery:withArgumentsInArray:orDictionary:orVAList:", sql="SELECT * FROM Loans WHERE CustomerId==? ", arrayArgs=@"1 object", dictionaryArgs=0x0000000000000000, args=0x0000000000000000) + 673 at FMDatabase.m:782

    frame #13: 0x0000000101d66cb3 SFSoftwiseFinacials`-[FMDatabase executeQuery:withArgumentsInArray:](self=0x00007fa1a1ebbd90, _cmd="executeQuery:withArgumentsInArray:", sql="SELECT * FROM Loans WHERE CustomerId==? ", arguments=@"1 object") + 83 at FMDatabase.m:925

    frame #14: 0x0000000101fad77d SFSoftwiseFinacials`SFSoftwiseFinacials.SFDBManager.getLoanDetailsList (customerId="MOB-0006148", self=0x00007fa1a1e13370)(Swift.String) -> Swift.Optional<Swift.Array<SFSoftwiseFinacials.SFLoansInfo>> + 1213 at SFDBManager.swift:2277

    frame #15: 0x0000000101f39902 SFSoftwiseFinacials`SFSoftwiseFinacials.SFAccountTableViewController.viewDidLoad (self=0x00007fa1a40063c0)() -> () + 834 at SFAccountTableViewController.swift:42

    frame #16: 0x0000000101f3aa62 SFSoftwiseFinacials`@objc SFSoftwiseFinacials.SFAccountTableViewController.viewDidLoad (SFSoftwiseFinacials.SFAccountTableViewController)() -> () + 34 at SFAccountTableViewController.swift:0

    frame #17: 0x0000000103ce4f98 UIKit`-[UIViewController loadViewIfRequired] + 1198

    frame #18: 0x0000000103d29651 UIKit`-[UINavigationController _layoutViewController:] + 54

    frame #19: 0x0000000103d29f26 UIKit`-[UINavigationController _updateScrollViewFromViewController:toViewController:] + 462

    frame #20: 0x0000000103d2a098 UIKit`-[UINavigationController _startTransition:fromViewController:toViewController:] + 126

    frame #21: 0x0000000103d2b2f1 UIKit`-[UINavigationController _startDeferredTransitionIfNeeded:] + 890

    frame #22: 0x0000000103d2c3af UIKit`-[UINavigationController __viewWillLayoutSubviews] + 57

    frame #23: 0x0000000103ed2ff7 UIKit`-[UILayoutContainerView layoutSubviews] + 248

    frame #24: 0x0000000103c054a3 UIKit`-[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 703

    frame #25: 0x000000010398f59a QuartzCore`-[CALayer layoutSublayers] + 146

    frame #26: 0x0000000103983e70 QuartzCore`CA::Layer::layout_if_needed(CA::Transaction*) + 366

    frame #27: 0x0000000103983cee QuartzCore`CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 24

    frame #28: 0x0000000103978475 QuartzCore`CA::Context::commit_transaction(CA::Transaction*) + 277

    frame #29: 0x00000001039a5c0a QuartzCore`CA::Transaction::commit() + 486

    frame #30: 0x0000000103b79b47 UIKit`_afterCACommitHandler + 174

    frame #31: 0x000000010316d367 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23

    frame #32: 0x000000010316d2d7 CoreFoundation`__CFRunLoopDoObservers + 391

    frame #33: 0x0000000103162f2b CoreFoundation`__CFRunLoopRun + 1147

    frame #34: 0x0000000103162828 CoreFoundation`CFRunLoopRunSpecific + 488

    frame #35: 0x0000000107513ad2 GraphicsServices`GSEventRunModal + 161

    frame #36: 0x0000000103b4e610 UIKit`UIApplicationMain + 171

    frame #37: 0x0000000101fe5d3d SFSoftwiseFinacials`main + 109 at AppDelegate.swift:11

    frame #38: 0x0000000107b4992d libdyld.dylib`start + 1

(lldb) 

Gus Mueller

unread,
Apr 19, 2016, 11:28:27 AM4/19/16
to fm...@googlegroups.com

> On Apr 19, 2016, at 6:16 AM, Ravi Patel <mrpatel...@gmail.com> wrote:
>
> when fetch the record from local DB then some time crash is happening on
> rc = sqlite3_prepare_v2(_db, [sql UTF8String], -1, &pStmt, 0); line.
>

You’ll need to isolate your bug a bit more than this. It’s probably something inside your code somewhere, that is potentially releasing a string that shouldn’t be (just a guess on my part).

-gus

amit mundra

unread,
Oct 5, 2016, 8:19:48 AM10/5/16
to FMDB
I am facing same issue, Have you solved your problem?

And also some time getting issues to loop through and get record from FMResultSet.

Any solution that you can suggest?

Thanks.
Amit.
Reply all
Reply to author
Forward
0 new messages