Project

General

Profile

Actions

Bug #6848

closed

savecore crashes if it can't open METRICS.CSV

Added by Robert Mustacchi over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Category:
cmd - userland programs
Start date:
2016-03-30
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

For various reasons I found a case where savecore would always crash. If we look at the core:

$ savecore -vf vmdump.0 .
savecore: System dump time: Mon Mar 30 22:05:39 2015

savecore: saving system crash dump in ./{unix,vmcore}.0
Constructing namelist ./unix.0
Constructing corefile ./vmcore.0
 0:29 100% done: 3105392 of 3105392 pages saved
32085 (1%) zero pages were not written
Segmentation Fault (core dumped)
[rmustacchi@5T4M842 (us-east-3b) /var/crash/volatile]$ mdb /zones/global/cores/core.savecore.9758 
Loading modules: [ libc.so.1 ld.so.1 ]
> $C
ffffdf7fffdff8b0 libc.so.1`fprintf+0xb6(0, 413b41)
ffffdf7fffdffba0 main+0x594()
ffffdf7fffdffbb0 _start+0x6c()
> 413b41/s
0x413b41:       [[[[,,,

We see from the code that this is the first fprintf related to METRICS.CSV and we don't check if we open that FILE * at all. Quite helpful behavior.

Actions #1

Updated by Electric Monk over 6 years ago

  • Status changed from New to Closed

git commit 8d222d81dc5733b87153c20f2fbf47c509942f94

commit  8d222d81dc5733b87153c20f2fbf47c509942f94
Author: Robert Mustacchi <rm@joyent.com>
Date:   2016-04-08T14:39:39.000Z

    6848 savecore crashes if it can't open METRICS.CSV
    Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
    Reviewed by: Jason King <jason.brian.king@gmail.com>
    Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
    Approved by: Richard Lowe <richlowe@richlowe.net>

Actions

Also available in: Atom PDF