Bug 606389 - when minidump_stack fails, show its error messages and/or exit code. r=ted, a=npotb

This commit is contained in:
Jesse Ruderman 2010-11-06 13:30:32 -07:00
Родитель 690c729115
Коммит 82fe1929dc
1 изменённых файлов: 17 добавлений и 5 удалений

Просмотреть файл

@ -115,10 +115,18 @@ def checkForCrashes(dumpDir, symbolsPath, testName=None):
for d in dumps:
log.info("PROCESS-CRASH | %s | application crashed (minidump found)", testName)
if symbolsPath and stackwalkPath and os.path.exists(stackwalkPath):
nullfd = open(os.devnull, 'w')
# eat minidump_stackwalk errors
subprocess.call([stackwalkPath, d, symbolsPath], stderr=nullfd)
nullfd.close()
p = subprocess.Popen([stackwalkPath, d, symbolsPath],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
(out, err) = p.communicate()
if len(out) > 3:
# minidump_stackwalk is chatty, so ignore stderr when it succeeds.
print out
else:
print "stderr from minidump_stackwalk:"
print err
if p.returncode != 0:
print "minidump_stackwalk exited with return code %d" % p.returncode
elif stackwalkCGI and symbolsPath and isURL(symbolsPath):
f = None
try:
@ -131,7 +139,11 @@ def checkForCrashes(dumpDir, symbolsPath, testName=None):
datagen, headers = multipart_encode({"minidump": f,
"symbols": symbolsPath})
request = urllib2.Request(stackwalkCGI, datagen, headers)
print urllib2.urlopen(request).read()
result = urllib2.urlopen(request).read()
if len(result) > 3:
print result
else:
print "stackwalkCGI returned nothing."
finally:
if f:
f.close()