Commit Graph

41 Commits (master)

Author SHA1 Message Date
John Benediktsson 1d8ca2c835 vm/mach_signal.cpp: didn't need mach_msg_return_t. 2018-05-03 19:17:33 -07:00
Björn Lindqvist a0df88f20b VM: renaming verify_memory_protection_error to set_memory_protection_error
and sets the signal_fault_addr and signal_fault_pc in the function.
2016-09-22 13:12:59 +02:00
Alexander Iljin 0d57734dab vm: replace block comments /**/ with line comments // 2016-09-09 05:47:52 +02:00
Alexander Iljin e0acf4f328 Revert "vm: replace line comments // with block comments /**/ for consintency"
This reverts commit 7ee4e5dea5.
2016-09-09 05:47:52 +02:00
Alexander Iljin 7ee4e5dea5 vm: replace line comments // with block comments /**/ for consintency
Fix #1651.
2016-08-03 09:19:48 -07:00
Erik Charlebois ffe41b3d7f VM: Fixup cast formatting after clang-format
clang-format doesn't recognize casts to non-pointer/non-template types
so it winds up adding a space between the right paren and the expression
and then failing to recognize prefix operators in the process
(e.g. foo = (cell) & bar; should be foo = (cell)&bar;). This commit
manually fixes up the major cases (fixnum, cell, all types ending in _t).
2013-05-13 14:59:24 -04:00
Erik Charlebois 302826c7be VM: Refactor mach_signal to Factor style 2013-05-12 13:24:45 -04:00
Erik Charlebois ca2ea548be VM: Remove exec bit from VM source files 2013-05-11 17:04:23 -04:00
Joe Groff 0a1a252cdb vm: replace assert with FACTOR_ASSERT
Factor is finally a real C++ project and has a custom assert macro. Assertion failures were still getting caught as exceptions and causing failure loops. Write our own macro that calls factor::abort on failure.
2011-11-23 11:11:26 -08:00
Joe Groff 6c0ecf631a vm: charge samples collected in prolog to parent
Fixes #379
2011-11-23 11:11:26 -08:00
Joe Groff e24400679f vm: more defense against multi-faulting
* Clear faulting_p from a safepoint rather than inside general_error, because jumping into unwind-native-frames could blow up.
* Handle multiple faults from fatal_error by breakpointing. Is there anything else we can safely do at that point?
* Verify memory protection faults in the top half of the signal handlers because signal dispatch could fault. Treat memory faults during gc or fep as fatal errors.
* Add a function factor_vm::abort() that restores the default SIGABRT handler and ::abort()s. Use it from fatal_error() so we get useful context from gdb and so the user gets feedback from the system crash reporter that Factor blew up and didn't just disappear.
* In factorbug(), don't proceed with .s .r .c if it would be unsafe to do so.
* Don't pile on signals if we've already called fatal_error().
2011-11-12 13:02:57 -08:00
Joe Groff 5d59faa7d1 vm: move dispatch_signal_handler to cpu-x86.cpp
The new signal handler dispatch is logic is CISC-centric; defer fixing it until we find someone who cares
2011-10-27 21:18:20 -07:00
Joe Groff 6e4117035e vm: factor out dispatch_signal_handler logic 2011-10-27 21:14:49 -07:00
Joe Groff 1dc31d133b vm: clean up signal handler dispatch
Remove the weird and broken functions fix_callstack_top and scrub_return_address. Instead, simply decrement the SP and store the PC from the front end of the signal handler so that the back end can return back into the original context normally. Currently aborts for leaf procedure frames pending a more robust solution.
2011-10-27 21:14:48 -07:00
Joe Groff b3e5f75c9e vm: handle async signals at safepoints on unix
Factor now supports the new 4.0BSD feature of "signals".
2011-10-27 21:14:46 -07:00
Slava Pestov d74817cedf vm: Remove signal_callstack_top nonsense 2010-09-02 22:57:17 -05:00
Slava Pestov 1818bcb780 Fix three problems discovered by running math.floats.env tests in a loop:
- Crash if allocating error triggers a GC from a signal/SEH handler
- Crash if GC runs with floating point traps enabled on Windows
- Floating point traps didn't prettyprint properly
2010-09-02 22:57:14 -05:00
Slava Pestov 11ddbc03a4 vm: signal handling cleanup 2010-03-27 07:33:28 -04:00
Slava Pestov 1e4e66d6a2 vm: another fix 2010-03-23 04:17:39 -04:00
Slava Pestov ffafafd951 vm/mach_signal.c: work around Mac OS X 10.6 API change (or bug?) 2010-03-23 04:04:08 -04:00
Slava Pestov 3394309659 Merge branch 'master' into new_gc 2009-10-22 05:40:57 -05:00
Slava Pestov f24942e063 vm: clean up signal handling and add EXC_BAD_INSTRUCTION Mach exception handler for OS X, since signal handlers cannot change the stack pointer 2009-10-22 05:22:59 -05:00
Slava Pestov ac25b8ebbb vm: new mark_bits data structure replaces hashtable when compacting code heap 2009-10-19 02:21:11 -05:00
Joe Groff 435cd02200 keep a map of thread ids to vm pointers. use this to look up the correct VM to handle mach exceptions on os x 2009-10-02 12:03:05 -05:00
Slava Pestov 96df486753 vm: add assertions to tls_vm() 2009-10-02 09:37:04 -05:00
Phil Dawes 83b0769eef renamed factorvm to factor_vm 2009-09-24 08:16:52 +01:00
Phil Dawes e566656e46 removed a bunch of superflous blank lines 2009-09-24 08:02:14 +01:00
Phil Dawes d2afb4b344 put mach call_fault_handler in the vm 2009-09-16 08:22:18 +01:00
Phil Dawes 9e460f6dec removed vm ptr from mach_signal and some other places 2009-09-16 08:20:51 +01:00
Phil Dawes 784b8d16ae moved utility functions and fatal_error out of vm struct since doesn't need state 2009-09-16 08:20:10 +01:00
Phil Dawes 6ddd3c654e fixed up linux64 bootstrap (single threaded) 2009-09-16 08:20:09 +01:00
Phil Dawes 9cac5e8aa9 added lookup_vm and removed last usage of vm from windows code 2009-09-16 08:20:09 +01:00
Phil Dawes 20ef4200fb removed some error vm-> functions 2009-09-16 08:17:27 +01:00
Phil Dawes 700e03a6a6 removed some vm-> forwarding functions 2009-09-16 08:17:26 +01:00
Joe Groff fb43ae2daf save the FP status out of the signal context and use it as part of the fp trap factor exception. clear the FP status before continuing after an exception 2009-09-13 23:39:12 -05:00
Slava Pestov 9ccf5811b3 vm: fix fp_trap_error() so that it can work properly in signal handlers 2009-09-12 18:15:16 -05:00
Joe Groff 7ba71a524e Send FP trap signals to Factor as a different vm-error type 2009-09-06 08:44:25 -05:00
Slava Pestov 53db9d737a Change (void) to () 2009-05-05 11:33:35 -05:00
Slava Pestov 8872c40b1e The great type renaming 2009-05-04 04:50:24 -05:00
Slava Pestov edecac508e Use C++ namespaces 2009-05-04 01:46:13 -05:00
Slava Pestov b923d548cf Move vmpp to vm 2009-05-02 20:37:18 -05:00