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

Uncaught RuntimeError: memory access out of bounds #407

Open
miranbrajsalate opened this issue Jan 21, 2025 · 7 comments
Open

Uncaught RuntimeError: memory access out of bounds #407

miranbrajsalate opened this issue Jan 21, 2025 · 7 comments

Comments

@miranbrajsalate
Copy link

miranbrajsalate commented Jan 21, 2025

Hi @mkkellogg, hope you're doing well 🤞

I've stumbled upon an issue where one of the splats I'm using cannot be loaded using the Viewer class. The simplest repro steps are to spin up the viewer demo, select the .ply file and select View. The viewer's spinner enters the "Processing" mode and stays there forever.

The console itself displays the following message:

Image

So this seems to break somewhere in the src\worker\sorter.cpp file. The commit which started breaking the ability to load the splat is 64e9826db08f4ba9a80586dce9eb7d596ce96ac8 (previous commits can load the splat), but I'm really not that well versed in the viewer's code to make adjustments. Also, what I've noticed is that the previous commits which loaded the splat, loaded it way too small (the exact scale is around 10-20 times larger).

Would you be able to take a look please? It'd be greatly appreciated.

I'm also attaching the splat file for reference.

splat.zip

@cyango
Copy link

cyango commented Jan 22, 2025

Tested your splat at my end, and indeed getting the same error.

@mkkellogg
Copy link
Owner

I can also reproduce the bug on my end, so I'll spend some time looking into it. For now you can set the Viewer option integerBasedSort to false and I think that should fix it.

@miranbrajsalate
Copy link
Author

Hey @mkkellogg , setting integerBasedSort works, thank you for the suggestion! Now, this might not be relevant to the issue at hand, but I also noticed that the onProgress callback doesn't get called with progress updates when loading multiple splats given the code below:

let splatScenesOptions = [];
const commonSplatOptions = {
    splatAlphaRemovalThreshold: 1,
    format: data.format
};
if (data.environmentUrl) {
    splatScenesOptions.push({
        ...commonSplatOptions,
        path: data.environmentUrl
    });
}
splatScenesOptions.push({
    ...commonSplatOptions,
    path: data.pointCloudUrl
});

viewer.addSplatScenes(splatScenesOptions, false, onSplatDownloadProgress)
.then(() => {
    onSplatDownloadProgress(100, 'Done', 2);
})
.catch((error: Error) => {
    console.error('Error:', error);
});

but it works if we're loading a single splat only like so:

viewer.addSplatScene(data.pointCloudUrl, {
    splatAlphaRemovalThreshold: 1,
    showLoadingUI: false,
    format: data.format,
    onProgress: onSplatDownloadProgress,
});

I can reproduce the issue in v0.4.5 and v0.4.6. Should I open up a new issue for this? It might somewhat be related to #408 though.

@mkkellogg
Copy link
Owner

@miranbrajsalate What kind of files are you trying to load? When I load multiple .ply or .ksplat files using addSplatScenes(). Also, are you using the standard Viewer or DropInViewer ?

@miranbrajsalate
Copy link
Author

Hey @mkkellogg , sorry for the late reply, I've missed the email notification for some reason. The viewer.addSplatScenes issue I mentioned was my fault as I've been using the DropInViewer which doesn't accept that parameter and propagates the loading to the Viewer with undefined for that callback. So it was a false alarm, but probably something to potentially enhance down the road.

I was testing with both .ply and .ksplat files but, as mentioned, I was using the DropInViewer :)

@mkkellogg
Copy link
Owner

@miranbrajsalate Glad to hear you got it figured out :) As for the memory access out of bounds issues, I have a fix in the dev branch, can you see if it works for you?

@miranbrajsalate
Copy link
Author

Hey @mkkellogg , I've tested the dev branch with the splat from the top of the thread and it worked like a charm, thanks a bunch 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants