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

unit test failed #4

Open
yzhh029 opened this issue Oct 3, 2020 · 1 comment
Open

unit test failed #4

yzhh029 opened this issue Oct 3, 2020 · 1 comment

Comments

@yzhh029
Copy link

yzhh029 commented Oct 3, 2020

g++ 10.2
OS: ubuntu 20.04, kernel 5.8.10

[doctest] doctest version is "2.4.0"
[doctest] run with "--help" for options

/home/yzhh/xynet/test/coroutine_test.cpp:63:
TEST CASE: lots of synchronous completions doesn't result in stack-overflow

/home/yzhh/xynet/test/coroutine_test.cpp:63: FATAL ERROR: test case CRASHED: SIGSEGV - Segmentation violation signal

===============================================================================
[doctest] test cases: 3 | 2 passed | 1 failed | 13 skipped
[doctest] assertions: 3 | 3 passed | 0 failed |
[doctest] Status: FAILURE!
Segmentation fault (core dumped)

Starting program: xynet/build/test/xynet_tests
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[doctest] doctest version is "2.4.0"
[doctest] run with "--help" for options

Program received signal SIGSEGV, Segmentation fault.
0x00005555555874bc in xynet::detail::task_promise::~task_promise (this=<error reading variable: Cannot access memory at address 0x7fffff7feff8>,
__in_chrg=) at /home/yzhh/xynet/include/xynet/coroutine/task.h:145
145 ~task_promise()
(gdb) bt
#0 0x00005555555874bc in xynet::detail::task_promise::~task_promise (this=<error reading variable: Cannot access memory at address 0x7fffff7feff8>,
__in_chrg=) at /home/yzhh/xynet/include/xynet/coroutine/task.h:145
#1 0x000055555558586b in _DOCTEST_ANON_FUNC_6()::{lambda()#1}::operator() (frame_ptr=0x5555556001a0) at /home/yzhh/xynet/test/coroutine_test.cpp:68
#2 0x00005555555858d3 in _DOCTEST_ANON_FUNC_6()::{lambda()#1}::operator() (frame_ptr=0x5555556001a0) at /home/yzhh/xynet/test/coroutine_test.cpp:65
#3 0x0000555555586414 in std::__n4861::coroutine_handle::destroy (this=0x555555600a10) at /usr/include/c++/10/coroutine:128
#4 0x0000555555587464 in xynet::task::~task (this=0x555555600a10, __in_chrg=) at /home/yzhh/xynet/include/xynet/coroutine/task.h:385
#5 0x0000555555585b99 in _DOCTEST_ANON_FUNC_6()::{lambda()#2}::operator() (frame_ptr=0x5555556009c0) at /home/yzhh/xynet/test/coroutine_test.cpp:77
#6 0x0000555555585847 in _DOCTEST_ANON_FUNC_6()::{lambda()#1}::operator() (frame_ptr=0x5555556001a0) at /home/yzhh/xynet/test/coroutine_test.cpp:65
#7 0x0000555555585c84 in _DOCTEST_ANON_FUNC_6()::{lambda()#2}::operator() (frame_ptr=0x5555556009c0) at /home/yzhh/xynet/test/coroutine_test.cpp:70
#8 0x0000555555585847 in _DOCTEST_ANON_FUNC_6()::{lambda()#1}::operator() (frame_ptr=0x5555556001a0) at /home/yzhh/xynet/test/coroutine_test.cpp:65
....
seems more than thousands of these two lines in the stack:
#1077 0x0000555555585c84 in _DOCTEST_ANON_FUNC_6()::{lambda()#2}::operator() (frame_ptr=0x5555556009c0) at /home/yzhh/xynet/test/coroutine_test.cpp:70
#1078 0x0000555555585847 in _DOCTEST_ANON_FUNC_6()::{lambda()#1}::operator() (frame_ptr=0x5555556001a0) at /home/yzhh/xynet/test/coroutine_test.cpp:65

Thanks

@yzhh029
Copy link
Author

yzhh029 commented Oct 3, 2020

Seems the max supported number is 65000, test will fail for 66000.

    for (int i = 0; i < 65'000; ++i)
    {
      sum = sum + co_await completesSynchronously();
    }

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

No branches or pull requests

1 participant