Skip to content

Emulator running WeChat Mini-Program in Arm64 is Ok #3011

@Aqua-Peak

Description

@Aqua-Peak

Hello, ptitSeb
    Now, By modifying Box64(commit:6f144aa429e67721582bd8f02170ee90fe3fafa9, date:20250908) , WeChat MiniProgram built for the x86_64 architecture can be run on the Raspberry Pi 5.

Image

BACKGROUND: WeChat is an instant-messaging application with hundreds of millions of users worldwide. Mini-Program is a built-in feature of WeChat, like browser plug-ins. At present, Box64 can run the main process just for sending/receiving messages, but it cannot yet run Mini-Program.

   Mini-Program is built on a Web-technology stack, which poses a new challenge for Box64

   Initially, our debugging efforts were blocked by a cryptic error: cfree(): invalid pointer.

   Further investigation revealed the root cause: Mini-Program ship own malloc/free function family to manage memory. Consequently, directly mapping these functions to the host libc by the library-wrapping mechanism, causes the error.

   Fortunately, Box64 provides the malloc-hook mechanism, which can handle the problem.

   However, under the special execution environment of Mini-Program, we have uncovered several issues listed below, and designed a solution:

  1. Activation strategy of malloc-Hook for the x86_64 ELF
  2. Memory management —the malloc-hoock mechainism relies on memory attributes
  3. Translated-code-blocks management
      Here we share our current achievements. Hope to exchange ideas with you furtherly, making Box64 more prefect.
    Thanks.
    Aqua.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions