Coder Social home page Coder Social logo

Comments (3)

gnat79 avatar gnat79 commented on July 19, 2024

I've had the same problem, running locally without Docker, with PyPanda installed from source Why is dlerror null? The error originates in callbacks.c:198, with the call to dlopen (see below). I'm not familiar enough with dlopen to understand the implications of using those three flags together:

void *libpanda = dlopen(library_path, RTLD_LAZY | RTLD_NOLOAD | RTLD_GLOBAL);

from panda.

whoismissing avatar whoismissing commented on July 19, 2024

I've been running into this problem as well when running locally in Ubuntu 22 installed from source.

As a small test of dlopen, the use of the RTLD_NOLOAD flag means that if it is the first time libpanda-x86_64.so is being loaded, then dlopen will return NULL.

As an example POC:

#include <stdio.h>
#include <dlfcn.h>

int main() {

	void * rv = dlopen("/usr/local/lib/python3.10/dist-packages/pandare/data//x86_64-softmmu/libpanda-x86_64.so", RTLD_LAZY | RTLD_NOLOAD | RTLD_GLOBAL);

	void * rv2 = dlopen("/usr/local/lib/python3.10/dist-packages/pandare/data//x86_64-softmmu/libpanda-x86_64.so", RTLD_LAZY | RTLD_LOCAL);

	void * rv3 = dlopen("/usr/local/lib/python3.10/dist-packages/pandare/data//x86_64-softmmu/libpanda-x86_64.so", RTLD_LAZY | RTLD_NOLOAD | RTLD_GLOBAL);

	printf("rv = %p\n", rv);
	printf("rv2 = %p\n", rv2);
	printf("rv3 = %p\n", rv3);

	return 0;
}
$ gcc test_dlopen.c
$ ./a.out
rv = (nil)
rv2 = 0x55ac517ea300
rv3 = 0x55ac517ea300

from panda.

whoismissing avatar whoismissing commented on July 19, 2024

My workaround right now is just to use the Panda API like in run_dbg.py instead of using snake_hook.

from panda.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.