Fix: trigger: abort() when adding `--notify` action with python event rule matches
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Wed, 12 May 2021 15:28:26 +0000 (11:28 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 14 May 2021 18:10:22 +0000 (14:10 -0400)
commitfaa9a920e25e5cb42ec2e2bc01618582f8f69bb2
tree6d0ab3039f25f6cfc5c9cd4569c26aa49c0ca191
parent98af972a620f9674af44e43dfa8218cd81fd180d
Fix: trigger: abort() when adding `--notify` action with python event rule matches

Issue
=====
Adding the following trigger makes the sessiond abort:
  lttng add-trigger --condition=event-rule-matches --domain=python --action=notify

With the following stacktrace:
  (gdb) bt
  #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
  #1  0x00007ffff7a71859 in __GI_abort () at abort.c:79
  #2  0x00000000004a1eeb in event_notifier_error_accounting_register_event_notifier (trigger=0x7fffe0000f50, error_counter_index=0x7fffefffde38) at event-notifier-error-accounting.c:1075
  #3  0x00000000004743e6 in setup_tracer_notifier (state=0x7fffefffe3e8, trigger=0x7fffe0000f50) at notification-thread-events.c:2606
  #4  0x000000000046dacb in handle_notification_thread_command_register_trigger (state=0x7fffefffe3e8, trigger=0x7fffe0000f50, is_trigger_anonymous=false, cmd_result=0x7fffedfdd6e8) at notification-thread-events.c:2751
  #5  0x000000000046d083 in handle_notification_thread_command (handle=0x601460, state=0x7fffefffe3e8) at notification-thread-events.c:3112
  #6  0x00000000004687bd in thread_notification (data=0x601460) at notification-thread.c:710
  #7  0x0000000000486703 in launch_thread (data=0x601550) at thread.c:66
  #8  0x00007ffff7c47609 in start_thread (arg=<optimized out>) at pthread_create.c:477
  #9  0x00007ffff7b6e293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

This happens because the LTTNG_DOMAIN_PYTHON domain is not handled by
the switch-case.

Fix
===
Add LTTNG_DOMAIN_PYTHON (all other agent domains) as a fallthrough
LTTNG_DOMAIN_UST.

Note
====
Add a basic test case for python agent.

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I9971cdad8bbc6adca8f6ba49964483c42a25be7d
src/bin/lttng-sessiond/event-notifier-error-accounting.c
tests/regression/tools/trigger/Makefile.am
tests/regression/ust/python-logging/test_python_logging.in
This page took 0.02635 seconds and 4 git commands to generate.