android + pthread + c ++ = SIGSEGV

O código a seguir compila e executa no linux padrão:

#include <iostream>
#include <pthread.h>

using namespace std;

class Foo
{
    public:
        Foo();
        void go_thread();
        void stop_thread();
    private:
        static void* worker( void* param );
        pthread_t m_pt;
};

Foo::Foo()
{
    m_pt = 0;
}

void Foo::go_thread()
{
    int success = pthread_create( &m_pt, NULL, worker, static_cast<void*>(this) );

    if( success == 0 )
    {
        cout << "thread started" << endl;
    }
}

void Foo::stop_thread()
{
    int success = pthread_join( m_pt, NULL );

    if( success == 0 )
    {
        cout << "thread stopped" << endl;
    }
}

void* Foo::worker( void* p )
{
    cout << "thread running" << endl;
    return 0;
}

int main()
{
    Foo f;
    f.go_thread();
    f.stop_thread();
    return 0;
}

and produz a seguinte saída:

$ ./a.out
thread started
thread running
thread stopped
$

Este código também é desenvolvido com o Android NDK (r5b). No entanto, quando adb envia o executável resultante para um dispositivo e o executo, recebo um SIGSEGV antes que main () seja executado. Eu isolei o problema parapthread_create() Parece que a mera existência dessa chamada no meu código, não importa a execução, faz com que o meu prog seg seg. Alguma ideia

questionAnswers(2)

yourAnswerToTheQuestion