Skip to content

Commit d1d6e65

Browse files
committed
linux: show mountinfo if unable to write core file
Find out what kind of weird situation prevents this
1 parent 577a067 commit d1d6e65

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ci_core_dumper/linux.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,14 +337,18 @@ def dump2(pid, gdb, extra_cmds):
337337
# write the core file into some temporary storage in the target mount NS
338338
for tmpdir in ('/tmp', '/var/tmp', '/dev/shm'):
339339
corefile = os.path.join(tmpdir, 'core.ccd.%d'%pid)
340+
assert not os.path.exists(corefile), corefile
340341
try:
341342
OF = open(corefile, 'wb')
342343
break
343-
except:
344-
print('Unable to write core file to %s'%corefile)
344+
except Exception as e:
345+
print('Unable to write core file to %s : %r'%(corefile, e))
345346
continue
346347
else:
347348
print('Unable to store core file in target FS')
349+
with open('/proc/{}/mountinfo'.format(pid), 'r') as F:
350+
for L in F.readlines():
351+
print(' ', L.rstrip())
348352
sys.exit(1)
349353

350354
print('Wrote core file to %s'%corefile)

0 commit comments

Comments
 (0)