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

Memory corruption #150

Open
eholk opened this issue Apr 28, 2015 · 0 comments
Open

Memory corruption #150

eholk opened this issue Apr 28, 2015 · 0 comments
Labels

Comments

@eholk
Copy link
Owner

eholk commented Apr 28, 2015

This is non-deterministic, but we're starting to see it in a couple of test cases and programs now (e.g. #147).

One that shows it pretty reliably is test/read-file.kfc. Here is a stack trace for one of the failures:

* thread #1: tid = 0x1451166, 0x00007fff8ba3aa90 libc++abi.dylib`__dynamic_cast + 33, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0xfffffffffffffff0)
  * frame #0: 0x00007fff8ba3aa90 libc++abi.dylib`__dynamic_cast + 33
    frame #1: 0x00007fff91ba8e38 OpenCL`___lldb_unnamed_function1037$$OpenCL + 96
    frame #2: 0x00007fff91ba8e96 OpenCL`___lldb_unnamed_function1039$$OpenCL + 14
    frame #3: 0x00007fff91ba9264 OpenCL`___lldb_unnamed_function1050$$OpenCL + 62
    frame #4: 0x00007fff91ba92b0 OpenCL`___lldb_unnamed_function1052$$OpenCL + 14
    frame #5: 0x00007fff91b8e5c5 OpenCL`clReleaseProgram + 23
    frame #6: 0x00007fff8305f8cd libsystem_c.dylib`__cxa_finalize_ranges + 322
    frame #7: 0x00007fff8305fbd0 libsystem_c.dylib`exit + 55
    frame #8: 0x00007fff869425d0 libdyld.dylib`start + 8
    frame #9: 0x00007fff869425c9 libdyld.dylib`start + 1

I would guess we have a race condition in how OpenCL resources are shutting down. Maybe we aren't reference counting correctly somewhere.

@eholk eholk added the Bug label Apr 28, 2015
@eholk eholk mentioned this issue Apr 28, 2015
eholk added a commit that referenced this issue Apr 28, 2015
This avoids some valgrind errors, and should hopefully help reduce memory corruption (Issue #150)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant