Project

General

Profile

Bug #1434

Thread created with pthread_create can't use JNI anymore

Added by Roman Lebedev about 3 years ago. Updated about 3 years ago.

Status:
Open
Priority:
High
Category:
libcrystax
Target version:
Start date:
07/12/2016
Due date:
% Done:

0%

Estimated time:
CPU Architecture:
arm64
Host OS:
Linux
Toolchain:
gcc-6
Android version:
5.1 (android-22)
CrystaX Version:

Description

This bug happens in build 883, after creating the thread with

pthread_attr_init(&type);
pthread_attr_setdetachstate(&type, PTHREAD_CREATE_JOINABLE);    
pthread_create (&__threadp, &type, ThreadProc, (void*)strdup(arg));

Trying to get the JNIEnv with

(* gJavaVM)->GetEnv(gJavaVM,(void **) &env, JNI_VERSION_1_6);

returns JNI_OK but env is not changed.

Creating the thread from Java side fixes the problem.

History

#1

Updated by Roman Lebedev about 3 years ago

This can be fixed by dlopening original pthread_* functions as well.
libcrystax was linked statically.

#2

Updated by Dmitry Moskalchuk about 3 years ago

  • Assignee set to Dmitry Moskalchuk
  • Priority changed from Normal to High
#3

Updated by Dmitry Moskalchuk about 3 years ago

  • Description updated (diff)

Also available in: Atom PDF