Commit d4b1eb44 authored by Cosimo Cecchi's avatar Cosimo Cecchi

Merge branch '120-analysis-fixes' into 'master'

Resolve "Run analysis tools to prepare for release"

Closes #120

See merge request !88
parents b29f8b60 a9509756
Pipeline #5762 failed with stages
in 14 minutes and 59 seconds
......@@ -230,7 +230,8 @@ AC_ARG_ENABLE([asan],
AS_IF([test "x$enable_asan" = "xyes"], [
AX_CHECK_COMPILE_FLAG([-fsanitize=address -fno-omit-frame-pointer -g], [
AX_CHECK_LINK_FLAG([-fsanitize=address], [SAN_FLAGS="-fsanitize=address"])
AX_CHECK_LINK_FLAG([-fsanitize=address])
SAN_FLAGS="-fsanitize=address"
])
])
......@@ -239,8 +240,8 @@ AC_ARG_ENABLE([ubsan],
AS_IF([test "x$enable_ubsan" = "xyes"], [
AX_CHECK_COMPILE_FLAG([-fsanitize=undefined -fno-sanitize=vptr -fno-omit-frame-pointer -g], [
AX_CHECK_LINK_FLAG([-fsanitize=undefined -fno-sanitize=vptr],
[SAN_FLAGS="$SAN_FLAGS -fsanitize=undefined -fno-sanitize=vptr"])
AX_CHECK_LINK_FLAG([-fsanitize=undefined -fno-sanitize=vptr])
SAN_FLAGS="$SAN_FLAGS -fsanitize=undefined -fno-sanitize=vptr"
])
])
......
......@@ -100,6 +100,7 @@ parse_profile_arg(const char *option_name,
GError **error_out)
{
enable_profiler = true;
g_free(profile_output_path);
if (value)
profile_output_path = g_strdup(value);
return true;
......@@ -115,7 +116,6 @@ check_stray_profile_arg(const char *option_name,
"command line. Support for this will be removed in a future "
"version. Place the option before the script or use the "
"GJS_ENABLE_PROFILER environment variable.");
g_free(profile_output_path);
return parse_profile_arg(option_name, value, data, error_out);
}
......@@ -320,7 +320,6 @@ main(int argc, char **argv)
if (enable_profiler && profile_output_path) {
GjsProfiler *profiler = gjs_context_get_profiler(js_context);
gjs_profiler_set_filename(profiler, profile_output_path);
g_free(profile_output_path);
}
/* prepare command line arguments */
......@@ -350,6 +349,7 @@ main(int argc, char **argv)
gjs_coverage_write_statistics(coverage);
g_free(coverage_output_path);
g_free(profile_output_path);
g_strfreev(coverage_prefixes);
if (coverage)
g_object_unref(coverage);
......
......@@ -84,6 +84,54 @@
fun:clone
}
# Various things that I don't believe are related to GJS
{
gl-dispatch-init
Memcheck:Leak
match-leak-kinds: possible
...
fun:__glDispatchInit
}
{
gl-dispatch-register-stub-callbacks
Memcheck:Leak
match-leak-kinds: possible
...
fun:__glDispatchRegisterStubCallbacks
}
{
gtk-style-context
Memcheck:Leak
match-leak-kinds: possible
fun:malloc
fun:g_malloc
...
fun:gtk_style_new
fun:gtk_widget_get_default_style
}
# https://bugs.freedesktop.org/show_bug.cgi?id=105466
{
freedesktop-bug-105466
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
...
fun:FcPatternDuplicate
fun:_cairo_ft_font_face_create_for_pattern
fun:_cairo_ft_font_face_create_for_toy
fun:_cairo_toy_font_face_create_impl_face
fun:_cairo_toy_font_face_init
fun:cairo_toy_font_face_create
fun:_cairo_gstate_ensure_font_face
fun:_cairo_gstate_ensure_scaled_font
fun:_cairo_gstate_get_scaled_font
fun:_cairo_default_context_get_scaled_font
fun:cairo_show_text
}
# SpiderMonkey data races
......
......@@ -3,3 +3,6 @@ leak:js::HelperThread::threadLoop
# We leak a small wrapper in GJS for each registered GType.
leak:gjs_gtype_create_gtype_wrapper
# https://bugs.freedesktop.org/show_bug.cgi?id=105466
leak:libfontconfig.so.1
......@@ -88,10 +88,16 @@ test $? -eq 42
report "System.exit(42) should exit with the correct exit code"
# FIXME: should check -eq 42 specifically, but in debug mode we will be
# hitting an assertion
$gjs exit.js
test $? -ne 0
report "System.exit() should still exit across an FFI boundary"
# hitting an assertion. For this reason, skip when running under valgrind
# since nothing will be freed.
echo "# VALGRIND = $VALGRIND"
if test -z $VALGRIND; then
$gjs exit.js
test $? -ne 0
report "System.exit() should still exit across an FFI boundary"
else
skip "System.exit() should still exit across an FFI boundary" "running under valgrind"
fi
# gjs --help prints GJS help
$gjs --help >/dev/null
......
......@@ -387,7 +387,7 @@ gjstest_test_profiler_start_stop(void)
gjs_profiler_start(profiler);
for (size_t ix = 0; ix < 100000; ix++) {
for (size_t ix = 0; ix < 100; ix++) {
GError *error = nullptr;
int estatus;
......
......@@ -432,7 +432,7 @@ sp_capture_writer_new_from_fd (int fd,
self = g_new0 (SpCaptureWriter, 1);
self->ref_count = 1;
self->fd = fd;
self->buf = (guint8 *)g_malloc (buffer_size);
self->buf = (guint8 *)g_malloc0 (buffer_size);
self->len = buffer_size;
self->next_counter_id = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment