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

Pure virtual function call on resources #23

Closed
baldurk opened this issue Mar 10, 2014 · 2 comments
Closed

Pure virtual function call on resources #23

baldurk opened this issue Mar 10, 2014 · 2 comments
Labels
Bug A crash, misbehaviour, or other problem Need More Info More information is needed from a user to work on this issue

Comments

@baldurk
Copy link
Owner

baldurk commented Mar 10, 2014

I don't have much information about this, it came in as a crash report so I don't have a fix yet.

It seems like possibly a bound render target is being released somehow while a pointer remains to it, so when unsetting it from the pipeline in the OMSetRenderTargets call a pure virtual function call is made.

If you see this bug please get in touch :).

@baldurk baldurk changed the title Pure virtual function call inside OMSetRenderTargets* Pure virtual function call on resources Jun 28, 2014
@baldurk
Copy link
Owner Author

baldurk commented Jun 28, 2014

I've had quite a number of crash reports on this, mostly all from what looks like the same game/engine so there must be some unique use-path that triggers this (albeit not regularly I don't think).

Something is causing the resources passed to IsBoundForWrite or ValidOutputMerger to cause pure virtual function calls when GetResource or GetDesc is called.

@baldurk
Copy link
Owner Author

baldurk commented Sep 24, 2014

I haven't seen crash reports on this for several months now. Given that I can't do any more without more information than those minidumps, I'm going to close this now and see if it resurfaces with v0.21.

@baldurk baldurk closed this as completed Sep 24, 2014
baldurk added a commit that referenced this issue Feb 2, 2017
* Two potential crashes here - one from the previous fix to #503, we
  would double-release a refcount on an object that was set for write.
  First we'd decrement the refcount when it was 'unbound', then again
  trying to unbind it for write because the slot wasn't NULL'd. This was
  just plain broken.
* The second more obscure one was when binding for read. If the external
  object had no other refcount than the one in the binding slot, then
  changing its binding would implicitly destroy it. However if the code
  was setting the same object back again (ie. with the pointer they had
  not reference to) then the refcount would drop to 0 then should be
  incremented again to 1 when it's re-bound. However because the count
  bounces off 0, the object is destroyed between being unbound and
  re-bound causing pure virtual calls and other crashes when we try to
  access it.
* The fix is first to check if we're binding something to its own slot
  and skip it. Second we need to keep the new objects ref'd at all times
  during the binding (in case we are e.g. performing an array bind which
  moves the 1-refcount object from slot 2 to slot 3. It would be unbound
  when processing slot 2, hit refcount 0, and then be added again when
  processing slot 3).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A crash, misbehaviour, or other problem Need More Info More information is needed from a user to work on this issue
Projects
None yet
Development

No branches or pull requests

1 participant