URL: <http://savannah.gnu.org/bugs/?33125>
Summary: make fails building android build environment due to memory corruption Project: make Submitted by: mshopf Submitted on: Tue 19 Apr 2011 01:37:36 PM GMT Severity: 3 - Normal Item Group: Bug Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any Component Version: 3.82 Operating System: None Fixed Release: None Triage Status: None _______________________________________________________ Details: Building android build environment as described in http://source.android.com/source/download.html fails due to a glibc free() error. The bugs seems well known, the build system in fact tests for the make version and fails for versions != 3.81, and the wiki describes 3.82 to be non-working. Testing with valgrind shows some memory corruption: ==13108== Invalid write of size 8 ==13108== at 0x40BFAD: func_sort (function.c:1159) ==13108== by 0x40CE76: expand_builtin_function (function.c:2164) ==13108== by 0x40D1C0: handle_function (function.c:2273) ==13108== by 0x40692D: variable_expand_string (expand.c:263) ==13108== by 0x406E99: variable_expand (expand.c:429) ==13108== by 0x407004: variable_expand_for_file (expand.c:477) ==13108== by 0x4072B5: allocated_variable_expand_for_file (expand.c:574) ==13108== by 0x406FC4: expand_argument (expand.c:458) ==13108== by 0x40D07D: handle_function (function.c:2241) ==13108== by 0x40692D: variable_expand_string (expand.c:263) ==13108== by 0x406E99: variable_expand (expand.c:429) ==13108== by 0x407004: variable_expand_for_file (expand.c:477) The string that is to be tokenized in func_sort() apparently contains non-space/tab whitespace. Patch attached. Though I have to remark that I find the use of two completely different approaches to a) count required array entries and b) fill the array entries in function.c:func_sort() slightly disturbing. Without additional assert()s this just calls for trouble. Question would be how to handle this correctly. I'd suggest the use of find_next_token() for counting as well. I can create an additional(!) patch for that if that seems fit. _______________________________________________________ File Attachments: ------------------------------------------------------- Date: Tue 19 Apr 2011 01:37:37 PM GMT Name: make-fix_whitespace_tokenization.diff Size: 864B By: mshopf Patch to fix whitespace handling in tokenization. <http://savannah.gnu.org/bugs/download.php?file_id=23274> _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?33125> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/ _______________________________________________ Bug-make mailing list Bug-make@gnu.org http://lists.gnu.org/mailman/listinfo/bug-make