Skip to content

locality: pass real upper bound to strncpy #694

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 2 commits into
base: development
Choose a base branch
from

Conversation

devreal
Copy link
Member

@devreal devreal commented Feb 25, 2020

Based on a warning from GCC 9.2.0

@codecov
Copy link

codecov bot commented Feb 25, 2020

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 83.82%. Comparing base (22f6487) to head (7f8dc29).
Report is 94 commits behind head on development.

Files Patch % Lines
dart-impl/base/src/locality.c 0.00% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           development     #694      +/-   ##
===============================================
- Coverage        84.09%   83.82%   -0.28%     
===============================================
  Files              336      336              
  Lines            25003    25004       +1     
  Branches         11366    11367       +1     
===============================================
- Hits             21026    20959      -67     
- Misses            3693     3694       +1     
- Partials           284      351      +67     
Files Coverage Δ
dart-impl/base/src/locality.c 25.50% <0.00%> (-0.07%) ⬇️

... and 39 files with indirect coverage changes

@bertwesarg
Copy link
Member

These are my current warnings without the patch:

mpicc -c -o dart-impl/base/src/internal/domain_locality.o -DSPEC -DNDEBUG -Iinclude -DBOOST_ALL_NO_LIB  -Idart-impl/mpi/include -Idart-impl/mpi/src -Idart-impl/base/include -DDART_HAVE_SYNC_BUILTINS -DDART  -O3 -march=native        -DDASH_HAVE_STD_TRIVIALLY_COPYABLE -DDART_MPI_DISABLE_SHARED_WINDOWS         dart-impl/base/src/internal/domain_locality.c
dart-impl/base/src/internal/domain_locality.c: In function 'dart__base__locality__domain__create_module_subdomains.part.4':
dart-impl/base/src/internal/domain_locality.c:1062:18: warning: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size between 0 and 127 [-Wformat-truncation=]
              "%s.%d", module_domain->domain_tag,
                  ^~
dart-impl/base/src/internal/domain_locality.c:1062:14: note: directive argument in the range [0, 2147483647]
              "%s.%d", module_domain->domain_tag,
              ^~~~~~~
In file included from /usr/include/stdio.h:862:0,
                 from dart-impl/base/include/dash/dart/base/logging.h:9,
                 from dart-impl/base/src/internal/domain_locality.c:11:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:64:10: note: '__builtin___snprintf_chk' output between 3 and 139 bytes into a destination of size 128
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dart-impl/base/src/internal/domain_locality.c: In function 'dart__base__locality__domain__update_subdomains':
dart-impl/base/src/internal/domain_locality.c:261:18: warning: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size between 0 and 127 [-Wformat-truncation=]
              "%s.%d", domain->domain_tag, sd);
                  ^~
dart-impl/base/src/internal/domain_locality.c:261:14: note: directive argument in the range [0, 2147483647]
              "%s.%d", domain->domain_tag, sd);
              ^~~~~~~
In file included from /usr/include/stdio.h:862:0,
                 from dart-impl/base/include/dash/dart/base/logging.h:9,
                 from dart-impl/base/src/internal/domain_locality.c:11:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:64:10: note: '__builtin___snprintf_chk' output between 3 and 139 bytes into a destination of size 128
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dart-impl/base/src/internal/domain_locality.c:261:18: warning: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size between 0 and 127 [-Wformat-truncation=]
              "%s.%d", domain->domain_tag, sd);
                  ^~
dart-impl/base/src/internal/domain_locality.c:261:14: note: directive argument in the range [0, 2147483647]
              "%s.%d", domain->domain_tag, sd);
              ^~~~~~~
In file included from /usr/include/stdio.h:862:0,
                 from dart-impl/base/include/dash/dart/base/logging.h:9,
                 from dart-impl/base/src/internal/domain_locality.c:11:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:64:10: note: '__builtin___snprintf_chk' output between 3 and 139 bytes into a destination of size 128
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dart-impl/base/src/internal/domain_locality.c: In function 'dart__base__locality__domain__create_node_subdomains':
dart-impl/base/src/internal/domain_locality.c:819:18: warning: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size between 0 and 127 [-Wformat-truncation=]
              "%s.%d", node_domain->domain_tag,
                  ^~
dart-impl/base/src/internal/domain_locality.c:819:14: note: directive argument in the range [0, 2147483647]
              "%s.%d", node_domain->domain_tag,
              ^~~~~~~
In file included from /usr/include/stdio.h:862:0,
                 from dart-impl/base/include/dash/dart/base/logging.h:9,
                 from dart-impl/base/src/internal/domain_locality.c:11:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:64:10: note: '__builtin___snprintf_chk' output between 3 and 139 bytes into a destination of size 128
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I will see what you patch fixes.

@bertwesarg
Copy link
Member

Obviously none, because that are two different files ;-)

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants