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

test for #1320 #1

Closed
wants to merge 1 commit into from
Closed

test for #1320 #1

wants to merge 1 commit into from

Conversation

tchaikov
Copy link
Owner

No description provided.

@tchaikov
Copy link
Owner Author

test failure tracked by scylladb#1320

@tchaikov tchaikov force-pushed the clang-15-CWG2631-with-clang-15 branch from 04ea3b6 to 2a3b0dc Compare December 1, 2022 12:39
@tchaikov tchaikov changed the title Clang 15 cwg2631 with clang 15 test for #1320 Dec 2, 2022
@tchaikov tchaikov force-pushed the clang-15-CWG2631-with-clang-15 branch 2 times, most recently from 1e0e681 to 4799781 Compare December 3, 2022 06:44
Signed-off-by: Kefu Chai <tchaikov@gmail.com>
@tchaikov tchaikov force-pushed the clang-15-CWG2631-with-clang-15 branch from 4799781 to 4574f02 Compare December 3, 2022 13:13
tchaikov added a commit that referenced this pull request Jan 9, 2023
this change is a follow-up of 338ba97.

before this change, ${CMAKE_CURRENT_BINARY_DIR} is used for
Seastar_BINARY_DIR. if Seastar is a top-level project, the values
of ${CMAKE_CURRENT_BINARY_DIR} and ${CMAKE_BINARY_DIR} are
identical. but if Seastar is embedded in a parent project,
${CMAKE_BINARY_DIR} would be somewhere like "bulid/seastar" where
"build" is the build directory of the parent project.
but we are still referencing the build directory with
${Seastar_BINARY_DIR} and issuing commands like

cmake --build ${Seastar_BINARY_DIR} --target ${target}

if this would fail as the build directory is not ${Seastar_BINARY_DIR}
anymore. if the cmake generator is make, the failure would look like:

> gmake: *** No rule to make target 'test_unit_abort_source_run'.  Stop.

if the cmake generator is ninja, the failure would look like:

> 1/95 Test  #1: Seastar.unit.abort_source .....................***Failed    0.02 sec
> ninja: error: loading 'build.ninja': No such file or directory

after this change, all occurrences of

cmake --build ${Seastar_BINARY_DIR}

are changed to

cmake --build ${CMAKE_BINARY_DIR}

this ensure that these commands can find the build directory
at the top level of the build tree.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
tchaikov added a commit that referenced this pull request Jan 9, 2023
this change is a follow-up of 338ba97.

before this change, ${CMAKE_CURRENT_BINARY_DIR} is used for
Seastar_BINARY_DIR. if Seastar is a top-level project, the values
of ${CMAKE_CURRENT_BINARY_DIR} and ${CMAKE_BINARY_DIR} are
identical. but if Seastar is embedded in a parent project,
${CMAKE_BINARY_DIR} would be somewhere like "bulid/seastar" where
"build" is the build directory of the parent project.
but we are still referencing the build directory with
${Seastar_BINARY_DIR} and issuing commands like

cmake --build ${Seastar_BINARY_DIR} --target ${target}

if this would fail as the build directory is not ${Seastar_BINARY_DIR}
anymore. if the cmake generator is make, the failure would look like:

> gmake: *** No rule to make target 'test_unit_abort_source_run'.  Stop.

if the cmake generator is ninja, the failure would look like:

> 1/95 Test  #1: Seastar.unit.abort_source .....................***Failed    0.02 sec
> ninja: error: loading 'build.ninja': No such file or directory

after this change, all occurrences of

cmake --build ${Seastar_BINARY_DIR}

are changed to

cmake --build ${CMAKE_BINARY_DIR}

this ensure that these commands can find the build directory
at the top level of the build tree.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
@tchaikov tchaikov closed this Mar 21, 2023
@tchaikov tchaikov deleted the clang-15-CWG2631-with-clang-15 branch March 21, 2023 01:12
tchaikov added a commit that referenced this pull request May 7, 2024
in main(), we creates an instance of `http_server_control` using
new, but we never destroy it. this is identified by ASan

```
==2190125==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 8 byte(s) in 1 object(s) allocated from:
    #0 0x55e21cf487bd in operator new(unsigned long) /home/kefu/dev/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:86:3
    #1 0x55e21cf6cf31 in main::$_0::operator()() const::'lambda'()::operator()() const /home/kefu/dev/seastar/apps/httpd/main.cc:121:27
    #2 0x55e21cf6b4cc in int std::__invoke_impl<int, main::$_0::operator()() const::'lambda'()>(std::__invoke_other, main::$_0::operator()() const::'lambda'()&&) /usr/lib/gcc/x86_64-redhat-linux/14/../../../../incl
ude/c++/14/bits/invoke.h:61:14
    #3 0x55e21cf6b46c in std::__invoke_result<main::$_0::operator()() const::'lambda'()>::type std::__invoke<main::$_0::operator()() const::'lambda'()>(main::$_0::operator()() const::'lambda'()&&) /usr/lib/gcc/x86_
64-redhat-linux/14/../../../../include/c++/14/bits/invoke.h:96:14
    #4 0x55e21cf6b410 in decltype(auto) std::__apply_impl<main::$_0::operator()() const::'lambda'(), std::tuple<>>(main::$_0::operator()() const::'lambda'()&&, std::tuple<>&&, std::integer_sequence<unsigned long, .
..>) /usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/tuple:2921:14
    scylladb#5 0x55e21cf6b3b2 in decltype(auto) std::apply<main::$_0::operator()() const::'lambda'(), std::tuple<>>(main::$_0::operator()() const::'lambda'()&&, std::tuple<>&&) /usr/lib/gcc/x86_64-redhat-linux/14/../../../
../include/c++/14/tuple:2936:14
    scylladb#6 0x55e21cf6b283 in seastar::future<int> seastar::futurize<int>::apply<main::$_0::operator()() const::'lambda'()>(main::$_0::operator()() const::'lambda'()&&, std::tuple<>&&) /home/kefu/dev/seastar/include/sea
star/core/future.hh:2005:28
    scylladb#7 0x55e21cf6b043 in seastar::futurize<std::invoke_result<main::$_0::operator()() const::'lambda'()>::type>::type seastar::async<main::$_0::operator()() const::'lambda'()>(seastar::thread_attributes, main::$_0:
:operator()() const::'lambda'()&&)::'lambda'()::operator()() const /home/kefu/dev/seastar/include/seastar/core/thread.hh:260:13
    scylladb#8 0x55e21cf6ae74 in seastar::noncopyable_function<void ()>::direct_vtable_for<seastar::futurize<std::invoke_result<main::$_0::operator()() const::'lambda'()>::type>::type seastar::async<main::$_0::operator()()
 const::'lambda'()>(seastar::thread_attributes, main::$_0::operator()() const::'lambda'()&&)::'lambda'()>::call(seastar::noncopyable_function<void ()> const*) /home/kefu/dev/seastar/include/seastar/util/noncopyable
_function.hh:129:20
    scylladb#9 0x7f5d757a0fb3 in seastar::noncopyable_function<void ()>::operator()() const /home/kefu/dev/seastar/include/seastar/util/noncopyable_function.hh:215:16
    scylladb#10 0x7f5d75ef5611 in seastar::thread_context::main() /home/kefu/dev/seastar/src/core/thread.cc:311:9
    scylladb#11 0x7f5d75ef50eb in seastar::thread_context::s_main(int, int) /home/kefu/dev/seastar/src/core/thread.cc:287:43
    scylladb#12 0x7f5d72f8a18f  (/lib64/libc.so.6+0x5a18f) (BuildId: b098f1c75a76548bb230d8f551eae07a2aeccf06)
```

so, in this change, let's hold it using a smart pointer, so we
can destroy it when it leaves the lexical scope.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
tchaikov added a commit that referenced this pull request May 8, 2024
in main(), we creates an instance of `http_server_control` using
new, but we never destroy it. this is identified by ASan

```
==2190125==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 8 byte(s) in 1 object(s) allocated from:
    #0 0x55e21cf487bd in operator new(unsigned long) /home/kefu/dev/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:86:3
    #1 0x55e21cf6cf31 in main::$_0::operator()() const::'lambda'()::operator()() const /home/kefu/dev/seastar/apps/httpd/main.cc:121:27
    #2 0x55e21cf6b4cc in int std::__invoke_impl<int, main::$_0::operator()() const::'lambda'()>(std::__invoke_other, main::$_0::operator()() const::'lambda'()&&) /usr/lib/gcc/x86_64-redhat-linux/14/../../../../incl
ude/c++/14/bits/invoke.h:61:14
    #3 0x55e21cf6b46c in std::__invoke_result<main::$_0::operator()() const::'lambda'()>::type std::__invoke<main::$_0::operator()() const::'lambda'()>(main::$_0::operator()() const::'lambda'()&&) /usr/lib/gcc/x86_
64-redhat-linux/14/../../../../include/c++/14/bits/invoke.h:96:14
    #4 0x55e21cf6b410 in decltype(auto) std::__apply_impl<main::$_0::operator()() const::'lambda'(), std::tuple<>>(main::$_0::operator()() const::'lambda'()&&, std::tuple<>&&, std::integer_sequence<unsigned long, .
..>) /usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/tuple:2921:14
    scylladb#5 0x55e21cf6b3b2 in decltype(auto) std::apply<main::$_0::operator()() const::'lambda'(), std::tuple<>>(main::$_0::operator()() const::'lambda'()&&, std::tuple<>&&) /usr/lib/gcc/x86_64-redhat-linux/14/../../../
../include/c++/14/tuple:2936:14
    scylladb#6 0x55e21cf6b283 in seastar::future<int> seastar::futurize<int>::apply<main::$_0::operator()() const::'lambda'()>(main::$_0::operator()() const::'lambda'()&&, std::tuple<>&&) /home/kefu/dev/seastar/include/sea
star/core/future.hh:2005:28
    scylladb#7 0x55e21cf6b043 in seastar::futurize<std::invoke_result<main::$_0::operator()() const::'lambda'()>::type>::type seastar::async<main::$_0::operator()() const::'lambda'()>(seastar::thread_attributes, main::$_0:
:operator()() const::'lambda'()&&)::'lambda'()::operator()() const /home/kefu/dev/seastar/include/seastar/core/thread.hh:260:13
    scylladb#8 0x55e21cf6ae74 in seastar::noncopyable_function<void ()>::direct_vtable_for<seastar::futurize<std::invoke_result<main::$_0::operator()() const::'lambda'()>::type>::type seastar::async<main::$_0::operator()()
 const::'lambda'()>(seastar::thread_attributes, main::$_0::operator()() const::'lambda'()&&)::'lambda'()>::call(seastar::noncopyable_function<void ()> const*) /home/kefu/dev/seastar/include/seastar/util/noncopyable
_function.hh:129:20
    scylladb#9 0x7f5d757a0fb3 in seastar::noncopyable_function<void ()>::operator()() const /home/kefu/dev/seastar/include/seastar/util/noncopyable_function.hh:215:16
    scylladb#10 0x7f5d75ef5611 in seastar::thread_context::main() /home/kefu/dev/seastar/src/core/thread.cc:311:9
    scylladb#11 0x7f5d75ef50eb in seastar::thread_context::s_main(int, int) /home/kefu/dev/seastar/src/core/thread.cc:287:43
    scylladb#12 0x7f5d72f8a18f  (/lib64/libc.so.6+0x5a18f) (BuildId: b098f1c75a76548bb230d8f551eae07a2aeccf06)
```

so, in this change, let's hold it using a smart pointer, so we
can destroy it when it leaves the lexical scope.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>

Closes scylladb#2224
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.

1 participant