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

Segmentation fault related to decals when switching sessions #326

Open
jspjutNV opened this issue Sep 27, 2021 · 0 comments
Open

Segmentation fault related to decals when switching sessions #326

jspjutNV opened this issue Sep 27, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@jspjutNV
Copy link
Contributor

In investigating #323 I noticed a crash I've seen many times before that happens intermittently when switching sessions. This memory fault seems related to miss decals and the way we clear the memory for them with it not being managed and cleaned up correctly. While it doesn't reproduce every time, typically if you set up a session with decals allowed, fire enough times to get a few decals up, then open the menu and switch sessions, I tend to get a crash at least once in 5 attempts. I'd say roughly half of my attempts to do something like this crash.

For more details, the code that faults is the following from Weapon.cpp on the line with m_scene->remove(m_currentMissDecals.pop());:

void Weapon::clearDecals(bool clearHitDecal) {
	while (m_currentMissDecals.size() > 0) {				// Remove and clear miss decals
		m_scene->remove(m_currentMissDecals.pop());
	}
	m_missDecalTimesRemaining.clear();						// Clear miss decal timeouts

	if (clearHitDecal && notNull(m_hitDecal)) {				// Clear hit decal (if one is present)
		m_scene->remove(m_hitDecal);
	}
}

This isn't the only type of crash I've seen and occasionally it claims that an Array larger than 2^32 isn't allowed.

@jspjutNV jspjutNV added the bug Something isn't working label Sep 27, 2021
@jspjutNV jspjutNV added this to the v21.11.01 milestone Sep 27, 2021
@jspjutNV jspjutNV added this to To Do in Issue Tracking via automation Sep 27, 2021
@jspjutNV jspjutNV modified the milestones: v21.11.01, v22.01.01 Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

1 participant