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

Allocate afl_area_initial dynamically #10117

Closed
dra27 opened this issue Jan 3, 2021 · 3 comments · Fixed by #11877
Closed

Allocate afl_area_initial dynamically #10117

dra27 opened this issue Jan 3, 2021 · 3 comments · Fixed by #11877
Assignees

Comments

@dra27
Copy link
Member

dra27 commented Jan 3, 2021

As noted in #10107 (comment), the runtime reserves 64KB for AFL, regardless of whether it's used or even supported.

Assuming it doesn't affect the operation of AFL, caml_setup_afl should allocate the buffer dynamically on first call.

xavierleroy added a commit to xavierleroy/ocaml that referenced this issue Dec 15, 2021
Instrumented code produced by `ocamlopt -afl-instrument` but not run
under AFL needs a 64 k dummy buffer at run-time.

Before, this buffer was allocated statically, and therefore present in all
ocamlopt-generated executables, whether compiled with `-afl-instrument`
or without, whether AFL was selected at configuration-time or not.

This commit implements dynamic allocation of the AFL buffer when
an AFL-instrumented executable starts.

It is based on the proposal at ocaml#10167 and its discussion.

Fixes: ocaml#10117
Closes: ocaml#10167
@github-actions github-actions bot added the Stale label Jan 5, 2022
@xavierleroy
Copy link
Contributor

I have a fix in some branch somewhere. Will come back to it after the Multicore merge.

@xavierleroy xavierleroy removed the Stale label Jan 5, 2022
@xavierleroy xavierleroy self-assigned this Jan 5, 2022
@ocaml ocaml deleted a comment from github-actions bot Jan 5, 2022
@dra27
Copy link
Member Author

dra27 commented Jan 5, 2022

It's in your afl-dynamic-allocation branch, apparently 🙂

@github-actions
Copy link

github-actions bot commented Jan 9, 2023

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

@github-actions github-actions bot added the Stale label Jan 9, 2023
xavierleroy added a commit to xavierleroy/ocaml that referenced this issue Jan 9, 2023
Instrumented code produced by `ocamlopt -afl-instrument` but not run
under AFL needs a 64 k dummy buffer at run-time.

Before, this buffer was allocated statically, and therefore present in all
ocamlopt-generated executables, whether compiled with `-afl-instrument`
or without, whether AFL was selected at configuration-time or not.

This commit implements dynamic allocation of the AFL buffer when
an AFL-instrumented executable starts.

It is based on the proposal at ocaml#10167 and its discussion.

Fixes: ocaml#10117
Closes: ocaml#10167
xavierleroy added a commit to xavierleroy/ocaml that referenced this issue Jan 9, 2023
Instrumented code produced by `ocamlopt -afl-instrument` but not run
under AFL needs a 64 k dummy buffer at run-time.

Before, this buffer was allocated statically, and therefore present in all
ocamlopt-generated executables, whether compiled with `-afl-instrument`
or without, whether AFL was selected at configuration-time or not.

This commit implements dynamic allocation of the AFL buffer when
an AFL-instrumented executable starts.

It is based on the proposal at ocaml#10167 and its discussion.

Fixes: ocaml#10117
Closes: ocaml#10167
xavierleroy added a commit to xavierleroy/ocaml that referenced this issue Jan 11, 2023
Instrumented code produced by `ocamlopt -afl-instrument` but not run
under AFL needs a 64 k dummy buffer at run-time.

Before, this buffer was allocated statically, and therefore present in all
ocamlopt-generated executables, whether compiled with `-afl-instrument`
or without, whether AFL was selected at configuration-time or not.

This commit implements dynamic allocation of the AFL buffer the first time
an AFL-instrumented module runs its initialization code.

It is based on the proposal at ocaml#10167 and its discussion.

Fixes: ocaml#10117
Closes: ocaml#10167
@github-actions github-actions bot closed this as completed Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants