Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some bullet wasm errors(A bug of how to use the _safe_delete) #17839

Closed
longchuan opened this issue Nov 12, 2024 · 9 comments
Closed

some bullet wasm errors(A bug of how to use the _safe_delete) #17839

longchuan opened this issue Nov 12, 2024 · 9 comments
Assignees
Milestone

Comments

@longchuan
Copy link
Contributor

longchuan commented Nov 12, 2024

Cocos Creator version

3.8.4

System information

web,GLES2, GLES3

Issue description

RuntimeError: null function or function signature mismatch
image

RuntimeError: table index is out of bounds
image

RuntimeError: memory access out of bounds
image

image

Relevant error log output

Steps to reproduce

1、set a physics world with scene
2、get the scene result and reload the scene
3、reload about 1000 counts,found the errors

Minimal reproduction project

No response

@longchuan longchuan added Bug Needs Triage Needs to be assigned by the team labels Nov 12, 2024
@longchuan
Copy link
Contributor Author

at Object.TriangleMesh_addTriangle (
看起来是cocos2BulletTriMesh这个方法有内存泄漏

@longchuan
Copy link
Contributor Author

问题代码

private static readonly BulletBvhTriangleMeshShapeMap = new Map<number, BulletBvhTriangleMeshShape>();

    public static getBulletBvhTriangleMeshShape (key: number, mesh: Mesh): BulletBvhTriangleMeshShape {
        let newBulletBvhTriangleMeshShape!: BulletBvhTriangleMeshShape;
        if (BulletBvhTriangleMeshShape.BulletBvhTriangleMeshShapeMap.has(key)) { //can be improved
            newBulletBvhTriangleMeshShape = BulletBvhTriangleMeshShape.BulletBvhTriangleMeshShapeMap.get(key)!;
            newBulletBvhTriangleMeshShape.reference = true;
        } else {
            newBulletBvhTriangleMeshShape = new BulletBvhTriangleMeshShape(key, mesh);
            BulletBvhTriangleMeshShape.BulletBvhTriangleMeshShapeMap.set(key, newBulletBvhTriangleMeshShape);
        }
        return newBulletBvhTriangleMeshShape;
    }

@longchuan
Copy link
Contributor Author

longchuan commented Nov 12, 2024

image
image
How the _safe_delete works with bullet?There is an opposite usage.
@minggo

@longchuan longchuan changed the title some bullet wasm errors some bullet wasm errors(The bug of how to use the _safe_delete) Nov 12, 2024
@longchuan longchuan changed the title some bullet wasm errors(The bug of how to use the _safe_delete) some bullet wasm errors(A bug of how to use the _safe_delete) Nov 12, 2024
@minggo minggo self-assigned this Nov 13, 2024
@minggo
Copy link
Contributor

minggo commented Nov 13, 2024

How did you reload the scene? It is better you provide a demo to reproduce it.

@minggo
Copy link
Contributor

minggo commented Nov 13, 2024

And you posted many information above, but i can't get what you want to express. It seems it said different things.

@longchuan
Copy link
Contributor Author

longchuan commented Nov 13, 2024

And you posted many information above, but i can't get what you want to express. It seems it said different things.

Solved the problem with editing the safedelete

@minggo
Copy link
Contributor

minggo commented Nov 13, 2024

Can i know how did you fix it?

@longchuan
Copy link
Contributor Author

Can i know how did you fix it?

#17842

@minggo
Copy link
Contributor

minggo commented Nov 13, 2024

Thank you, i will take a look.

@minggo minggo removed the Needs Triage Needs to be assigned by the team label Nov 13, 2024
@minggo minggo added this to the 3.8.5 milestone Nov 13, 2024
@minggo minggo closed this as completed Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants