Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix warnings about allocations exceeding maximum object size #1600

Merged
merged 1 commit into from Jan 25, 2022

Conversation

ellert
Copy link
Contributor

@ellert ellert commented Jan 24, 2022

In member function 'Init',
    inlined from 'Init' at .../src/Xrd/XrdBuffXL.cc:64:6:
.../src/Xrd/XrdBuffXL.cc:90:30: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   90 |    bucket = new BuckVec[lg2+1];
      |                              ^
/usr/include/c++/12/new: In member function 'Init':
/usr/include/c++/12/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^

.../src/XrdOuc/XrdOucBuffer.cc: In member function '__ct_base ':
.../src/XrdOuc/XrdOucBuffer.cc:79:30: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   79 |    bSlot = new BuffSlot[slots];
      |                              ^
/usr/include/c++/12/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^

.../src/XrdNet/XrdNetUtils.cc: In function 'GetAddrs':
.../src/XrdNet/XrdNetUtils.cc:262:35: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
  262 |        *aVec = new XrdNetAddr[aVsz];
      |                                   ^
/usr/include/c++/12/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^

In member function '__ct ',
    inlined from '__ct_base ' at .../src/XrdXrootd/XrdXrootdJob.cc:459:29:
.../src/./XrdOuc/XrdOucTable.hh:43:30: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   43 |                      Table = new OucTable[maxe];
      |                              ^
/usr/include/c++/12/new: In member function '__ct_base ':
/usr/include/c++/12/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^

.../src/XrdPosix/XrdPosixAdmin.cc: In member function 'FanOut':
.../src/XrdPosix/XrdPosixAdmin.cc:69:27: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   69 |    uVec = new XrdCl::URL[i];
      |                           ^
/usr/include/c++/12/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^

In member function 'Init',
    inlined from 'Init' at .../src/Xrd/XrdBuffXL.cc:64:6:
.../src/Xrd/XrdBuffXL.cc:90:30: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   90 |    bucket = new BuckVec[lg2+1];
      |                              ^
/usr/include/c++/12/new: In member function 'Init':
/usr/include/c++/12/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^

.../src/XrdOuc/XrdOucBuffer.cc: In member function '__ct_base ':
.../src/XrdOuc/XrdOucBuffer.cc:79:30: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   79 |    bSlot = new BuffSlot[slots];
      |                              ^
/usr/include/c++/12/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^

.../src/XrdNet/XrdNetUtils.cc: In function 'GetAddrs':
.../src/XrdNet/XrdNetUtils.cc:262:35: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
  262 |        *aVec = new XrdNetAddr[aVsz];
      |                                   ^
/usr/include/c++/12/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^

In member function '__ct ',
    inlined from '__ct_base ' at .../src/XrdXrootd/XrdXrootdJob.cc:459:29:
.../src/./XrdOuc/XrdOucTable.hh:43:30: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   43 |                      Table = new OucTable[maxe];
      |                              ^
/usr/include/c++/12/new: In member function '__ct_base ':
/usr/include/c++/12/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^

.../src/XrdPosix/XrdPosixAdmin.cc: In member function 'FanOut':
.../src/XrdPosix/XrdPosixAdmin.cc:69:27: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   69 |    uVec = new XrdCl::URL[i];
      |                           ^
/usr/include/c++/12/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^
@abh3 abh3 merged commit 10b484f into xrootd:master Jan 25, 2022
@ellert ellert deleted the alloc-larger-than branch January 26, 2022 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants