Bug 771705

Summary: infinite loop while parsing Makefile
Product: [Fedora] Fedora Reporter: Sami Farin <hvtaifwkbgefbaei>
Component: makeAssignee: Patsy Griffin <pfrankli>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 19CC: pmachata
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-17 14:01:41 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
test Makefile none

Description Sami Farin 2012-01-04 17:32:25 UTC
Description of problem:

infinite loop while parsing Makefile:

$ softlimit -t 5 make -d love
GNU Make 3.82
Built for x86_64-unknown-linux-gnu
Copyright (C) 2010  Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Reading makefile `Makefile'...
CPU time limit exceeded
$

Version-Release number of selected component (if applicable):
3.82-8

How reproducible:
100%

Steps to Reproduce:
1. make
2.
3.
  
Actual results:
infinite loop

Expected results:
something else happening

Additional info:
attached short testcase from mplayer/tests/Makefile

Comment 1 Sami Farin 2012-01-04 17:32:59 UTC
Created attachment 550738 [details]
test Makefile

Comment 2 Petr Machata 2012-01-04 18:14:55 UTC
I can't seem to be able to reproduce this.  Both with your snippet or with the original makefile in mplayer/tests, even after I configure and make mplayer.  In both cases I'm getting this:

$ time ./make -f ~/tmp/infloop.mk love
make: *** No rule to make target `love'.  Stop.

real	0m0.014s
user	0m0.004s
sys	0m0.011s

This happens locally (but with rawhide make) as well as in rawhide mock.  The presence of -d makes no difference.  Please provide self-contained test case.

Comment 3 Sami Farin 2012-01-04 19:52:28 UTC
It was a self-contained test case.

(gdb) bt
#0  0x0000000000419afe in next_token (
    s=0x7fffd900fb6e ":xim::0.0-safari.md5 res/lib/libpcreposix.so.0.0.0.md5 res/lib/libusb-1.0.so.0.md5 res/lib/libreadline.so.6.2.md5 res/lib/libpopt.so.0.0.0.md5 res/lib/libgio-2.0.so.0.md5 res/lib/libusb-0.1.so.4.md5 r"...) at misc.c:525
#1  0x000000000041fd7c in parse_file_seq (stringp=0x7fffffffb218, size=16, stopchar=58, prefix=0x0, flags=4) at read.c:3034
#2  0x000000000041bf1a in eval (ebuf=0x7fffffffb3b0, set_default=1) at read.c:1159
#3  0x000000000041a4ee in eval_makefile (filename=0x7ffff16021cc "Makefile", flags=0) at read.c:423
#4  0x0000000000419fa7 in read_all_makefiles (makefiles=0x0) at read.c:257
#5  0x00000000004155ad in main (argc=3, argv=0x7fffffffcf88, envp=0x7fffffffcfa8) at main.c:1659

(gdb) d32
Dump of assembler code from 0x41a4ce to 0x41a50e:
   0x000000000041a4ce <eval_makefile+916>:	and    %eax,(%rax)
   0x000000000041a4d0 <eval_makefile+918>:	mov    0x4(%rsp),%eax
   0x000000000041a4d4 <eval_makefile+922>:	and    $0x1,%eax
   0x000000000041a4d7 <eval_makefile+925>:	test   %eax,%eax
   0x000000000041a4d9 <eval_makefile+927>:	sete   %al
   0x000000000041a4dc <eval_makefile+930>:	movzbl %al,%edx
   0x000000000041a4df <eval_makefile+933>:	lea    0x10(%rsp),%rax
   0x000000000041a4e4 <eval_makefile+938>:	mov    %edx,%esi
   0x000000000041a4e6 <eval_makefile+940>:	mov    %rax,%rdi
   0x000000000041a4e9 <eval_makefile+943>:	callq  0x41a85a <eval>
=> 0x000000000041a4ee <eval_makefile+948>:	mov    0x60(%rsp),%rax
   0x000000000041a4f3 <eval_makefile+953>:	mov    %rax,0x21ac56(%rip)        # 0x635150 <reading_file>
   0x000000000041a4fa <eval_makefile+960>:	mov    0x30(%rsp),%rax
   0x000000000041a4ff <eval_makefile+965>:	mov    %rax,%rdi
   0x000000000041a502 <eval_makefile+968>:	callq  0x401f20 <fclose@plt>
   0x000000000041a507 <eval_makefile+973>:	mov    0x20(%rsp),%rax
   0x000000000041a50c <eval_makefile+978>:	mov    %rax,%rdi
End of assembler dump.

(gdb) p *reading_file 
$6 = {filenm = 0x7ffff16021cc "Makefile", lineno = 6}

...
21:51:43.519135 stat("/sc/Boater.jpg", {st_dev=makedev(8, 24), st_ino=1229234756, st_mode=S_IFREG|0644, st_nlink=1, st_uid=500, st_gid=500, st_blksize=4096, st_blocks=96, st_size=48879, st_atime=2004/01/19-18:46:47, st_mtime=2004/01/19-18:46:47, st_ctime=2010/03/18-23:43:53}) = 0 <0.000019>
21:51:43.519442 brk(0)                  = 0x1e45000 <0.000010>
21:51:43.519492 brk(0x1e66000)          = 0x1e66000 <0.000011>
21:51:43.519774 brk(0)                  = 0x1e66000 <0.000010>
21:51:43.519918 brk(0x1e87000)          = 0x1e87000 <0.000011>
21:51:43.521008 brk(0)                  = 0x1e87000 <0.000013>
21:51:43.521067 brk(0)                  = 0x1e87000 <0.000009>
21:51:43.521117 brk(0x1e73000)          = 0x1e73000 <0.000018>
21:51:43.521190 brk(0)                  = 0x1e73000 <0.000009>
21:51:43.521571 stat("./fatetest", 0x7fff15370a60) = -1 ENOENT (No such file or directory) <0.000011>
21:51:43.521711 brk(0)                  = 0x1e73000 <0.000010>
21:51:43.521761 brk(0x1e94000)          = 0x1e94000 <0.000011>
21:51:43.522025 mmap(NULL, 208896, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fda2577d000 <0.000012>
21:51:43.522119 brk(0)                  = 0x1e94000 <0.000010>
21:51:43.522169 brk(0)                  = 0x1e94000 <0.000009>
21:51:43.522218 brk(0x1e88000)          = 0x1e88000 <0.000013>
21:51:43.522271 brk(0)                  = 0x1e88000 <0.000009>
21:51:43.522366 brk(0)                  = 0x1e88000 <0.000010>
21:51:43.522416 brk(0)                  = 0x1e88000 <0.000009>
21:51:43.522465 brk(0x1e73000)          = 0x1e73000 <0.000018>
21:51:43.522523 brk(0)                  = 0x1e73000 <0.000013>
21:51:43.522588 munmap(0x7fda2577d000, 208896) = 0 <0.000019>
21:51:43.522765 brk(0)                  = 0x1e73000 <0.000010>
21:51:43.522814 brk(0x1ead000)          = 0x1ead000 <0.000010>

and hangs here

Comment 4 Fedora End Of Life 2013-04-03 17:05:44 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19

Comment 5 Fedora Admin XMLRPC Client 2013-09-05 01:11:05 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 6 Fedora End Of Life 2015-01-09 16:55:37 UTC
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 7 Fedora End Of Life 2015-02-17 14:01:41 UTC
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.