Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for setPanicOnFault (0.22 sec)

  1. src/runtime/rdebug.go

    //go:linkname setMaxStack runtime/debug.setMaxStack
    func setMaxStack(in int) (out int) {
    	out = int(maxstacksize)
    	maxstacksize = uintptr(in)
    	return out
    }
    
    //go:linkname setPanicOnFault runtime/debug.setPanicOnFault
    func setPanicOnFault(new bool) (old bool) {
    	gp := getg()
    	old = gp.paniconfault
    	gp.paniconfault = new
    	return old
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 02 18:52:03 UTC 2022
    - 550 bytes
    - Viewed (0)
  2. src/runtime/debug/panic_test.go

    	if err != nil {
    		t.Fatalf("can't map anonymous memory: %s", err)
    	}
    	defer syscall.Munmap(m)
    	old := debug.SetPanicOnFault(true)
    	defer debug.SetPanicOnFault(old)
    	const lowBits = 0x3e7
    	defer func() {
    		r := recover()
    		if r == nil {
    			t.Fatalf("write did not fault")
    		}
    		type addressable interface {
    			Addr() uintptr
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 28 18:17:57 UTC 2021
    - 1.4K bytes
    - Viewed (0)
  3. src/runtime/debug/garbage.go

    // may depend on the platform.
    // SetPanicOnFault applies only to the current goroutine.
    // It returns the previous setting.
    func SetPanicOnFault(enabled bool) bool {
    	return setPanicOnFault(enabled)
    }
    
    // WriteHeapDump writes a description of the heap and the objects in
    // it to the given file descriptor.
    //
    // WriteHeapDump suspends the execution of all goroutines until the heap
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 9.9K bytes
    - Viewed (0)
  4. src/runtime/debug/stubs.go

    package debug
    
    import (
    	"time"
    )
    
    // Implemented in package runtime.
    func readGCStats(*[]time.Duration)
    func freeOSMemory()
    func setMaxStack(int) int
    func setGCPercent(int32) int32
    func setPanicOnFault(bool) bool
    func setMaxThreads(int) int
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 03 15:12:04 UTC 2022
    - 435 bytes
    - Viewed (0)
  5. src/runtime/signal_plan9.go

    	{_SigPanic, "sys: fp:"},                // SIGFLOAT
    
    	// All other traps are normally handled as if they were marked SigThrow.
    	// We mark them SigPanic here so that debug.SetPanicOnFault will work.
    	{_SigPanic, "sys: trap:"}, // SIGTRAP
    
    	// Writes to a closed pipe can be handled if desired, otherwise they're ignored.
    	{_SigNotify, "sys: write on closed pipe"},
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 07 16:25:17 UTC 2016
    - 1.9K bytes
    - Viewed (0)
  6. test/fixedbugs/issue11656.dir/issue11656.go

    // license that can be found in the LICENSE file.
    
    package main
    
    import (
    	"encoding/binary"
    	"runtime"
    	"runtime/debug"
    	"unsafe"
    )
    
    func main() {
    	debug.SetPanicOnFault(true)
    	defer func() {
    		if err := recover(); err == nil {
    			panic("not panicking")
    		}
    		pc, _, _, _ := runtime.Caller(10)
    		f := runtime.FuncForPC(pc)
    		if f == nil || f.Name() != "main.f" {
    			if f == nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 11 15:28:40 UTC 2022
    - 1.9K bytes
    - Viewed (0)
  7. src/runtime/runtime_test.go

    	SetCPUProfileRate(0)
    }
    
    // Addresses to test for faulting behavior.
    // This is less a test of SetPanicOnFault and more a check that
    // the operating system and the runtime can process these faults
    // correctly. That is, we're indirectly testing that without SetPanicOnFault
    // these would manage to turn into ordinary crashes.
    // Note that these are truncated on 32-bit systems, so the bottom 32 bits
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 11.7K bytes
    - Viewed (0)
  8. test/recover4.go

    		dst[i] = src[i]
    		n++
    	}
    	return
    }
    
    func main() {
    	// Turn the eventual fault into a panic, not a program crash,
    	// so that memcopy can recover.
    	debug.SetPanicOnFault(true)
    
    	size := syscall.Getpagesize()
    
    	// Map 16 pages of data with a 4-page hole in the middle.
    	data, err := syscall.Mmap(-1, 0, 16*size, syscall.PROT_READ|syscall.PROT_WRITE, syscall.MAP_ANON|syscall.MAP_PRIVATE)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:25 UTC 2023
    - 2.2K bytes
    - Viewed (0)
  9. src/cmd/go/internal/modindex/read.go

    	// we don't suppress panics that could have been produced from other sources.
    	type addrer interface {
    		Addr() uintptr
    	}
    
    	debug.SetPanicOnFault(old)
    
    	if e := recover(); e != nil {
    		if _, ok := e.(addrer); ok || e == errCorrupt {
    			// This panic was almost certainly caused by SetPanicOnFault or our panic(errCorrupt).
    			err := fmt.Errorf("error reading module index: %v", e)
    			if errp != nil {
    				*errp = err
    				return
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 14:34:32 UTC 2024
    - 29.7K bytes
    - Viewed (0)
  10. src/runtime/error.go

    // The address provided is best-effort.
    // The veracity of the result may depend on the platform.
    // Errors providing this method will only be returned as
    // a result of using [runtime/debug.SetPanicOnFault].
    func (e errorAddressString) Addr() uintptr {
    	return e.addr
    }
    
    // plainError represents a runtime error described a string without
    // the prefix "runtime error: " after invoking errorString.Error().
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 08 19:10:41 UTC 2024
    - 9.9K bytes
    - Viewed (0)
Back to top