Skip to content

DAOS-18527 cart: Handling of string env limits#17466

Merged
mchaarawi merged 3 commits intomasterfrom
frostedcmos/DAOS-18527
Feb 3, 2026
Merged

DAOS-18527 cart: Handling of string env limits#17466
mchaarawi merged 3 commits intomasterfrom
frostedcmos/DAOS-18527

Conversation

@frostedcmos
Copy link
Contributor

  • CRT_ENV_STR_MAX_SIZE introduced, set to 1024. All string envs are checked against this limit at the data_init() time.

  • Additional checks added for domain/interface not to exceed this limit, as those can be passed via crt_init_opt.

Steps for the author:

  • Commit message follows the guidelines.
  • Appropriate Features or Test-tag pragmas were used.
  • Appropriate Functional Test Stages were run.
  • At least two positive code reviews including at least one code owner from each category referenced in the PR.
  • Testing is complete. If necessary, forced-landing label added and a reason added in a comment.

After all prior steps are complete:

  • Gatekeeper requested (daos-gatekeeper added as a reviewer).

- CRT_ENV_STR_MAX_SIZE introduced, set to 1024. All string envs
are checked against this limit at the data_init() time.

- Additional checks added for domain/interface not to exceed this limit,
as those can be passed via crt_init_opt.

Signed-off-by: Alexander A Oganezov <alexander.oganezov@hpe.com>
@frostedcmos frostedcmos requested review from a team as code owners January 27, 2026 23:49
@github-actions
Copy link

github-actions bot commented Jan 27, 2026

Ticket title is 'CART: cart limits interface/domain strings to 64 characters, resulting in errors'
Status is 'In Progress'
https://daosio.atlassian.net/browse/DAOS-18527

@daosbuild3
Copy link
Collaborator

Test stage Functional Hardware Medium Verbs Provider MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17466/1/execution/node/1309/log

Signed-off-by: Alexander A Oganezov <alexander.oganezov@hpe.com>
@frostedcmos frostedcmos requested a review from soumagne January 28, 2026 17:08
Signed-off-by: Alexander A Oganezov <alexander.oganezov@hpe.com>
* env checks limit strings to CRT_ENV_STR_MAX_SIZE, but a domain can
* be passed as an init argument
*/
if (strlen(na_cfg->noc_domain) + 1 >= CRT_ENV_STR_MAX_SIZE) {
Copy link
Collaborator

@soumagne soumagne Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need parentheses here ? I'm surprised the compiler does not complain if it does not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why ? math operations take precedence over comparisons

@daosbuild3
Copy link
Collaborator

Test stage Functional Hardware Medium Verbs Provider MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-17466/4/execution/node/1359/log

@daosbuild3
Copy link
Collaborator

Test stage Functional Hardware Large MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos/job/PR-17466/6/display/redirect

1 similar comment
@daosbuild3
Copy link
Collaborator

Test stage Functional Hardware Large MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos/job/PR-17466/6/display/redirect

@frostedcmos frostedcmos requested a review from a team February 2, 2026 21:37

if (interface) {
D_STRNDUP(na_cfg->noc_interface, interface, 64);
D_STRNDUP(na_cfg->noc_interface, interface, CRT_ENV_STR_MAX_SIZE);
Copy link
Contributor

@mchaarawi mchaarawi Feb 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we try to make this more robust?
this is not necessarily an env variable, and sometimes it can contain multiple interfaces like the issue Johann had, so like CRT_ENV_STR_MAX_SIZE * number of interfaces (seprated be , or : forgot what it is here)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im not opposed to this as is.. i think 1k is probably enough to cover 60 interfaces/domains or more :-)

Copy link
Contributor Author

@frostedcmos frostedcmos Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am mixed on this. On one hand, i agree that having individual limits would be better, but then we would have to do similar for other strings as well such as domains, provider and ports (for multiprovider case) and possibly others (like auth keys).

If we change this to be CRT_ENV_STR_MAX_SIZE * num_interfaces here, then we would have to allow the similar sized string to be passed via D_INTERFACE environment variable as well. This would require changing each cart env declaration to specify an individual limit.

In addition, we dont know the number of interfaces ahead of time, and we only access envs once they are all copied out by cart (at init time), so even at best it would need to be some static amount such as CRT_ENV_STR_MAX_SIZE * max_num_interfaces for D_INTERFACE and CRT_ENV_STR_MAX_SIZE * max_num_providers for D_PROVIDER, etc..

With all that i feel that having a single max value big enough for all input strings is much cleaner for now.

@mchaarawi mchaarawi merged commit c514c33 into master Feb 3, 2026
41 checks passed
@mchaarawi mchaarawi deleted the frostedcmos/DAOS-18527 branch February 3, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants