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

Heap corruption happens #1366

Closed
ohlidalp opened this issue Aug 15, 2017 · 7 comments
Closed

Heap corruption happens #1366

ohlidalp opened this issue Aug 15, 2017 · 7 comments

Comments

@ohlidalp
Copy link
Member

ohlidalp commented Aug 15, 2017

To laymen: heap corruption is a problem with dynamic RAM allocation and practically means: there's a bug somewhere in RoR which trashes our data in RAM, it's extra hard to find and it can theoretically crash RoR anytime for anybody 😟

Links:

I'm trying to use Microsoft Application Verifier to track it down, but I'm getting stuck on renderer init - both renderers exhibit some memory issues which halt the AppVerifier.

@tritonas00
Copy link
Collaborator

So you can reproduce the crash with opengl renderer?

@ohlidalp
Copy link
Member Author

ohlidalp commented Aug 15, 2017

@tritonas00 Nope, miniredmars spawns OK for me with OpenGL. But I'm getting other weird crashes.

UPDATE: I just ran my OGRE testbed application () with the same debug tool --> Same output!

@tritonas00
Copy link
Collaborator

Same output!

Nice, now you don't need to search the whole RoR 😄

ohlidalp added a commit to ohlidalp/rigs-of-rods that referenced this issue Aug 15, 2017
cannot test, crashing due to heap corruption
see RigsOfRods#1366
ohlidalp added a commit to ohlidalp/ogre-imgui-testbed that referenced this issue Aug 15, 2017
@ohlidalp
Copy link
Member Author

ohlidalp commented Aug 16, 2017

It turned out a lot of the heap corruption issues with my "unlimited-nb" were my fault - I simply allocated less memory than was needed. There are still mysterious crashes going on, but it's not as freaky anymore.

@tritonas00
Copy link
Collaborator

The proposed solution here #1256 (comment) fixes the miniredmars issue here also.

@ohlidalp
Copy link
Member Author

ohlidalp commented Sep 11, 2017

@tritonas00 The proposed solution here #1256 (comment) fixes the miniredmars issue here also.

Looks like all this breakage started with my recent refactor: 8eeb060, but there are 2 possible scenarios:

  • Either the bad addressing was there from the start, but it only became a problem after the refactor - I changed data layout and removed several unused slabs of dynamically allocated memory.
  • Or, I simply made a mistake during the refactor and introduced the adressing bug.

I need to take a close look, and I'm that won't happen anytime soon (busy).

Anyway, @Bob-Z @tritonas00 Thanks a lot for testing!

@ohlidalp
Copy link
Member Author

ohlidalp commented Dec 19, 2017

Closing as resolved:

  • There was a bug in 'wheels[2]' - if it had odd number of rays, memory corruption happened. This was causing Miniredmars map to crash: Crash on loading miniredmars map #1256 (comment) - Fixed.
  • When removing the N/B limits, I made several bugs in memory size calculation, causing more corruption. Fixed.

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

3 participants