Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIGSEGV in coffeecatch_native_code_handler_struct_free #25

Open
Propheta13 opened this issue Mar 18, 2016 · 1 comment
Open

SIGSEGV in coffeecatch_native_code_handler_struct_free #25

Propheta13 opened this issue Mar 18, 2016 · 1 comment

Comments

@Propheta13
Copy link

Hi. I am trying to do some little testing of coffeecatch without JNI - in pure C/C++ on Android 4.4.4 x86.
Doing something like this:

test_result_t run_test(int signal) {
    test_result_t result = {false, 0};
    COFFEE_TRY() {
        raise(signal);
    } COFFEE_CATCH() {
        coffeecatch_cancel_pending_alarm();
        result.catched_signal = coffeecatch_get_signal();
    } COFFEE_END();
    result.exited = true;
    return result;
}

int main(int argc, char** argv) {
    test_result_t result = run_test(SIGFPE);
    LOG("SIGFPE CATCH TEST: ");

    ASSERT_TRUE(SIGFPE == result.catched_signal && true == result.exited);
}

Unfortunately i am getting SEGFAULT during COFFEE_END(). Logcat and coffeecatch debug logs attached.

debug.txt
logcat.txt

@Propheta13
Copy link
Author

Please notice that code without changes was giving me a lot of redeclaration errors:
Error:(122, 8) error: redefinition of 'struct _libc_fpreg'
Error:(128, 8) error: redefinition of 'struct _libc_fpstate'
Error:(140, 19) error: conflicting types for 'greg_t'
Error:(147, 3) error: conflicting types for 'mcontext_t'
Error:(150, 3) error: redeclaration of enumerator 'REG_GS'
Error:(151, 3) error: redeclaration of enumerator 'REG_FS'
Error:(152, 3) error: redeclaration of enumerator 'REG_ES'
Error:(153, 3) error: redeclaration of enumerator 'REG_DS'
Error:(154, 3) error: redeclaration of enumerator 'REG_EDI'
Error:(155, 3) error: redeclaration of enumerator 'REG_ESI'
Error:(156, 3) error: redeclaration of enumerator 'REG_EBP'
Error:(157, 3) error: redeclaration of enumerator 'REG_ESP'
Error:(158, 3) error: redeclaration of enumerator 'REG_EBX'
Error:(159, 3) error: redeclaration of enumerator 'REG_EDX'
Error:(160, 3) error: redeclaration of enumerator 'REG_ECX'
Error:(161, 3) error: redeclaration of enumerator 'REG_EAX'
Error:(162, 3) error: redeclaration of enumerator 'REG_TRAPNO'
Error:(163, 3) error: redeclaration of enumerator 'REG_ERR'
Error:(164, 3) error: redeclaration of enumerator 'REG_EIP'
Error:(165, 3) error: redeclaration of enumerator 'REG_CS'
Error:(166, 3) error: redeclaration of enumerator 'REG_EFL'
Error:(167, 3) error: redeclaration of enumerator 'REG_UESP'
Error:(168, 3) error: redeclaration of enumerator 'REG_SS'

So i moved #if !defined(*BIONIC_HAVE_UCONTEXT_T) to line before /* Taken from Google Breakpad. / just after #elif defined(__i386).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant