SIGSEGV Error

Good day,

I am making a game for class, but I am seemingly randomly receiving a SIGSEGV error. Does anyone know how I can fix this?

Here is my code for reference: https://snap.berkeley.edu/project?user=jrp30074&project=eCard (Click on the arcade machine, up/down arrow to move, space to shoot)

Hello! Could you please tell us what the error says? I am on a mobile at the moment so I can't check it myself. :frowning: (And we can only give you general ideas.)

The tab crashes and Chrome gives a SIGSEGV browser error (meaning there was a memory access violation).

I do not get any error on my phone.

It only happens about a 1/5 of the time when playing through the full game

SIGSEGV errors occur only in low-level programming languages when you give an invalid memory reference, there's a segfault or when you are trying to use too much memory.

int array[10];
std::cout<<array[11];
//Error
char* ptr = "Hello";
*ptr = "Changed";
//Error

Considering that Javascript is high-level and low-level things like this are automatically handled means that it's probably an internal browser error. Maybe you're trying to use too much memory?

2 Likes

Yeah that's what I was thinking; in terms of memory, I am making a lot of clones so it may be messing up with that; though I do need all those clones. Chrome's task manager shows normal memory levels (< 200,000K), so I theorize it is probably using an invalid memory reference. Anyone see a place in my code that could be causing that? It may just be Snap's internals

It sounds like a problem with Chrome's internals, not Snap!'s. JavaScript should not be able to cause segfaults.

2 Likes

How many clones is "a lot"? 1000? That really shouldn't crash Chrome. Could you please choose "About" from the Snap! icon :snap: menu and check the version? We're on 6.1.4. If that's not what you see, clear your cache.

P.S. Welcome to the forum, despite the unfortunate reason for it.

Hi bh, it is only about ~40 clones max at one time. Snap version shows 6.1.4. I'm using chromium-84.0.4147.135-1 on Manjaro so it may be relating to that if it isn't crashing for anyone else. It doesn't happen often enough to be breaking.

P.S. No worries; loving Snap!

Chrome bug then
you might need to downgrade to a stable chrome version