JFIF ( %!1"%)-...383.7(-.+  -%&--------------------------------------------------"J !1"AQaq2BR#r3Sbs4T$Dd(!1"2AQaq# ?q& JX"-` Es?Bl 1( H6fX[vʆEiB!j{hu85o%TI/*T `WTXط8%ɀt*$PaSIa9gkG$t h&)ٞ)O.4uCm!w*:K*I&bDl"+ ӹ=<Ӷ|FtI{7_/,/T ̫ԷC ȷMq9[1w!R{ U<?СCԀdc8'124,I'3-G s4IcWq$Ro瓩!"j']VӤ'B4H8n)iv$Hb=B:B=YݚXZILcA g$ΕzuPD? !զIEÁ $D'l"gp`+6֏$1Ľ˫EjUpܣvDت\2Wڰ_iIْ/~'cŧE:ɝBn9&rt,H`*Tf֙LK$#d "p/n$J oJ@'I0B+NRwj2GH.BWLOiGP W@#"@ę| 2@P D2[Vj!VE11pHn,c~T;U"H㤑EBxHClTZ7:х5,w=.`,:Lt1tE9""@pȠb\I_IƝpe &܏/ 3, WE2aDK &cy(3nI7'0W էΠ\&@:נ!oZIܻ1j@=So LJ{5UĜiʒP H{^iaH?U2j@<'13nXkdP&%ɰ&-(<]Vlya7 6c1HJcmǸ!˗GB3Ԏߏ\=qIPNĉA)JeJtEJbIxWbdóT V'0 WH*|D u6ӈHZh[8e  $v>p!rIWeB,i '佧 )g#[)m!tahm_<6nL/ BcT{"HSfp7|ybi8'.ih%,wm  403WebShell
403Webshell
Server IP : 153.92.12.70  /  Your IP : 216.73.216.71
Web Server : LiteSpeed
System : Linux id-dci-web1986.main-hosting.eu 5.14.0-611.26.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jan 29 05:24:47 EST 2026 x86_64
User : u686484674 ( 686484674)
PHP Version : 8.0.30
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/./self/root/opt/golang/1.22.0/src/runtime/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/./self/root/opt/golang/1.22.0/src/runtime/vdso_test.go
// Copyright 2023 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build (freebsd && (386 || amd64 || arm || arm64 || riscv64)) || (linux && (386 || amd64 || arm || arm64 || loong64 || mips64 || mips64le || ppc64 || ppc64le || riscv64 || s390x))

package runtime_test

import (
	"bytes"
	"internal/testenv"
	"os"
	"os/exec"
	"path/filepath"
	"syscall"
	"testing"
	"time"
)

// TestUsingVDSO tests that we are actually using the VDSO to fetch
// the time.
func TestUsingVDSO(t *testing.T) {
	const calls = 100

	if os.Getenv("GO_WANT_HELPER_PROCESS") == "1" {
		// Fetch the time a lot.
		var total int64
		for i := 0; i < calls; i++ {
			total += time.Now().UnixNano()
		}
		os.Exit(0)
	}

	t.Parallel()

	// Look for strace in /bin or /usr/bin. Don't assume that some
	// strace on PATH is the one that we want.
	strace := "/bin/strace"
	if _, err := os.Stat(strace); err != nil {
		strace = "/usr/bin/strace"
		if _, err := os.Stat(strace); err != nil {
			t.Skipf("skipping test because strace not found: %v", err)
		}
	}

	exe, err := os.Executable()
	if err != nil {
		t.Skipf("skipping because Executable failed: %v", err)
	}

	t.Logf("GO_WANT_HELPER_PROCESS=1 %s -f -e clock_gettime %s -test.run=^TestUsingVDSO$", strace, exe)
	cmd := testenv.Command(t, strace, "-f", "-e", "clock_gettime", exe, "-test.run=^TestUsingVDSO$")
	cmd = testenv.CleanCmdEnv(cmd)
	cmd.Env = append(cmd.Env, "GO_WANT_HELPER_PROCESS=1")
	out, err := cmd.CombinedOutput()
	if len(out) > 0 {
		t.Logf("%s", out)
	}
	if err != nil {
		if err := err.(*exec.ExitError); err != nil && err.Sys().(syscall.WaitStatus).Signaled() {
			if !bytes.Contains(out, []byte("+++ killed by")) {
				// strace itself occasionally crashes.
				// Here, it exited with a signal, but
				// the strace log didn't report any
				// signal from the child process.
				t.Log(err)
				testenv.SkipFlaky(t, 63734)
			}
		}
		t.Fatal(err)
	}

	if got := bytes.Count(out, []byte("gettime")); got >= calls {
		t.Logf("found %d gettime calls, want < %d", got, calls)

		// Try to double-check that a C program uses the VDSO.
		tempdir := t.TempDir()
		cfn := filepath.Join(tempdir, "time.c")
		cexe := filepath.Join(tempdir, "time")
		if err := os.WriteFile(cfn, []byte(vdsoCProgram), 0o644); err != nil {
			t.Fatal(err)
		}
		cc := os.Getenv("CC")
		if cc == "" {
			cc, err = exec.LookPath("gcc")
			if err != nil {
				cc, err = exec.LookPath("clang")
				if err != nil {
					t.Skip("can't verify VDSO status, no C compiler")
				}
			}
		}

		t.Logf("%s -o %s %s", cc, cexe, cfn)
		cmd = testenv.Command(t, cc, "-o", cexe, cfn)
		cmd = testenv.CleanCmdEnv(cmd)
		out, err = cmd.CombinedOutput()
		if len(out) > 0 {
			t.Logf("%s", out)
		}
		if err != nil {
			t.Skipf("can't verify VDSO status, C compiled failed: %v", err)
		}

		t.Logf("%s -f -e clock_gettime %s", strace, cexe)
		cmd = testenv.Command(t, strace, "-f", "-e", "clock_gettime", cexe)
		cmd = testenv.CleanCmdEnv(cmd)
		out, err = cmd.CombinedOutput()
		if len(out) > 0 {
			t.Logf("%s", out)
		}
		if err != nil {
			t.Skipf("can't verify VDSO status, C program failed: %v", err)
		}

		if cgot := bytes.Count(out, []byte("gettime")); cgot >= 100 {
			t.Logf("found %d gettime calls, want < %d", cgot, 100)
			t.Log("C program does not use VDSO either")
			return
		}

		// The Go program used the system call but the C
		// program did not. This is a VDSO failure for Go.
		t.Errorf("did not use VDSO system call")
	}
}

const vdsoCProgram = `
#include <stdio.h>
#include <time.h>

int main() {
	int i;
	time_t tot;
	for (i = 0; i < 100; i++) {
		struct timespec ts;
		clock_gettime(CLOCK_MONOTONIC, &ts);
		tot += ts.tv_nsec;
	}
	printf("%d\n", (int)(tot));
	return 0;
}
`

Youez - 2016 - github.com/yon3zu
LinuXploit