Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[expr] Initial integration #10861

Merged
merged 6 commits into from
Aug 30, 2023
Merged

[expr] Initial integration #10861

merged 6 commits into from
Aug 30, 2023

Conversation

antonmedv
Copy link
Contributor

Expr is an expression language in Go. It's primary goal is to be safe to take unsanitized user input.
Expr is already in //third_party in google3 ;)

@github-actions
Copy link

antonmedv is integrating a new project:
- Main repo: https://github.com/antonmedv/expr.git
- Criticality score: 0.62542

Copy link
Contributor

@jonathanmetzman jonathanmetzman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jonathanmetzman jonathanmetzman enabled auto-merge (squash) August 21, 2023 18:02
@antonmedv
Copy link
Contributor Author

I don't understand why build libfuzzer,address,x86_64 failed.

@antonmedv
Copy link
Contributor Author

@jonathanmetzman please help with tests. Thanks!

@jonathanmetzman
Copy link
Contributor

Done

@jonathanmetzman
Copy link
Contributor

Post back here if they pass please.

@antonmedv antonmedv closed this Aug 22, 2023
auto-merge was automatically disabled August 22, 2023 16:06

Pull request was closed

@antonmedv antonmedv reopened this Aug 22, 2023
@antonmedv
Copy link
Contributor Author

Please restart workflows.

@antonmedv
Copy link
Contributor Author

I tried to test the build locally but got some problems with installing dependencies.

Please, help me with this PR. Thanks! <3

@jonathanmetzman
Copy link
Contributor

I tried to test the build locally but got some problems with installing dependencies.

Please, help me with this PR. Thanks! <3

Installing deps for OSS-Fuzz? It's just docker and python.
Do you understand the error in CI? I don't

@antonmedv
Copy link
Contributor Author

Do you understand the error in CI? I don't

I don't too.

It's just docker and python.

I was trying to install pip locally

@jonathanmetzman
Copy link
Contributor

Do you understand the error in CI? I don't

I don't too.

It's just docker and python.

I was trying to install pip locally

I don't think pip is required though,.

@antonmedv
Copy link
Contributor Author

Found the docs: https://google.github.io/oss-fuzz/advanced-topics/reproducing/
It helped =)

@antonmedv
Copy link
Contributor Author

Same error as in CI:

+ compile_native_go_fuzzer github.com/antonmedv/expr FuzzExpr fuzz_expr
main.1367621804.go:12:2: found packages expr (bench_test.go) and expr_test (fuzz_test.go_fuzz.go) in /src/expr
2023/08/23 12:17:06 failed to build packages:exit status 1
ERROR:__main__:Building fuzzers failed.

@antonmedv
Copy link
Contributor Author

I trying to put fuzzers in a sep dir. Seems like it helped.

@antonmedv
Copy link
Contributor Author

@jonathanmetzman please, approve CI builds.

@antonmedv
Copy link
Contributor Author

@jonathanmetzman I'd like to get this done! I really appreciate any help you can provide.

@jonathanmetzman
Copy link
Contributor

I see this error:

panic: open ./fuzz_corpus.txt: no such file or directory [recovered]
	panic: open ./fuzz_corpus.txt: no such file or directory

Is it trying to read a non-existent file?

@antonmedv
Copy link
Contributor Author

antonmedv commented Aug 30, 2023

I switched to go:embed for corpus. Looks like it working:

$ python infra/helper.py build_fuzzers --sanitizer address expr
...
+ cp /src/expr/test/fuzz/fuzz_expr_seed_corpus.zip /out/
+ cp /src/expr/test/fuzz/fuzz_expr.dict /out/
+ go get github.com/AdamKorcz/go-118-fuzz-build/testing
go: downloading github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0
go: downloading github.com/AdaLogics/go-fuzz-headers v0.0.0-20221206110420-d395f97c4830
go: downloading github.com/cyphar/filepath-securejoin v0.2.3
go: added github.com/AdaLogics/go-fuzz-headers v0.0.0-20221206110420-d395f97c4830
go: added github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0
go: added github.com/cyphar/filepath-securejoin v0.2.3
+ compile_native_go_fuzzer github.com/antonmedv/expr/test/fuzz FuzzExpr fuzz_expr

$ python infra/helper.py run_fuzzer expr fuzz_expr
INFO:__main__:Running: docker run --rm --privileged --shm-size=2g --platform linux/amd64 -i -e FUZZING_ENGINE=libfuzzer -e SANITIZER=address -e RUN_FUZZER_MODE=interactive -e HELPER=True -v /Users/anton/dev/google/oss-fuzz/build/out/expr:/out -t gcr.io/oss-fuzz-base/base-runner run_fuzzer fuzz_expr.
Using seed corpus: fuzz_expr_seed_corpus.zip
/out/fuzz_expr -rss_limit_mb=2560 -timeout=25 /tmp/fuzz_expr_corpus -dict=fuzz_expr.dict < /dev/null
bash: line 1:    26 Killed                  /out/fuzz_expr -rss_limit_mb=2560 -timeout=25 /tmp/fuzz_expr_corpus -dict=fuzz_expr.dict < /dev/null

@jonathanmetzman PTAL

@jonathanmetzman
Copy link
Contributor

Did you update the PR?

@antonmedv
Copy link
Contributor Author

I only updated my repo.

@antonmedv
Copy link
Contributor Author

Will update the branch.

@antonmedv
Copy link
Contributor Author

@jonathanmetzman PTAL

@jonathanmetzman jonathanmetzman merged commit 4c4dcf6 into google:master Aug 30, 2023
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants