Fix: sessiond: don't assert on event creation error
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 11 Oct 2019 20:26:29 +0000 (16:26 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 11 Oct 2019 20:32:11 +0000 (16:32 -0400)
Don't assert if an application tracer reports that an event already
exists. This could be caused by a bug on the tracer end or memory
corruption on the application's end. In either case, an assert() is
too strict; simply report the error.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/ust-app.c

index aea37badb23ff6e829930181e2fb9dbdf70dd595..b3251c19c94ff6feb173fb387866becc799e6c03 100644 (file)
@@ -3142,8 +3142,19 @@ int create_ust_app_event(struct ust_app_session *ua_sess,
        /* Create it on the tracer side */
        ret = create_ust_event(app, ua_sess, ua_chan, ua_event);
        if (ret < 0) {
-               /* Not found previously means that it does not exist on the tracer */
-               assert(ret != -LTTNG_UST_ERR_EXIST);
+               /*
+                * Not found previously means that it does not exist on the
+                * tracer. If the application reports that the event existed,
+                * it means there is a bug in the sessiond or lttng-ust
+                * (or corruption, etc.)
+                */
+               if (ret == -LTTNG_UST_ERR_EXIST) {
+                       ERR("Tracer for application reported that an event being created already existed: "
+                                       "event_name = \"%s\", pid = %d, ppid = %d, uid = %d, gid = %d",
+                                       uevent->attr.name,
+                                       app->pid, app->ppid, app->uid,
+                                       app->gid);
+               }
                goto error;
        }
 
This page took 0.028997 seconds and 5 git commands to generate.