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

GCC reports mismatched-new-delete in some cases #2

Open
yarkinwho opened this issue Jul 11, 2023 · 0 comments
Open

GCC reports mismatched-new-delete in some cases #2

yarkinwho opened this issue Jul 11, 2023 · 0 comments

Comments

@yarkinwho
Copy link
Contributor

Got the following compiler error in a ubuntu 22 VM on Mac M2 with gcc 11.3.0

Not seen on other machines so the effect is minor. But we record the issue here just in case some other settings result in the same error.

Might related to when awaitable function becomes too large certain config makes it go into different alloc/free routine. Reducing the function size by take out some logics to another function seems help.

error: ‘static void boost::asio::detail::awaitable_frame_base<Executor>::operator delete(void*, std::size_t) [with Executor = boost::asio::any_io_executor]’ called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete]
  365 | }
      | ^
In file included from /home/parallels/.conan/data/boost/1.81.0/_/_/package/8899ea1c41c19e5e9e9ef65936e1bad21e84df83/include/boost/asio/detail/handler_alloc_helpers.hpp:19,
                 from /home/parallels/.conan/data/boost/1.81.0/_/_/package/8899ea1c41c19e5e9e9ef65936e1bad21e84df83/include/boost/asio/detail/executor_function.hpp:19,
                 from /home/parallels/.conan/data/boost/1.81.0/_/_/package/8899ea1c41c19e5e9e9ef65936e1bad21e84df83/include/boost/asio/execution/any_executor.hpp:24,
                 from /home/parallels/.conan/data/boost/1.81.0/_/_/package/8899ea1c41c19e5e9e9ef65936e1bad21e84df83/include/boost/asio/execution.hpp:19,
                 from /home/parallels/.conan/data/boost/1.81.0/_/_/package/8899ea1c41c19e5e9e9ef65936e1bad21e84df83/include/boost/asio/any_io_executor.hpp:22,
                 from /home/parallels/.conan/data/boost/1.81.0/_/_/package/8899ea1c41c19e5e9e9ef65936e1bad21e84df83/include/boost/asio/awaitable.hpp:29,
                 from /home/parallels/code/evm_repos/eos-evm-node/external/silkworm/silkworm/silkrpc/commands/ots_api.hpp:21,
                 from /home/parallels/code/evm_repos/eos-evm-node/external/silkworm/silkworm/silkrpc/commands/ots_api.cpp:17:
/home/parallels/.conan/data/boost/1.81.0/_/_/package/8899ea1c41c19e5e9e9ef65936e1bad21e84df83/include/boost/asio/detail/memory.hpp:120:33: note: returned from ‘void* aligned_alloc(size_t, size_t)’
  120 |   void* ptr = std::aligned_alloc(align, size);
      |               ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

2 participants