[lttng-dev] Potentially inconsistent string lengths

Thibault, Daniel Daniel.Thibault at drdc-rddc.gc.ca
Thu Feb 2 10:18:59 EST 2012


   In lttng-tools lttng/lttng.h, we have:

struct lttng_domain {
	...
	char exec_name[NAME_MAX];
	...
}

   While in lttng-tools src/bin/lttng-sessiond/trace-ust.h, we have:

struct ltt_ust_domain_exec {
	char exec_name[LTTNG_UST_SYM_NAME_LEN];
	...
}

   If the fields of both structures are meant to refer to the same thing, they should use the same constants.

   The same issue is present for the channel names.  In lttng-modules lib/ringbuffer/backend_types.h, we have:

struct channel_backend {
	...
	char name[NAME_MAX];		/* Channel name */
};

   NAME_MAX is also used in lttng-tools src/common/sessiond-comm/sessiond-comm.h (struct lttcomm_session_msg).  However, in lttng-tools lttng/lttng.h, we have:

struct lttng_channel {
	char name[LTTNG_SYMBOL_NAME_LEN];
	...
};

   On a related note, lttng.h has LTTNG_SYMBOL_NAME_LEN "copied from LTTng kernel ABI", but lttng-abi.h and lttng-kernel.h have LTTNG_SYM_NAME_LEN.  It would be safer to use the same name in all headers.

Daniel U. Thibault
R & D pour la défense Canada - Valcartier (RDDC Valcartier) / Defence R&D Canada - Valcartier (DRDC Valcartier)
Système de systèmes (SdS) / System of Systems (SoS)
Solutions informatiques et expérimentations (SIE) / Computing Solutions and Experimentations (CSE)
2459 Boul. Pie XI Nord
Québec, QC  G3J 1X5
CANADA
Vox : (418) 844-4000 x4245
Fax : (418) 844-4538
NAC: 918V QSDJ
Gouvernement du Canada / Government of Canada
<http://www.valcartier.drdc-rddc.gc.ca/>



More information about the lttng-dev mailing list