Hi John


On 12/19/21 16:16, John Crow wrote:
I ought to have said at first how much I appreciate having Valgrind available. It's invaluable, and thank you for your attention.

'You are building with the same compiler that was used at configure time?'
Yes. I verified by doing a configure>>make>>make check right now in a freshly untarred build folder. Outside of specifying --prefix to configure, defaults all the way.


It shouldn't make a difference, but does running the 'autogen.sh' script in the Valgrind root directory before configure make any difference?



'I'm using GCC 11 and in /usr/include/c++/11/new there is [snipped] ... Does yours look similar?'
Yes, for me it's in /usr/include/c++/9/new.

I'll have to figure out the diff --git suggestion.


In both case the unsigned constant for the size [64U and 320U] is changed to be cast to size_t [size_t(64U) and size_t(320U)]



Two chunks out of config.log that might or might not be pertinent, I simply searched for 'delete':

configure:10224: result: no


configure:10857: result: yes
configure:10888: checking if g++ supports aligned new and delete
configure:10916: c++ -c -std=c++17  conftest.cpp >&5
configure:10916: $? = 0
configure:10919: result: yes


That's the one.


Can you also try directly compiling the file to try to find out what does and does not work.


For instance (tests done with GCC 9.4 on FreeBSD)


cd memcheck/tests

 g++9 -g cxx17_aligned_new.cpp  -std=c++17 -o foo // this works


g++9 -g cxx17_aligned_new.cpp  -std=c++17 -o foo -fno-sized-deallocation
cxx17_aligned_new.cpp: In function 'int main()':
cxx17_aligned_new.cpp:25:56: error: no matching function for call to 'operator delete(MyClass*&, unsigned int, std::align_val_t)'
   25 |     operator delete(myClass, 64U, std::align_val_t(64U));
      |                                                        ^
In file included from cxx17_aligned_new.cpp:2:
/usr/local/lib/gcc9/include/c++/new:129:6: note: candidate: 'void operator delete(void*)'
  129 | void operator delete(void*) _GLIBCXX_USE_NOEXCEPT

[SNIP other candidates and 2nd error]


One last suggestion, you can you run the preprocessor and see if the delete overloads are there?


g++9 -g cxx17_aligned_new.cpp  -std=c++17 -E -o foo.E


then view foo.E and look for "operator delete". The last two overloads that I see are


void operator delete(void*, std::size_t, std::align_val_t)
  noexcept __attribute__((__externally_visible__));
void operator delete[](void*, std::size_t, std::align_val_t)
  noexcept __attribute__((__externally_visible__));


A+

Paul


_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to