Created
June 14, 2013 04:37
-
-
Save nico/5779489 to your computer and use it in GitHub Desktop.
repro for ninja issue #595
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Nicos-MacBook-Pro:repro thakis$ cat repro.py | |
#!/usr/bin/env python | |
import ninja_syntax | |
n = ninja_syntax.Writer(open('build.ninja', 'w')) | |
n.rule(name='cxx', | |
command='clang++ -c $in -o $out -MF $out.d -MMD', | |
depfile='$out.d', | |
deps='gcc') | |
def hname(i): return '%d.h' %i | |
def ccname(i): return '%d.cc' %i | |
def oname(i): return '%d.o' %i | |
N = 1000 | |
incs = '\n'.join(['#include "%s"' % hname(i) for i in range(N)]) | |
for i in range(N): | |
h = hname(i) | |
cc = ccname(i) | |
open(h, 'w').write('extern int a%d;' % i) | |
open(cc, 'w').write(incs + '\nint a%d = %d;' % (i, i)) | |
n.build(oname(i), 'cxx', inputs=cc) | |
Nicos-MacBook-Pro:repro thakis$ PYTHONPATH=../misc ./repro.py | |
Nicos-MacBook-Pro:repro thakis$ (ninja -j 100&) ; ninja -j100& | |
[1] 23029 | |
Nicos-MacBook-Pro:repro thakis$ ninja: warning: bad deps log signature or version; starting over | |
[1000/1000] clang++ -c 983.cc -o 983.o -MF 983.o.d -MMD | |
[1000/1000] clang++ -c 976.cc -o 976.o -MF 976.o.d -MMD | |
[1]+ Done ninja -j100 | |
Nicos-MacBook-Pro:repro thakis$ ninja | |
[70/70] clang++ -c 960.cc -o 960.o -MF 960.o.d -MMD | |
Nicos-MacBook-Pro:repro thakis$ ninja | |
ninja: no work to do. | |
Nicos-MacBook-Pro:repro thakis$ (ninja -j 100&) ; ninja -j100& | |
[1] 27184 | |
Nicos-MacBook-Pro:repro thakis$ ninja: no work to do. | |
ninja: no work to do. | |
[1]+ Done ninja -j100 | |
Nicos-MacBook-Pro:repro thakis$ ninja | |
ninja: no work to do. | |
Nicos-MacBook-Pro:repro thakis$ rm *.o | |
Nicos-MacBook-Pro:repro thakis$ (ninja -j 100&) ; ninja -j100& | |
[1] 27195 | |
[1000/1000] clang++ -c 974.cc -o 974.o -MF 974.o.d -MMD | |
[1000/1000] clang++ -c 931.cc -o 931.o -MF 931.o.d -MMD | |
[1]+ Done ninja -j100 | |
Nicos-MacBook-Pro:repro thakis$ ninja | |
Recompacting log... | |
Segmentation fault: 11 | |
Nicos-MacBook-Pro:repro thakis$ gdb ../ninja | |
GNU gdb 6.3.50-20050815 (Apple version gdb-1824) (Wed Feb 6 22:51:23 UTC 2013) | |
Copyright 2004 Free Software Foundation, Inc. | |
GDB is free software, covered by the GNU General Public License, and you are | |
welcome to change it and/or distribute copies of it under certain conditions. | |
Type "show copying" to see the conditions. | |
There is absolutely no warranty for GDB. Type "show warranty" for details. | |
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries ... done | |
(gdb) run | |
Starting program: /Users/thakis/src/ninja/ninja | |
Reading symbols for shared libraries ++............................. done | |
Program received signal EXC_BAD_ACCESS, Could not access memory. | |
Reason: KERN_INVALID_ADDRESS at address: 0x000000039d305718 | |
DepsLog::Load (this=0x7fff5fbff918, path=@0x7fff5fbff9a8, state=0x7fff5fbff7d0, err=0x7fff5fbff988) at src/deps_log.cc:201 | |
201 deps->nodes[i] = nodes_[deps_data[i]]; | |
(gdb) bt | |
#0 DepsLog::Load (this=0x7fff5fbff918, path=@0x7fff5fbff9a8, state=0x7fff5fbff7d0, err=0x7fff5fbff988) at src/deps_log.cc:201 | |
#1 0x00000001000016e8 in (anonymous namespace)::real_main () at /Users/thakis/src/ninja/src/ninja.cc:749 | |
(gdb) The program is running. Exit anyway? (y or n) y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment