[Benchmark] add some MAGMA benchmarks (libpng, libxml2, openssl, sqli… - #55
Merged
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…te, libsndfile)
canary.c의 필요성
MAGMA 벤치마크는 빌드 시 , 코드 다운로드 후 자체수정을 거칩니다.
이는 canary.c에 정의된 magma_log함수에 오류발생조건을 집어넣는 식입니다.
예 :
MAGMA_LOG("%MAGMA_BUG%", MAGMA_OR(paf_fmt.channels < 1, paf_fmt.channels > SF_MAX_CHANNELS));canary.c 는 자신한테 들어온 조건이 참이면 오류발생을 기록합니다.
저희의 경우도 목표 타깃을 명확히 하기 위해서 MAGMA의 자체수정을 그대로 사용하고, 그 수정지점을 노리도록 했습니다.
다만 magma_log함수의 원래 복잡한 구현은 필요가 없어, 간단하게 만들어 사용 중입니다.
magma_log 지점을 노리는 것은 AFLRun이 MAGMA에서 타깃을 잡는 방식과 같습니다.
afl_driver.cpp의 필요성
MAGMA의 빌드 스크립트는 make말고 중간에 컴파일 과정을 더 거치는 게 많은데,
저희가 .ll을 뽑기 위해 이를 따라하다 보면, 컴파일을 위해 main함수가 필요합니다.
MAGMA는 main함수가 있는 간단한 wrapper인 afl_driver.cpp를 이용해 빌드하고 있으므로, 저희도 이를 넣어서 .ll을 추출하고 있습니다.