question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I would like to understand why the next crash is happening.

Important: I cannot reproduce it. My unit tests are Ok, but after using the application for a while (hours or even days), the next crash happens again.

Logs are from Crashlytics:

Exception Type: SIGSEGV Code: SEGV_ACCERR at 0x2
Thread Crashed
5/26/2013 at 17:38:49 UTC-0300
0    libsqlite3.dylib    sqlite3_step + 42265
1       
2    libsqlite3.dylib    sqlite3_value_text + 2766
3    libsqlite3.dylib    sqlite3_step + 30818
4    libsqlite3.dylib    sqlite3_step + 2142
5    SampleIOS   wrapper_managed_to_native_SQLite3_Step_intptr
6    SampleIOS   System_Collections_Generic_List_1_AddEnumerable_System_Collections_Generic_IEnumerable_1_T
7    SampleIOS   System_Collections_Generic_List_1__ctor_System_Collections_Generic_IEnumerable_1_T
8    SampleIOS   System_Linq_Enumerable_ToList_TSource_System_Collections_Generic_IEnumerable_1_TSource
9    SampleIOS   SQLiteCommand_ExecuteQuery_T

And here is the code which is generating the exception:

IEnumerable<Message> results = database.ExecuteQueryWithLambda<Message> (
() =>
from message in database.Table<Message> ()
where (
message.ConversationID == conversationID && 
message.UserAccountID == userAccountID &&
message.SentDate != null &&
message.DeliveredToRecipientDate != null
)
select message)
.OrderByDescending (message => message.SentDate)
    .Take<Message> (1)
    .ToList<Message> ();
public IEnumerable<T> ExecuteQueryWithLambda<T> (Func<IEnumerable<T>> query) where T : new ()
{
    lock (locker) {
        try {
            return query.Invoke ();
        } catch (Exception ex) {
            //
            // Log
            Logger.Log ("SQLiteDatabase 'ExecuteQueryWithLambda' caught an Exception: {0}", ex);
            return new List<T> ();
        }
    }
}

Note: I have just tried to catch the exception but the app still crashing before the catch block gets called.

I would appreciate for any help. I cannot understand what is the real problem. Is there something wrong with my ExecuteQueryWithLambda method implementation?

I am using:

  • A Mac;
  • Xamarin Studio;
  • Xamarin.iOS;

Thanks.

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
praeclarumcommented, Aug 13, 2017

I’m closing this since it looks like you got an answer.

1reaction
patrikahleniuscommented, Jul 26, 2013

Hi, Yes, you need to call sqllite_shutdown() and then set to serialized mode, followed by initalize(), see my pull request https://github.com/praeclarum/sqlite-net/pull/220

Read more comments on GitHub >

github_iconTop Results From Across the Web

What causes a SIGSEGV? - segmentation fault
SigSegV means a signal for memory access violation, trying to read or write from/to a memory area that your process does not have...
Read more >
Linux Segmentation Fault | Signal 11, Exit code 139
SIGSEGV, also known as a segmentation violation or segmentation fault, is a signal used by Unix-based operating systems (such as Linux).
Read more >
Segmentation Fault (SIGSEGV) vs Bus Error (SIGBUS)
Segmentation fault(SIGSEGV) and Bus error(SIGBUS) are signals generated when serious program error is detected by the operating system and ...
Read more >
Segmentation fault
On Unix-like operating systems, a signal called SIGSEGV (abbreviated from segmentation violation) is sent to the offending process. On Microsoft Windows ...
Read more >
sigsegv
My account was briefly hijacked on Jan 21 2021. The hijacker sent chat spam as "me" and unfriended+blocked a bunch of people (53...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found