aboutsummaryrefslogtreecommitdiff
path: root/trans/crash.c
Commit message (Collapse)AuthorAgeFilesLines
* trans: Port to x86_64Sergey Bugaev2023-05-101-1/+1
| | | | Message-Id: <20230508213136.608575-39-bugaevc@gmail.com>
* Use long_integer_t for exception_raise RPCsFlavio Cruz2023-04-081-1/+1
| | | | | | | | Also update the crash_dump_task RPC since it gets the subcode from the signal details in Glibc. This should fix the existing build error. Message-Id: <ZDDrnHFHtiLIS53W@jupiter.tail36e24.ts.net>
* Make RPC input array parameters constSamuel Thibault2022-01-161-10/+10
| | | | | This follows mig's cf4bcc3f1435 ("Also add const qualifiers on server side")
* Fix build warningsSamuel Thibault2022-01-011-1/+1
| | | | No actual behavior change.
* crash: Fix warningSamuel Thibault2020-11-221-1/+1
| | | | * trans/crash.c (template_make_file_name): Fix format for time_t.
* Use the data_t type defined in hurd_types.h.Flavio Cruz2019-09-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * boot/boot.c: Replace char* with data_t. * console-client/trans.c: Likewise. * exec/exec.c: Likewise. * ext2fs/storeinfo.c: Likewise. * fatfs/inode.c: Likewise. * fatfs/main.c: Likewise. * isofs/inode.c: Likewise. * libdiskfs/boot-start.c: Likewise. * libdiskfs/dir-readdir.c: Likewise. * libdiskfs/file-exec.c: Likewise. * libdiskfs/file-get-fs-opts.c: Likewise. * libdiskfs/file-get-trans.c: Likewise. * libdiskfs/file-getfh.c: Likewise. * libdiskfs/file-set-trans.c: Likewise. * libdiskfs/fsys-forward.c: Likewise. * libdiskfs/fsys-getfile.c: Likewise. * libdiskfs/fsys-options.c: Likewise. * libdiskfs/io-read.c: Likewise. * libdiskfs/io-write.c: Likewise. * libnetfs/dir-readdir.c: Likewise. * libnetfs/file-exec.c: Likewise. * libnetfs/file-get-fs-options.c: Likewise. * libnetfs/file-get-storage-info.c: Likewise. * libnetfs/file-get-translator.c: Likewise. * libnetfs/file-set-translator.c: Likewise. * libnetfs/fsstubs.c: Likewise. * libnetfs/fsys-get-options.c: Likewise. * libnetfs/fsys-set-options.c: Likewise. * libnetfs/fsysstubs.c: Likewise. * libnetfs/io-read.c: Likewise. * libnetfs/io-write.c: Likewise. * libtrivfs/dir-readdir.c: Likewise. * libtrivfs/file-get-fs-options.c: Likewise. * libtrivfs/file-get-storage-info.c: Likewise. * libtrivfs/file-get-trans.c: Likewise. * libtrivfs/file-getfh.c: Likewise. * libtrivfs/file-set-trans.c: Likewise. * libtrivfs/fsys-forward.c: Likewise. * libtrivfs/fsys-get-options.c: Likewise. * libtrivfs/fsys-set-options.c: Likewise. * libtrivfs/fsys-stubs.c: Likewise. * libtrivfs/io-read.c: Likewise. * libtrivfs/io-write.c: Likewise. * pfinet/io-ops.c: Likewise. * pfinet/pfinet-ops.c: Likewise. * pfinet/socket-ops.c: Likewise. * pfinet/tunnel.c: Likewise. * pflocal/io.c: Likewise. * pflocal/pf.c: Likewise. * pflocal/socket.c: Likewise. * proc/info.c: Likewise. * startup/startup.c: Likewise. * storeio/io.c: Likewise. * term/users.c: Likewise. * tmpfs/node.c: Likewise. * trans/crash.c: Likewise. * trans/fakeroot.c: Likewise. * trans/fifo.c: Likewise. * trans/firmlink.c: Likewise. * trans/hello-mt.c: Likewise. * trans/hello.c: Likewise. * trans/mtab.c: Likewise. * trans/new-fifo.c: Likewise. * trans/null.c: Likewise. * trans/proxy-defpager.c: Likewise. * trans/streamio.c: Likewise.
* Fix warningsSamuel Thibault2018-03-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libdiskfs/boot-start.c (diskfs_start_bootstrap): Fix printf format. * libfshelp/delegate.c: Include <alloca.h> and <stdlib.h>. * libfshelp/start-translator-long.c: Include <stdlib.h>. * libshouldbeinlibc/ugids-verify-auth.c (server_verify_make_auth): Fix prototypes for password_check_group and password_check_user. * libstore/argp.c: Include <stdlib.h>. * libstore/task.c: Include <stdlib.h>. * exec/exec.c: Include <mach/vm_param.h>. * libbpf/bpf_impl.c: Include <stdlib.h>. * proc/info.c (S_proc_getloginpids): Remove local variables leader_task and leader_sub. * proc/main.c (main): Remove local variable original_argv. * boot/boot.c (task_died, S_mach_notify_new_task): Fix printf format. * exec/elfcore.c: Include <alloca.h> and <mach/vm_param.h>. * trans/crash.c: Include <hurd/msg.h>. * trans/random.c: Include <signal.h>. * utils/login.c: Include <signal.h>. * utils/id.c: Include <hurd/msg.h>. * utils/devprobe.c: Include <stdlib.h>. * utils/addauth.c: Include <hurd/msg.h>. * utils/frobauth-mod.c: Include <hurd/msg.h>. * utils/storeread.c: Include <stdlib.h>. * utils/msgport.c: Include <hurd/msg.h>. * sutils/clookup.c (file_name_lookup_carefully): Fix lookup function prototype, make head and tail const. * utils/rpcscan.c: Include <stdlib.h>. * sutils/bless.c: Include <stdlib.h>. * fstests/fstests.c: Include <stdlib.h>. * startup/startup.c (argz_task_insert_right): Fix printf format. * init/init.c: Include <stdlib.h>.
* Use our own variant of 'assert' and 'assert_perror'.Justus Winter2017-08-051-3/+3
| | | | | Our variants print stack traces on failures. This will make locating errors much easier.
* trans/crash: Fix setting core file template at runtime.Justus Winter2016-10-051-1/+21
| | | | | | | * trans/crash.c (corefile_template_lock): New variable. (S_crash_dump_task): Serialize access to 'corefile_template'. (parse_opt): Likewise. Also strdup the template. (trivfs_append_args): Serialize access to 'corefile_template'.
* trans/crash: Use empty core file templates to disable the feature.Justus Winter2016-10-051-1/+4
| | | | | * trans/crash.c (parse_opt): Use empty core file templates to disable the feature.
* Avoid fatal error handling in option parsers.Justus Winter2016-10-051-1/+4
| | | | | | | * trans/crash.c (parse_opt): Avoid 'error' in favor of the appropriate argp error reporting mechanism. * trans/remap.c (parse_opt): Likewise. * utils/msgids.c (parse_opt): Likewise.
* trans/crash: core file name templatesJustus Winter2016-08-091-2/+164
| | | | | | | | | | | | | | | | | | | Add an option to specify a template used to construct core file names. This way core files can be collected at a predictable central location. * hurd/crash.defs (crash_dump_task): Return EEXIST if the core file has been written elsewhere. * trans/crash.c (corefile_template): New variable. (template_valid): New function. (template_make_file_name): Likewise. (S_crash_dump_task): Use the template to construct a name, open the file, and write the core dump there instead of the handle provided by the caller. (argp_option): New option. (doc): Document the format. (parse_opt): Handle new option (trivfs_append_args): Likewise.
* trans/crash: fix blunderJustus Winter2016-06-071-1/+1
| | | | * trans/crash.c (S_crash_dump_task): Fix error handling.
* trans/crash: fix resource leaksJustus Winter2016-06-041-6/+11
| | | | | | | | | | | | Previously, 'task', 'core_file', and 'ctty_id' were not deallocated if crash was configured to write core files, and 'ctty_id' was leaked if the crashing task was suspended. This lead to resources not being released in the kernel, the filesystem, and the terminal subsystem, and could very well be responsible for making the Debian/Hurd shutdown hang. * trans/crash.c (S_crash_dump_task): Properly deallocate 'task', 'core_file', and 'ctty_id'.
* Fix buildSamuel Thibault2016-05-031-0/+1
| | | | * trans/crash.c: Include <assert.h>.
* trans/crash: fix suspending taskJustus Winter2016-02-211-1/+1
| | | | * trans/crash.c (S_crash_dump_task): Fix looking up 'user_proc'.
* trans/crash: convert to trivfs dynamic classes and bucketsJustus Winter2015-09-271-22/+28
| | | | | | | | | | | | | | | | | libtrivfs contains two ways of managing more than one port class and bucket. There is the old way of using a statically allocated array with explicit length, and the new way with dynamically allocated vectors. Converting all users to the new way of handling multiple classes and/or buckets, we can simplify the code in libtrivfs. In many cases, the code will be simpler and more expressive for the user. This also fixes a mild bug. The classes and buckets given to `trivfs_startup' end up in the dynamic vectors too, making the object lookup code use the more complicated code path. * trans/crash.c: Convert to dynamic classes and buckets.
* Fix space styleSamuel Thibault2015-03-051-12/+12
|
* 2007-05-01 Thomas Schwinge <tschwinge@gnu.org>Thomas Schwinge2007-05-011-4/+1
| | | | * crash.c (S_msg_startup_dosync): Remove function.
* 2006-11-27 Ben Asselstine <benasselstine@canada.com>Thomas Schwinge2006-11-271-4/+19
| | | | | | Thomas Schwinge <tschwinge@gnu.org> * crash.c (trivfs_append_args): Handle CRASH_ORPHANS_HOW.
* 2006-11-27 Thomas Schwinge <tschwinge@gnu.org>Thomas Schwinge2006-11-271-7/+10
| | | | * crash.c: Correct the usage of the argp documentation string.
* 2002-05-28 Roland McGrath <roland@frob.com>Roland McGrath2002-05-291-2/+1
| | | | | | | * symlink.c (S_fsys_getroot, S_fsys_getfile): u_int -> size_t * streamio.c (device_open_reply): size_t -> int for dev_status_t * crash.c (S_msg_report_wait): int -> mach_msg_id_t (S_crash_dump_task): int -> integer_t
* 2002-05-28 Roland McGrath <roland@frob.com>Roland McGrath2002-05-281-1/+1
| | | | | * streamio.c (device_open_reply): size_t -> int for dev_status_t * crash.c (S_msg_report_wait): int -> mach_msg_id_t
* 2002-03-11 Roland McGrath <roland@frob.com>Roland McGrath2002-03-111-13/+11
| | | | | | | | | | | * crash.c: Add `corelimit' parameter to `dump_core' forward decl. (S_crash_dump_task): Change caller, pass (off_t)-1 for now. (struct crasher): New member `core_limit'. (dead_crasher): Pass C->core_limit to dump_core. (S_crash_dump_task): Set C->core_limit, to (off_t) -1 for now. (dump_core): Function removed; now ../exec/elfcore.c defines it. * Makefile (OBJS, crash): Add elfcore.o. (elfcore.c): vpath decl to find this in $(top_srcdir)/exec.
* auth/Marcus Brinkmann2001-02-121-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-02-12 Marcus Brinkmann <marcus@gnu.org> * auth.c (main): New variable ARGP defining a doc string. Pass address of ARGP to argp_parse(). exec/ 2001-02-12 Marcus Brinkmann <marcus@gnu.org> * main.c: Change hurd version name from proc to exec. (main): Add period to doc string. ftpfs/ 2001-02-12 Marcus Brinkmann <marcus@gnu.org> * ftpfs.c: Include <version.h>. Add global variable ARGP_PROGRAM_VERSION. Add period to DOC. hostmux/ 2001-02-12 Marcus Brinkmann <marcus@gnu.org> * hostmux.c: Include <version.h>. Add global variable ARGP_PROGRAM_VERSION. Add period to DOC. usermux/ 2001-02-12 Marcus Brinkmann <marcus@gnu.org> * usermux.c (options): Include <version.h>. Add global variable ARGP_PROGRAM_VERSION. Add period to DOC. trans/ 2001-02-12 Marcus Brinkmann <marcus@gnu.org> * fifo.c: Make version string say `fifo', not `null'. Add period to doc text in ARGP. * firmlink.c: Add period to doc text in ARGP_DOC, convert semi-colon to colon. * magic.c (options): Add period to DOC. * new-fifo.c (fifo_trans_parse_args): Add doc string to ARGP. Include <version.h>, new global variable ARGP_PROGRAM_VERSION. * crash.c: Include <version.h>, add global variable ARGP_PROGRAM_VERSION. * hello.c: Include <version.h>, add global variable ARGP_PROGRAM_VERSION. (hello_argp): Add doc string. * hello-mt.c: Likewise. * streamio.c: Add period to DOC. Change streamdev to streamio in version string. * password.c (main): Add period to doc string in ARGP.
* 2000-03-17 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath2000-03-171-3/+1
| | | | * crash.c (S_crash_dump_task): Use ports_get_send_right.
* 2000-01-28 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath2000-01-291-19/+80
| | | | | | | | | | | | * crash.c (enum crash_action): New alternative crash_unspecified (0). (crash_orphans_how): New variable. (S_crash_dump_task): If crash_how != crash_orphans_how, ascertain if the task is an orphan before deciding what to do. (options): New options --action, --orphan-action. Old options now compatability aliases for --action=foo. (parse_opt): Parse them. (doc): New variable. (crash_argp): Use DOC.
* 1999-08-31 Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de>Roland McGrath1999-09-011-1/+0
| | | | | * crash.c (trivfs_modify_stat): Remove redundant fstype setting. * password.c (trivfs_modify_stat): Likewise.
* 1999-07-10 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath1999-07-111-0/+1
| | | | * crash.c: Add #include <sys/mman.h> for munmap decl.
* 1999-07-03 Thomas Bushnell, BSG <tb@mit.edu>Thomas Bushnell1999-07-031-1/+1
| | | | * crash.c (stop_pgrp): Use munmap instead of vm_deallocate.
* 1999-06-01 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath1999-06-011-1/+2
| | | | * crash.c (options): Add --dump-core as alias for --core-file.
* 1999-06-01 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath1999-06-011-6/+106
| | | | | | | | | | | | | * crash.c: Support three modes of operation, selected by command line switches: -s/--suspend suspend crashing process (old behavior) -k/--kill kill crashing process, no core dump -c/--core-file dump core file (enum crash_action): New type. (crash_how): New variable. (options, crash_argp, trivfs_runtime_argp): New variables. (parse_opt, trivfs_append_args): New functions. (main): Call argp_parse.
* Wed Aug 20 14:07:56 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>Thomas Bushnell1997-08-201-2/+2
| | | | | | | | | * crash.c (main): New args for ports_manage_port_operations_multithread. * fifo.c (main): Likewise. * firmlink.c (main): Likewise. * new-fifo.c (main): Likewise. * null.c (main): Likewise.
* (stop_pgrp): Fetch pgrp using correct call.Michael I. Bushnell1996-07-131-2/+5
|
* (stop_pgrp): Don't do anything if ORPHANED.Michael I. Bushnell1996-07-081-2/+2
|
* (stop_pgrp): Take second arg CTTYID. Fetch each pgrp member's msgpor andRoland McGrath1996-07-081-10/+16
| | | | | | send msg_sig_post with that as refport instead of calling POSIX.1 kill function like a bonehead. (S_crash_dump_task): Pass CTTY_ID arg through to stop_pgrp.
* (S_crash_dump_task): fixupMichael I. Bushnell1996-07-081-1/+3
|
* (stop_pgrp): New function.Michael I. Bushnell1996-07-081-0/+31
| | | | (S_crash_dump_task): Call stop_pgrp.
* (S_msg_describe_ports): New function.Michael I. Bushnell1996-07-011-0/+5
|
* (S_crash_dump_task): Drop arg TARGET.Michael I. Bushnell1996-07-011-5/+3
| | | | | (dump_core): Likewise; all callers changed. (struct crasher): Delete member `target'.
* (S_crash_dump_task): New args EXC, CODE, SUBCODE, CTTY_ID. SupplyMichael I. Bushnell1996-07-011-7/+9
| | | | | | | SIGCODE arg to proc_mark_stop. (signal_crasher): New arg SIGCODE, supply to proc_mark_exit. All callers changed. (S_msg_sig_post_untraced): Supply C->sigcode to proc_mark_stop.
* typo fixesRoland McGrath1996-06-211-4/+4
|
* Use ports_create_port instead of ports_allocate_port, and notice the error.Roland McGrath1996-04-271-5/+4
|
* Initial revisionRoland McGrath1995-12-151-0/+578