Commit Graph

86 Commits

Author SHA1 Message Date
christos
c3e11c3703 - avoid using globals where it is simple.
- simplify: only use stdio for output.
2013-05-13 18:44:11 +00:00
christos
ca11e1e667 factor out rawname() from dump, fsck, savecore. 2012-04-07 16:44:10 +00:00
christos
42d1e41665 print the missing flag if missing argument... 2011-09-13 19:55:28 +00:00
christos
7249eb3f75 - always print corrupted dump messages instead of silently failing
- don't require /var/crash to be specified, default to it
- determine and print the kernel name
- print all messages to syslog
2011-09-12 21:22:07 +00:00
joerg
693655118a static + __dead 2011-08-29 14:29:21 +00:00
dogcow
9098338f79 Instead of exiting with an obscure error message if -N /kernelname isn't
specified, blithely assume the kernel will consume around 20 megs.
2009-08-18 04:02:39 +00:00
lukem
fb63fbd0cc fix sign-compare issues 2009-04-06 12:32:30 +00:00
tls
ede5dc65a8 Fix savecore so it uses /dev/ksyms when it can (doesn't override libkvm
default).  Fixes misc/38425.
2009-03-21 19:32:44 +00:00
christos
118c87a6fe fix dev_t format. 2008-12-28 20:17:11 +00:00
ad
2df6131a64 Enable the faked ELF kernel by default, now that ksyms output works with
gdb. Makes it possible to do post-mortem debugging on a modular kernel.
2008-12-05 21:41:10 +00:00
ad
dc7ae0762f - Add code to produce a fake ELF kernel containing only symbol info. Done
by extracting ksyms state from the dump, so we have symbols for modules
  loaded at the time of the crash. If ksyms extraction fails, this falls
  back to the current behaviour of copying /netbsd.

- Leave it disabled for the moment: (1) we are about to branch (2) most
  tools understand the artificial kernel but gdb has trouble with it for
  some reason.
2008-10-20 10:34:54 +00:00
joerg
281bbad379 Explicitly check that the dump device is not the console, a tty or pty.
While the list is adhoc, the problems reported are always with
/dev/console. Adresses PR 38425 and similiar issues with Xen.
2008-10-09 13:59:50 +00:00
lukem
6543a91fea Remove the \n and tabs from the __COPYRIGHT() strings.
(Tweak some to use a consistent format.)
2008-07-20 01:20:21 +00:00
ad
76f153e120 sync() a couple of times to benefit diagnosis of sloppy kernel code that
crashes during boot to multiuser.
2008-04-20 23:40:31 +00:00
ad
73e694f404 Don't use the block device to read crashdumps, if possible. 2008-01-15 14:26:41 +00:00
pooka
3384f1f26e tyop: _time_seconf -> _time_second 2007-11-12 16:04:55 +00:00
christos
8539ad5cf5 from Anon Ymous: remove (void)&var; 2006-12-18 20:08:48 +00:00
christos
50b568b12d c99 initializers 2006-10-16 02:56:56 +00:00
kardel
e386d70092 accept either "time_second" or "time" as kernel timevariable in
order to support common userland in enviroments where
timecounter kernels and non timecounter kernel co-exist
(e.g. xen & i386)
2006-07-09 06:43:16 +00:00
kardel
75418af90c support timecounters (struct time gone, use time_second then) 2006-06-07 20:56:19 +00:00
hubertf
f500b89c3d Free some allocated memory in the failure case when trying to
fetch the panic string.

Fixes Coverity CID 1856.
2006-03-17 01:45:51 +00:00
dsainty
4b46224291 Added -n option, which tests for a present core but doesn't write it
to disk or clear it (does 'nothing').

http://mail-index.netbsd.org/tech-userlevel/2004/10/09/0000.html
2004-10-16 03:48:15 +00:00
tls
e8092c77bc Fix an integer overflow that prevented saving cores from machines with
more than 2GB of RAM.

"dumpsize" in the on-disk core header is in pages, but, unfortunately,
c.size in our kcore format is an unsigned 32-bit int, gross.

We sleaze it, using a 64-bit int internally here and handing it to
libkvm as a *signed* 32-bit int.  Won't always work, but shouldn't be
broken any worse than it is now, and sometimes work better.

We must fix the kcore format and libkvm.
2004-07-14 07:26:12 +00:00
christos
6bd1d6d4db Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
2004-04-21 01:05:31 +00:00
christos
99319b80db Give a 60 day leeway instead of a week when judging if the dumptime is valid.
7 days is too short when you are debugging time problems.
2004-03-30 19:52:02 +00:00
agc
276d62f603 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22308, verified by myself.
2003-08-07 10:04:22 +00:00
itojun
f5878476d9 simplify by strlcpy 2003-05-18 02:11:13 +00:00
thorpej
764e56a614 Remove prototype for non-existent function log(). 2002-12-06 02:20:00 +00:00
drochner
335fd2d7c2 use humanize_number(3) for progress printout 2002-09-27 18:38:53 +00:00
christos
94d01e0c5d PR/15502: Wolfgang Rupprecht: savecore fails for > 2GB files. 2002-03-19 18:55:03 +00:00
tsutsui
07b8153219 Change type of dumpmag and newdumpmag from int to u_int32_t
since they hold 32bit unsigned magic numbers. (sync with kernels)
2002-03-06 13:13:08 +00:00
lukem
d3656d428d fix a couple of -Wshadow warnings 2001-11-01 07:39:38 +00:00
lukem
fa5157d9fb explicitly set the default compression level to 1 (from the implicit 6),
because it's significantly faster and doesn't use that much more disk space.
2001-09-12 03:14:08 +00:00
lukem
fd08f59ac0 Add "-Z level" to control the compression level that -z uses (which
defaults to -Z 6).  Depending on the relative speed of the CPU
versus disk, "-zZ1" might be faster than no compression at all.
2001-09-12 02:58:29 +00:00
wiz
f91f11f51f Use getbootfile(3) instead of _PATH_UNIX by default.
Sprinkle some const.
2001-06-13 23:16:27 +00:00
simonb
1547b056d0 If the position of the formatted panic string can be found in the
message buffer, use that instead of the raw panic string.

Suggested by Jason Thorpe eons ago.
2001-05-06 13:36:51 +00:00
martin
1bb8e47f65 Make option flag variables static. This avoids a conflict between
'int compress' in savecore.c and the function 'compress' in libz.
Gnu ld 2.10 (with BFD 2.10) used on sparc64 warns this conflict
(symbol "compress" changed size).
2001-01-11 20:27:12 +00:00
joda
7e74657e37 use gzip instead of compress 2001-01-02 21:39:37 +00:00
lukem
834e92eedc Bump the field width of `K to go' from 6 to 8; some systems have more
than 999999 KB of RAM... (this will suffice until it's common to have
~ 100 GB of RAM :)
2001-01-02 00:29:37 +00:00
wiz
9bf97e8322 Back out sysctl part for now, awaiting the result of further discussion,
on request of Andrew Doran.
2000-12-11 14:33:51 +00:00
wiz
4c06e7a434 Output proper warning if dumplo == -1 (as it can happen on macppc without
swap partition), instead of "kvm_dump_mkheader: Pread: Invalid argument".
2000-12-08 22:03:23 +00:00
wiz
ba968ca2e4 de-__P(), and generally try to be more conforming to the new NetBSD style.
Use %m in syslog strings where appropriate.
Reduce warnings with WARNS=2.
2000-12-07 03:55:44 +00:00
wiz
e7fe5f1380 Fix argument handling, which was pretty broken.
If sysctl supports it, try to get the kernel name with CPU_BOOTED_KERNEL.
Get current kernels version string in all cases.
Adapt some error messages to the correct kernel name.
Reviewed by Simon Burge.
2000-12-07 03:17:17 +00:00
darrenr
a2d10b89c2 initialize kernel to _PATH_UNIX and remove local variables in functions
which are essentially copies of kernel.
2000-10-08 07:04:28 +00:00
darrenr
3904e69e83 savecore was looking up dumpdev, etc, from the wrong kernel 2000-10-01 02:27:06 +00:00
eeh
baf03fd97c time is a struct timeval' not a time_t', so read it in properly. 2000-08-01 16:46:27 +00:00
mycroft
c71139914f s/on device/in [dirname]/, to be a bit clearer... 1999-08-02 00:33:01 +00:00
cgd
fb88e47b54 Remove an extraneous fclose() call which would cause savecore to crash
if the bounds file was unwritable (e.g. because /var was read-only).
Fix supplied by Ronald Khoo in PR#7887.
1999-07-01 08:53:35 +00:00
sommerfe
c805ae93c2 Crash dumps should *not* be world readable. 1999-02-27 20:40:30 +00:00
sommerfe
247b8c3e8c Avoid truncating partition size in freespace calculation 1998-07-23 19:05:59 +00:00