File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /bin/bash
22
3+ SCRIPT_PATH=" $( cd " $( dirname " $0 " ) " && pwd) /$( basename " $0 " ) "
4+
35LD_PRELOAD=$( ruby -e ' require "ruzzy"; print Ruzzy::ASAN_PATH' ) \
4- ruby -e ' require "ruzzy"; Ruzzy.dummy' -- " $@ "
6+ RUZZY_ARGV0= " $SCRIPT_PATH " ruby -e ' require "ruzzy"; Ruzzy.dummy' -- " $@ "
Original file line number Diff line number Diff line change 77module Ruzzy
88 require 'cruzzy/cruzzy'
99
10- DEFAULT_ARGS = [ $PROGRAM_NAME] + ARGV
10+ # libFuzzer features like -merge and -fork re-execute argv[0] via system().
11+ # RUZZY_ARGV0 allows a wrapper script (e.g. entrypoint.sh) to advertise its
12+ # own path as argv[0], so re-execution goes through the wrapper that sets
13+ # LD_PRELOAD and other required environment.
14+ ARGV0 = ENV . fetch ( 'RUZZY_ARGV0' , $PROGRAM_NAME)
15+ DEFAULT_ARGS = [ ARGV0 ] + ARGV
1116 EXT_PATH = Pathname . new ( __FILE__ ) . parent . parent / 'ext' / 'cruzzy'
1217 ASAN_PATH = ( EXT_PATH / 'asan_with_fuzzer.so' ) . to_s
1318 UBSAN_PATH = ( EXT_PATH / 'ubsan_with_fuzzer.so' ) . to_s
You can’t perform that action at this time.
0 commit comments