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

Fix crash when build() fails with binary program #71

Closed
kylelutz opened this issue Mar 19, 2014 · 2 comments
Closed

Fix crash when build() fails with binary program #71

kylelutz opened this issue Mar 19, 2014 · 2 comments
Labels

Comments

@kylelutz
Copy link
Collaborator

When compiling with BOOST_COMPUTE_DEBUG_KERNEL_COMPILATION, calls to build() which fail will cause the program source and build log to be printed to stderr.

However, when the program was loaded from a binary no source exists and thus the call to source() made by the debugging output will result in an exception being thrown. This case should be checked for and reported instead of crashing with the exception.

@kylelutz kylelutz added the bug label Mar 19, 2014
@f-koehler
Copy link
Contributor

I have a question about this issue. Is crashing not what the library should do? If building with a binary fails this indicates that something went wrong, for example that the binary was not compatible, etc. Is there a scenario where we want to continue the execution of the host program? Or do you mean that we don't want the exception to be thrown by get_info<std::string>(CL_PROGRAM_SOURCE) which fails to fetch the source code that is not available? In that case one could just catch exceptions of source() and then throw a new one indicating that no source code is available, like here (something went wrong with my code indentation, I read the rules).

Maybe you need to clarify what you mean.

@kylelutz
Copy link
Collaborator Author

kylelutz commented Aug 3, 2014

Thanks for looking into this!

If program::create_with_binary() or program::build() fails, we should throw an exception (and definitely never crash). I think all that would be needed is to try to call program::source() and not print out anything if it's a binary program. And perhaps program::source() should be robust to binary programs and return an empty string in that case.

However, I only saw this once haven't been able to reproduce it since (could have just been something weird going on with my system). I'll close this for now, but if you (or anyone) is able to reproduce this, please re-open with more information about the crash.

@kylelutz kylelutz closed this as completed Aug 3, 2014
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

2 participants