[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #65324] Fix crash in disable_builtins.
From: |
Dmitry Goncharov |
Subject: |
[bug #65324] Fix crash in disable_builtins. |
Date: |
Fri, 16 Feb 2024 23:33:47 -0500 (EST) |
Follow-up Comment #1, bug#65324 (group make):
Make crashes when -r and MAKEFLAGS= are specified on the command line.
On startup make begins to process command line arguments. During processing of
"MAKEFLAGS=" make calls reset_makeflags, which in turn calls disable_builtins,
which dereferences null suffix_file.
$ ls
makefile
$ cat makefile
all:;
$ ~/src/gmake/make/m64/make -r MAKEFLAGS=
../src/main.c:3476:13: runtime error: member access within null pointer of
type 'struct file'
AddressSanitizer:DEADLYSIGNAL
=================================================================
==15066==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000088 (pc
0x560ed1b164e0 bp 0x7ffd870f7ee0 sp 0x7ffd870f7ed0 T0)
==15066==The signal is caused by a READ memory access.
==15066==Hint: address points to the zero page.
#0 0x560ed1b164e0 in disable_builtins ../src/main.c:3476
#1 0x560ed1b10e95 in reset_makeflags ../src/main.c:3098
#2 0x560ed1b712a9 in set_special_var ../src/variable.c:1325
#3 0x560ed1b72e89 in do_variable_definition ../src/variable.c:1693
#4 0x560ed1b746a7 in try_variable_definition ../src/variable.c:1889
#5 0x560ed1b103df in handle_non_switch_argument ../src/main.c:3015
#6 0x560ed1b110c7 in decode_switches ../src/main.c:3144
#7 0x560ed1b052ef in main ../src/main.c:1615
#8 0x7f1abca29d8f in __libc_start_call_main
../sysdeps/nptl/libc_start_call_main.h:58
#9 0x7f1abca29e3f in __libc_start_main_impl ../csu/libc-start.c:392
#10 0x560ed1a94654 in _start
(/home/dgoncharov/src/gmake/make/m64/make+0x14c654)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV ../src/main.c:3476 in disable_builtins
==15066==ABORTING
Aborted (core dumped)
$
This is a recent regression. Before a382ac6cd17eedf535407d29bcfc3cef04bbc3bc
this was not an issue, because MAKEFLAGS was not marked as special.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?65324>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/