Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Buildsoftwaresphere/a265176407d541e9ed28 to your computer and use it in GitHub Desktop.
Save Buildsoftwaresphere/a265176407d541e9ed28 to your computer and use it in GitHub Desktop.
ac_add_options --disable-jemalloc
ac_add_options --enable-valgrind
ac_add_options --enable-optimize="-g -O2"
@Buildsoftwaresphere
Copy link
Author

Linux
--smc-check=all-non-file --vex-iropt-register-updates=allregs-at-mem-access --show-mismatched-frees=no --read-inline-info=yes
The --smc-check and --vex-iropt-register-updates options are necessary to avoid crashes in JIT-generated code.

The --show-mismatched-frees option is necessary due to inconsistent inlining of new and delete -- i.e. one gets inlined but the other doesn't -- which lead to false-positive mismatched-free errors.

The --read-inline-info option improves stack trace readability in the presence of inlining.

Also, run with the following environment variable set.

G_SLICE=always-malloc

@Buildsoftwaresphere
Copy link
Author

mac
Mac

On Mac, run Valgrind with the following options.

--smc-check=all-non-file --vex-iropt-register-updates=allregs-at-mem-access --show-mismatched-frees=no --dsymutil=yes
The --dsymutil option ensures line number information is present in stack traces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment