-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* cannon: Fix stack patching And add `memprofilerate=0` to envp * Update cannon/mipsevm/program/patch.go Co-authored-by: protolambda <[email protected]> * cleanup argv/envp string ptrs * nit * fix envar name * Update cannon/mipsevm/program/patch.go Co-authored-by: mbaxter <[email protected]> * align op-program arg0 --------- Co-authored-by: protolambda <[email protected]> Co-authored-by: mbaxter <[email protected]>
- Loading branch information
1 parent
36f093a
commit 0dcccf6
Showing
4 changed files
with
97 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module entry | ||
|
||
go 1.21 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package main | ||
|
||
import ( | ||
"os" | ||
"runtime" | ||
) | ||
|
||
func main() { | ||
if len(os.Args) != 1 { | ||
panic("expected 1 arg") | ||
} | ||
if os.Args[0] != "op-program" { | ||
panic("unexpected arg0") | ||
} | ||
|
||
var memProfileRate bool | ||
env := os.Environ() | ||
for _, env := range env { | ||
if env != "GODEBUG=memprofilerate=0" { | ||
panic("invalid envar") | ||
} | ||
memProfileRate = true | ||
} | ||
if !memProfileRate { | ||
panic("memProfileRate env is not set") | ||
} | ||
if runtime.MemProfileRate != 0 { | ||
panic("runtime.MemProfileRate is non-zero") | ||
} | ||
} |