The following patch is needed to fix memory leaks when building beignet, e.g., if you want to build beignet with -fsanitize=address. diff --git a/backend/src/gbe_bin_generater.cpp b/backend/src/gbe_bin_generater.cpp index 8225d4a..7ed353a 100644 --- a/backend/src/gbe_bin_generater.cpp +++ b/backend/src/gbe_bin_generater.cpp @@ -226,6 +226,7 @@ void program_build_instance::serialize_program(void) throw(int) size_t bin_length = gbe_program_serialize_to_binary((gbe_program)gbe_prog, &llvm_binary, 1); oss.write(llvm_binary, bin_length); sz += bin_length; + free(llvm_binary); } for (size_t i = 0; i < sz; i++) { @@ -258,6 +259,7 @@ void program_build_instance::serialize_program(void) throw(int) size_t bin_length = gbe_program_serialize_to_binary((gbe_program)gbe_prog, &llvm_binary, 1); ofs.write(llvm_binary, bin_length); sz+=bin_length; + free(llvm_binary); } }
Thanks for you patch, it looks good to me. Can you use send the patch(using command git format-patch -s) to mailing list.
Hi Frank, I have help you send a patch to the maillist: https://lists.freedesktop.org/archives/beignet/2016-May/007507.html Hope you don't mind that. Thanks Xiuli
Hi Xiuli, no problem, thanks. I was just extremely busy, otherwise I would have sent that patch to the mailing list.
Hi Frank, Then I will close this bug, and I have send patches for your other two bugs. You can have a look at them. Thanks Xiuli
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.