Skip to content

ctypes callback function SIGSEGV #401

Closed

Description

@jerrys208

Hi,

i have a python-ctypes-c program that run well at ubuntu and i port it to the android based on 'python-for-android'. but i get SIGSEGV when the program call back from C to python.

  1. my python code:
def py_cb(p1):
    print("just cb")
module = load_library("xxxx.so")
CFUN = CFUNCTYPE(None, c_int)
cb = CFUN(py_cb)
module.test_cb(cb)
  1. my c code:
typedef void (*py_cb)(int p1);
const void test_cb(py_cb cb)
{
    cb(1)
}

can anyone help? many thanks!

Activity

  1. reopened this on Jul 8, 2015
  2. tito commented on Jul 8, 2015

    @tito
    Member

    Could you share the traceback / segfault trace ?

  3. inclement commented on Dec 6, 2015

    @inclement
    Member

    I'll close this as inactive, please reopen (or maybe better, raise it on the mailing lists) if you'd still like help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions