mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
validate: Plug some leaks
And add some valgrind suppression for fontconfig
This commit is contained in:
parent
a055c3272e
commit
9b260a1ec6
7 changed files with 73 additions and 11 deletions
|
@ -201,3 +201,41 @@
|
||||||
fun:_draw_background
|
fun:_draw_background
|
||||||
fun:gst_gl_video_mixer_callback
|
fun:gst_gl_video_mixer_callback
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
#https://bugs.freedesktop.org/show_bug.cgi?id=8215
|
||||||
|
#https://bugs.freedesktop.org/show_bug.cgi?id=8428
|
||||||
|
#FcPattern uses 'intptr_t elts_offset' instead of 'FcPatternEltPtr elts',
|
||||||
|
#which confuses valgrind.
|
||||||
|
font_config_bug_2
|
||||||
|
Memcheck:Leak
|
||||||
|
fun:*alloc
|
||||||
|
...
|
||||||
|
fun:Fc*Add*
|
||||||
|
}
|
||||||
|
{
|
||||||
|
#Same root cause as font_config_bug_2.
|
||||||
|
#The 'leak' here is a copy of rule values, as opposed to new values.
|
||||||
|
font_config_bug_3
|
||||||
|
Memcheck:Leak
|
||||||
|
fun:*alloc
|
||||||
|
...
|
||||||
|
fun:FcConfigValues
|
||||||
|
}
|
||||||
|
{
|
||||||
|
#Same root cause as font_config_bug_2.
|
||||||
|
#The 'leak' is copies of font or pattern values into returned pattern values.
|
||||||
|
font_config_bug_4
|
||||||
|
Memcheck:Leak
|
||||||
|
fun:*alloc
|
||||||
|
...
|
||||||
|
fun:FcValue*
|
||||||
|
fun:FcFontRenderPrepare
|
||||||
|
}
|
||||||
|
{
|
||||||
|
font_config_bug_6
|
||||||
|
Memcheck:Leak
|
||||||
|
fun:*alloc
|
||||||
|
...
|
||||||
|
obj:*/libfontconfig.so.*
|
||||||
|
}
|
|
@ -150,7 +150,7 @@ gst_validate_bin_monitor_dispose (GObject * object)
|
||||||
if (monitor->scenario) {
|
if (monitor->scenario) {
|
||||||
gst_validate_reporter_purge_reports (GST_VALIDATE_REPORTER
|
gst_validate_reporter_purge_reports (GST_VALIDATE_REPORTER
|
||||||
(monitor->scenario));
|
(monitor->scenario));
|
||||||
g_object_unref (monitor->scenario);
|
gst_object_unref (monitor->scenario);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_list_free_full (monitor->element_monitors, purge_and_unref_reporter);
|
g_list_free_full (monitor->element_monitors, purge_and_unref_reporter);
|
||||||
|
|
|
@ -959,7 +959,7 @@ gst_validate_pad_monitor_reset (GstValidatePadMonitor * pad_monitor)
|
||||||
{
|
{
|
||||||
gst_validate_pad_monitor_flush (pad_monitor);
|
gst_validate_pad_monitor_flush (pad_monitor);
|
||||||
|
|
||||||
/* Note : For the entries that haven't been resetted in _flush(), do
|
/* Note : For the entries that haven't been reset in _flush(), do
|
||||||
* it here and keep in the same order as the GstValidatePadMonitor
|
* it here and keep in the same order as the GstValidatePadMonitor
|
||||||
* structure */
|
* structure */
|
||||||
|
|
||||||
|
@ -1637,11 +1637,17 @@ gst_validate_pad_monitor_add_expected_newsegment (GstValidatePadMonitor *
|
||||||
switch (gst_iterator_next (iter, &value)) {
|
switch (gst_iterator_next (iter, &value)) {
|
||||||
case GST_ITERATOR_OK:
|
case GST_ITERATOR_OK:
|
||||||
otherpad = g_value_get_object (&value);
|
otherpad = g_value_get_object (&value);
|
||||||
if (!otherpad)
|
if (!otherpad) {
|
||||||
|
g_value_reset (&value);
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
othermonitor = _GET_PAD_MONITOR (otherpad);
|
othermonitor = _GET_PAD_MONITOR (otherpad);
|
||||||
if (!othermonitor)
|
if (!othermonitor) {
|
||||||
|
g_value_reset (&value);
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
GST_VALIDATE_MONITOR_LOCK (othermonitor);
|
GST_VALIDATE_MONITOR_LOCK (othermonitor);
|
||||||
gst_event_replace (&othermonitor->expected_segment, event);
|
gst_event_replace (&othermonitor->expected_segment, event);
|
||||||
GST_VALIDATE_MONITOR_UNLOCK (othermonitor);
|
GST_VALIDATE_MONITOR_UNLOCK (othermonitor);
|
||||||
|
|
|
@ -775,6 +775,7 @@ gst_validate_pipeline_monitor_create_scenarios (GstValidateBinMonitor * monitor)
|
||||||
GST_INFO_OBJECT (monitor, "Not attaching to pipeline %" GST_PTR_FORMAT
|
GST_INFO_OBJECT (monitor, "Not attaching to pipeline %" GST_PTR_FORMAT
|
||||||
" as not matching pattern %s", target, scenario_v[1]);
|
" as not matching pattern %s", target, scenario_v[1]);
|
||||||
|
|
||||||
|
g_strfreev (scenario_v);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -747,6 +747,7 @@ _report_free (GstValidateReport * report)
|
||||||
g_free (report->message);
|
g_free (report->message);
|
||||||
g_free (report->reporter_name);
|
g_free (report->reporter_name);
|
||||||
g_free (report->trace);
|
g_free (report->trace);
|
||||||
|
g_free (report->dotfile_name);
|
||||||
g_list_free_full (report->shadow_reports,
|
g_list_free_full (report->shadow_reports,
|
||||||
(GDestroyNotify) gst_validate_report_unref);
|
(GDestroyNotify) gst_validate_report_unref);
|
||||||
g_list_free_full (report->repeated_reports,
|
g_list_free_full (report->repeated_reports,
|
||||||
|
@ -767,6 +768,7 @@ gst_validate_report_new (GstValidateIssue * issue,
|
||||||
gst_mini_object_init (((GstMiniObject *) report), 0,
|
gst_mini_object_init (((GstMiniObject *) report), 0,
|
||||||
_gst_validate_report_type, NULL, NULL,
|
_gst_validate_report_type, NULL, NULL,
|
||||||
(GstMiniObjectFreeFunction) _report_free);
|
(GstMiniObjectFreeFunction) _report_free);
|
||||||
|
GST_MINI_OBJECT_FLAG_SET (report, GST_MINI_OBJECT_FLAG_MAY_BE_LEAKED);
|
||||||
|
|
||||||
report->issue = issue;
|
report->issue = issue;
|
||||||
/* The reporter is owning a ref on the report so it doesn't keep a ref to
|
/* The reporter is owning a ref on the report so it doesn't keep a ref to
|
||||||
|
|
|
@ -541,6 +541,8 @@ _update_well_known_vars (GstValidateScenario * scenario)
|
||||||
} else {
|
} else {
|
||||||
GST_WARNING_OBJECT (scenario, "Could not query position");
|
GST_WARNING_OBJECT (scenario, "Could not query position");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gst_object_unref (pipeline);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
@ -2861,6 +2863,7 @@ _execute_appsrc_push (GstValidateScenario * scenario,
|
||||||
gst_validate_action_ref (action);
|
gst_validate_action_ref (action);
|
||||||
|
|
||||||
g_signal_emit_by_name (target, "push-buffer", buffer, &push_buffer_ret);
|
g_signal_emit_by_name (target, "push-buffer", buffer, &push_buffer_ret);
|
||||||
|
gst_buffer_unref (buffer);
|
||||||
if (push_buffer_ret != GST_FLOW_OK) {
|
if (push_buffer_ret != GST_FLOW_OK) {
|
||||||
gchar *structure_string = gst_structure_to_string (action->structure);
|
gchar *structure_string = gst_structure_to_string (action->structure);
|
||||||
GST_VALIDATE_REPORT_ACTION (scenario, action,
|
GST_VALIDATE_REPORT_ACTION (scenario, action,
|
||||||
|
@ -3004,6 +3007,7 @@ gst_validate_action_default_prepare_func (GstValidateAction * action)
|
||||||
GstClockTime tmp;
|
GstClockTime tmp;
|
||||||
gchar *repeat_expr;
|
gchar *repeat_expr;
|
||||||
gchar *error = NULL;
|
gchar *error = NULL;
|
||||||
|
GstValidateExecuteActionReturn res = GST_VALIDATE_EXECUTE_ACTION_OK;
|
||||||
GstValidateActionType *type = gst_validate_get_action_type (action->type);
|
GstValidateActionType *type = gst_validate_get_action_type (action->type);
|
||||||
GstValidateScenario *scenario = gst_validate_action_get_scenario (action);
|
GstValidateScenario *scenario = gst_validate_action_get_scenario (action);
|
||||||
|
|
||||||
|
@ -3018,17 +3022,17 @@ gst_validate_action_default_prepare_func (GstValidateAction * action)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action->repeat > 0)
|
if (action->repeat > 0)
|
||||||
return GST_VALIDATE_EXECUTE_ACTION_OK;
|
goto done;
|
||||||
|
|
||||||
if (!gst_structure_has_field (action->structure, "repeat"))
|
if (!gst_structure_has_field (action->structure, "repeat"))
|
||||||
return GST_VALIDATE_EXECUTE_ACTION_OK;
|
goto done;
|
||||||
|
|
||||||
if (gst_structure_get_int (action->structure, "repeat", &action->repeat))
|
if (gst_structure_get_int (action->structure, "repeat", &action->repeat))
|
||||||
return GST_VALIDATE_EXECUTE_ACTION_OK;
|
goto done;
|
||||||
|
|
||||||
if (gst_structure_get_double (action->structure, "repeat",
|
if (gst_structure_get_double (action->structure, "repeat",
|
||||||
(gdouble *) & action->repeat))
|
(gdouble *) & action->repeat))
|
||||||
return GST_VALIDATE_EXECUTE_ACTION_OK;
|
goto done;
|
||||||
|
|
||||||
repeat_expr =
|
repeat_expr =
|
||||||
g_strdup (gst_structure_get_string (action->structure, "repeat"));
|
g_strdup (gst_structure_get_string (action->structure, "repeat"));
|
||||||
|
@ -3036,7 +3040,7 @@ gst_validate_action_default_prepare_func (GstValidateAction * action)
|
||||||
g_error ("Invalid value for 'repeat' in %s",
|
g_error ("Invalid value for 'repeat' in %s",
|
||||||
gst_structure_to_string (action->structure));
|
gst_structure_to_string (action->structure));
|
||||||
|
|
||||||
return GST_VALIDATE_EXECUTE_ACTION_ERROR;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
action->repeat =
|
action->repeat =
|
||||||
|
@ -3046,7 +3050,7 @@ gst_validate_action_default_prepare_func (GstValidateAction * action)
|
||||||
g_error ("Invalid value for 'repeat' in %s: %s",
|
g_error ("Invalid value for 'repeat' in %s: %s",
|
||||||
gst_structure_to_string (action->structure), error);
|
gst_structure_to_string (action->structure), error);
|
||||||
|
|
||||||
return GST_VALIDATE_EXECUTE_ACTION_ERROR;
|
goto err;
|
||||||
}
|
}
|
||||||
g_free (repeat_expr);
|
g_free (repeat_expr);
|
||||||
|
|
||||||
|
@ -3055,10 +3059,14 @@ gst_validate_action_default_prepare_func (GstValidateAction * action)
|
||||||
gst_structure_set (action->priv->main_structure, "repeat", G_TYPE_INT,
|
gst_structure_set (action->priv->main_structure, "repeat", G_TYPE_INT,
|
||||||
action->repeat, NULL);
|
action->repeat, NULL);
|
||||||
|
|
||||||
|
done:
|
||||||
if (scenario)
|
if (scenario)
|
||||||
gst_object_unref (scenario);
|
gst_object_unref (scenario);
|
||||||
|
|
||||||
return GST_VALIDATE_EXECUTE_ACTION_OK;
|
return res;
|
||||||
|
err:
|
||||||
|
res = GST_VALIDATE_EXECUTE_ACTION_ERROR;
|
||||||
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -3113,6 +3121,7 @@ gst_validate_scenario_check_latency (GstValidateScenario * scenario,
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_query_parse_latency (query, NULL, &min_latency, NULL);
|
gst_query_parse_latency (query, NULL, &min_latency, NULL);
|
||||||
|
gst_query_unref (query);
|
||||||
GST_DEBUG_OBJECT (scenario, "Pipeline latency: %" GST_TIME_FORMAT
|
GST_DEBUG_OBJECT (scenario, "Pipeline latency: %" GST_TIME_FORMAT
|
||||||
" max allowed: %" GST_TIME_FORMAT,
|
" max allowed: %" GST_TIME_FORMAT,
|
||||||
GST_TIME_ARGS (min_latency), GST_TIME_ARGS (priv->max_latency));
|
GST_TIME_ARGS (min_latency), GST_TIME_ARGS (priv->max_latency));
|
||||||
|
@ -4310,6 +4319,7 @@ check_last_sample_internal (GstValidateScenario * scenario,
|
||||||
}
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
gst_sample_unref (sample);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4352,6 +4362,8 @@ _check_last_sample_value (GstValidateScenario * scenario,
|
||||||
g_object_get (sink, "last-sample", &sample, NULL);
|
g_object_get (sink, "last-sample", &sample, NULL);
|
||||||
if (sample == NULL)
|
if (sample == NULL)
|
||||||
return GST_VALIDATE_EXECUTE_ACTION_ASYNC;
|
return GST_VALIDATE_EXECUTE_ACTION_ASYNC;
|
||||||
|
gst_sample_unref (sample);
|
||||||
|
gst_validate_action_unref (action);
|
||||||
|
|
||||||
g_signal_handlers_disconnect_by_func (sink, sink_last_sample_notify_cb,
|
g_signal_handlers_disconnect_by_func (sink, sink_last_sample_notify_cb,
|
||||||
action);
|
action);
|
||||||
|
@ -4479,10 +4491,12 @@ _execute_check_last_sample (GstValidateScenario * scenario,
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_clear_object (&pipeline);
|
||||||
return _check_last_sample_value (scenario, action, sink);
|
return _check_last_sample_value (scenario, action, sink);
|
||||||
|
|
||||||
error:
|
error:
|
||||||
g_clear_object (&sink);
|
g_clear_object (&sink);
|
||||||
|
g_clear_object (&pipeline);
|
||||||
return GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED;
|
return GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -223,6 +223,7 @@ validate_flow_override_new (GstStructure * config)
|
||||||
gchar *ignored_fields, *logged_fields;
|
gchar *ignored_fields, *logged_fields;
|
||||||
|
|
||||||
flow = g_object_new (VALIDATE_TYPE_FLOW_OVERRIDE, NULL);
|
flow = g_object_new (VALIDATE_TYPE_FLOW_OVERRIDE, NULL);
|
||||||
|
GST_OBJECT_FLAG_SET (flow, GST_OBJECT_FLAG_MAY_BE_LEAKED);
|
||||||
override = GST_VALIDATE_OVERRIDE (flow);
|
override = GST_VALIDATE_OVERRIDE (flow);
|
||||||
|
|
||||||
/* pad: Name of the pad where flowing buffers and events will be monitorized. */
|
/* pad: Name of the pad where flowing buffers and events will be monitorized. */
|
||||||
|
|
Loading…
Reference in a new issue