-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Description
Confirm by changing [ ] to [x] below to ensure that it's a bug:
- I've gone through Developer Guide and API reference
- I've searched for previous similar issues and didn't find any solution
Describe the bug
Application uses fork() to spawn child processes to execute jobs. And when the child process exits after the job completion, it is triggering AWS SDK resource cleanup which intermittently causes SIGSEGV faults.
Below are the two SIGSEGV faults seen so far:
- Logging sub-system
Thread 5.1 "ebs_direct_poc" received signal SIGSEGV, Segmentation fault.
0x00007ffff74ac4c0 in __pthread_timedjoin_ex () from /lib64/libpthread.so.0
(gdb) bt
#0 0x00007ffff74ac4c0 in __pthread_timedjoin_ex () from /lib64/libpthread.so.0
#1 0x00007ffff71d0e27 in std::thread::join() () from /lib64/libstdc++.so.6
#2 0x00007ffff779c4c7 in Aws::Utils::Logging::DefaultLogSystem::~DefaultLogSystem() () from /usr/local/lib64/libaws-cpp-sdk-core.so
#3 0x00007ffff77d42df in std::shared_ptr<Aws::Utils::Logging::LogSystemInterface>::~shared_ptr() () from /usr/local/lib64/libaws-cpp-sdk-core.so
#4 0x00007ffff67e9037 in __cxa_finalize () from /lib64/libc.so.6
#5 0x00007ffff776a307 in __do_global_dtors_aux () from /usr/local/lib64/libaws-cpp-sdk-core.so
#6 0x00007fffffffdaf0 in ?? ()
#7 0x00007ffff7ddfc96 in _dl_fini () from /lib64/ld-linux-x86-64.so.2
Backtrace stopped: frame did not save the PC
- CRT Event group shutdown
Thread 6.87 "ebs_direct_poc" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffc9ffb700 (LWP 28581)]
0x00007ffff74ac4c0 in __pthread_timedjoin_ex () from /lib64/libpthread.so.0
(gdb) bt
#0 0x00007ffff74ac4c0 in __pthread_timedjoin_ex () from /lib64/libpthread.so.0
#1 0x00007ffff78abc97 in aws_thread_join () from /usr/local/lib64/libaws-cpp-sdk-core.so
#2 0x00007ffff781b077 in s_destroy () from /usr/local/lib64/libaws-cpp-sdk-core.so
#3 0x00007ffff78168bc in s_aws_event_loop_group_shutdown_sync () from /usr/local/lib64/libaws-cpp-sdk-core.so
#4 0x00007ffff78169a1 in s_event_loop_destroy_async_thread_fn () from /usr/local/lib64/libaws-cpp-sdk-core.so
#5 0x00007ffff78abe47 in thread_fn () from /usr/local/lib64/libaws-cpp-sdk-core.so
#6 0x00007ffff74ab14a in start_thread () from /lib64/libpthread.so.0
#7 0x00007ffff68abdc3 in clone () from /lib64/libc.so.6
SDK version number
v1.9.88
Platform/OS/Hardware/Device
Cent OS 7
To Reproduce (observed behavior)
Snippets from the application which uses EBS client to read blocks from snapshots.
main.cpp:
Aws::SDKOptions options;
Aws::InitAPI(options);
{
Snapshot *snapshot = new Snapshot(args.snapshot, args.outputFile);
ProcessExecutor executor = ProcessExecutor(snapshot);
executor.run();
}
Aws::ShutdownAPI(options);
ProcessExecutor.cpp:
ProcessExecutor::run()
{
childPID = fork());
if(childPID > 0)
{
// wait logic
}
else {
getOperation()->execute();
exit(0); //child exits here
}
}
Snapshot.cpp
Snapshot::execute()
{
// Read blocks from EBS snapshots using Aws::EBS::EBSClient
// this method completes cleanly
}
Expected behavior
Exit of child processes should not result in SIGSEGV faults.