Skip to content

JavaKit: Passing objects between threads #157

@lhoward

Description

@lhoward

javaMethodLookup() uses the environment attached to the object, probably it should use the ambient (thread-specific) environment or the one that is passed in?

java_vm_ext.cc:599] JNI DETECTED ERROR IN APPLICATION: thread Thread[23,tid=1783,Native,Thread*=0xb40000718be7eb40,peer=0x1449d000,"Thread-4"] using JNIEnv* from thread Thread[1,tid=1631,Native,Thread*=0xb40000718be307b0,peer=0x72c1eb68,"main"]
                                                                                                    java_vm_ext.cc:599]     in call to GetObjectClass

From the JNI specs:

The JNI interface pointer is only valid in the current thread. A native method, therefore, must not pass the interface pointer from one thread to another. A VM implementing the JNI may allocate and store thread-local data in the area pointed to by the JNI interface pointer.

So, I think this is a bug. Is the fix as simple as adding an environment argument to javaMethodLookup()?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy