[bug #45275] 4.0+ core dumps with long .PHONY targets via variables

2015-07-12 Thread Paul D. Smith
Update of bug #45275 (project make):

  Status:None = Fixed  
 Assigned to:None = psmith 
 Open/Closed:Open = Closed 
   Fixed Release:None = SCM

___

Follow-up Comment #2:

I pushed a fix for this to Git.  Thanks for the report.

___

Reply to this item at:

  http://savannah.gnu.org/bugs/?45275

___
  Message sent via/by Savannah
  http://savannah.gnu.org/


___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


Re: [bug #45275] 4.0+ core dumps with long .PHONY targets via variables

2015-06-09 Thread Edward Welbourne
 4. Running under gdb I was able to get a stack trace showing the eventual seg
 fault occurring in xcalloc(). The trace is below.

This almost certainly means that, before this point, something over-ran
the end of a memory buffer and trampled malloc's data structures.  So
the first line of enquiry to pursue is a buffer over-run in processing
of the .PHONY directive.

Eddy.

___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


[bug #45275] 4.0+ core dumps with long .PHONY targets via variables

2015-06-08 Thread David Boyce
Follow-up Comment #1, bug #45275 (project make):

Sorry, ignore the via variables in the title string.

___

Reply to this item at:

  http://savannah.gnu.org/bugs/?45275

___
  Message sent via/by Savannah
  http://savannah.gnu.org/


___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


[bug #45275] 4.0+ core dumps with long .PHONY targets via variables

2015-06-08 Thread David Boyce
URL:
  http://savannah.gnu.org/bugs/?45275

 Summary: 4.0+ core dumps with long .PHONY targets via
variables
 Project: make
Submitted by: boyski
Submitted on: Mon 08 Jun 2015 01:45:44 PM GMT
Severity: 3 - Normal
  Item Group: Bug
  Status: None
 Privacy: Public
 Assigned to: None
 Open/Closed: Open
 Discussion Lock: Any
   Component Version: 4.1
Operating System: POSIX-Based
   Fixed Release: None
   Triage Status: None

___

Details:

I've isolated a bug in which make 4.x segfaults when a phony target name is
longer than 8162 characters. I'll attach the test case. I haven't tracked down
the coding problem but I do have some useful data:

1. This is a regression: it does not occur in 3.82 but does in 4.0 and 4.1.

2. At least in my environment it occurs when the target is 8163 characters or
longer. This number is not a factor of 2 though it's fairly close to 8192.

3. Interestingly, if the phony target is converted to a real target e.g.

long string: ; date

Then the result is make: stat long string: File name too long

(with exit status of 0 which may be an ancillary bug). Technically a phony
target shouldn't be subject to the same length limits as an actual target
since nothing is imposed by the OS/filesystem. It may be acceptable to impose
those limits anyway but the core dump shouldn't occur.

4. Running under gdb I was able to get a stack trace showing the eventual seg
fault occurring in xcalloc(). The trace is below.

Program received signal SIGSEGV, Segmentation fault.
0x003a17a799b3 in _int_malloc () from /lib64/libc.so.6
(gdb) bt
#0  0x003a17a799b3 in _int_malloc () from /lib64/libc.so.6
#1  0x003a17a7a5a6 in calloc () from /lib64/libc.so.6
#2  0x0041ca6a in xcalloc (size=136) at misc.c:231
#3  0x0040aea5 in enter_file (name=0x65a4b1 'X' repeats 2048
times...) at file.c:185
#4  0x0040bdaf in enter_prereqs (deps=0x654e50, stem=0x0) at
file.c:538
#5  0x00422072 in record_files (filenames=0x663920, pattern=0x0,
pattern_percent=0x0, depstr=0x6659c0 h\365\330\027:,
cmds_started=1, commands=0x663850 \030\366\330\027:, commands_idx=0,
two_colon=0, prefix=9 '\t', flocp=0x7fff6880)
at read.c:2000
#6  0x0041fc22 in eval (ebuf=0x7fff6a60, set_default=1) at
read.c:1013
#7  0x0041e958 in eval_makefile (filename=0x65a47d Makefile,
flags=0) at read.c:445
#8  0x0041e3b7 in read_all_makefiles (makefiles=0x0) at read.c:262
#9  0x00419434 in main (argc=2, argv=0x7fffc688,
envp=0x7fffc6a0) at main.c:1895
#10 0x003a17a1ecdd in __libc_start_main () from /lib64/libc.so.6
#11 0x00405f49 in _start ()



___

File Attachments:


---
Date: Mon 08 Jun 2015 01:45:44 PM GMT  Name: Makefile.gz  Size: 80B   By:
boyski

http://savannah.gnu.org/bugs/download.php?file_id=34178

___

Reply to this item at:

  http://savannah.gnu.org/bugs/?45275

___
  Message sent via/by Savannah
  http://savannah.gnu.org/


___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make