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

Using kill causes the program to crash #2402

Open
NeilZhy opened this issue Jan 6, 2025 · 5 comments
Open

Using kill causes the program to crash #2402

NeilZhy opened this issue Jan 6, 2025 · 5 comments
Labels
needs info A bug report is waiting for more information

Comments

@NeilZhy
Copy link

NeilZhy commented Jan 6, 2025

Required information

Operating system:
E.g. Ubuntu 18.04 LTS

Compiler version:
E.g. GCC 7.4.0

Eclipse iceoryx version:
v2.0.3

Observed result or behaviour:
I use the script to kill my process for stress test

for i in {0..10000}
do
    pid=$(printf "%d" $(ps | grep test-demo | cut -c 1-6))
    for j in {0..5}
    do
        kill -15 $pid
    done
    sleep 10
done

my process will get the error and crash

_ZSt9terminatev(/lib/libstdc++.so 0x14186000)
_ZN3iox12ErrorHandler17reactOnErrorLevelENS_10ErrorLevelEPKc(/usr/lib/libiceoryx_hoofs.so 0x140a0000)
_ZN3iox12ErrorHandler14defaultHandlerENS_5ErrorERKNSt3__18functionIFvvEEENS_10ErrorLevelE(/usr/lib/libiceoryx_hoofs.so 0x140a0000)
_ZN3iox12errorHandlerENS_5ErrorERKNSt3__18functionIFvvEEENS_10ErrorLevelE(/usr/lib/libiceoryx_hoofs.so 0x140a0000)
_ZN3iox3cxx8internal7RequireEbPKciS3_S3_(/usr/lib/libiceoryx_hoofs.so 0x140a0000)
_ZN3iox10concurrent12PeriodicTaskINS_3cxx14MethodCallbackIvJEEEE3runEv(/usr/lib/libiceoryx_posh.so 0x13fb1000)

Expected result or behaviour:
no crash

@mossmaurice
Copy link
Contributor

@NeilZhy Thanks for raising this issue.

If you demangle the symbols it becomes more readable:

std::terminate()(/lib/libstdc  .so 0x14186000)
iox::ErrorHandler::reactOnErrorLevel(iox::ErrorLevel, char const*)(/usr/lib/libiceoryx_hoofs.so 0x140a0000)
iox::ErrorHandler::defaultHandler(iox::Error, std::__1::function<void ()> const&, iox::ErrorLevel)(/usr/lib/libiceoryx_hoofs.so 0x140a0000)
iox::errorHandler(iox::Error, std::__1::function<void ()> const&, iox::ErrorLevel)(/usr/lib/libiceoryx_hoofs.so 0x140a0000)
iox::cxx::internal::Require(bool, char const*, int, char const*, char const*)(/usr/lib/libiceoryx_hoofs.so 0x140a0000)
iox::concurrent::PeriodicTask<iox::cxx::MethodCallback<void> >::run()(/usr/lib/libiceoryx_posh.so 0x13fb1000)

Could you try to find out which condition no longer holds in PeriodicTask? In general, I think it's not a good idea to kill applications forcefully from the outside but instead exit gracefully to prevent such issues. I assume some OS resource is already gone.

@NeilZhy
Copy link
Author

NeilZhy commented Jan 6, 2025

@mossmaurice thanks for your reply.
sorry I can not find out which condition no longer holds in PeriodicTask, I check my log and do not find the problem.
the kill script is from our testet for stress test.

@elBoberido
Copy link
Member

@NeilZhy do you gracefully shut down your applications, i.e. register a signal handler?

Can you check whether the problem persists with latest main or at least with the v2.95.3 tag?

@elBoberido elBoberido added the needs info A bug report is waiting for more information label Jan 6, 2025
@NeilZhy
Copy link
Author

NeilZhy commented Jan 7, 2025

@elBoberido thanks,i will check our program for graceful shut down, and i will test the least version。

@elBoberido
Copy link
Member

@NeilZhy did you have the chance to check for the graceful shut down and/or the v2.95.3 tag?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs info A bug report is waiting for more information
Projects
None yet
Development

No branches or pull requests

3 participants