Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 1197970 Details for
Bug 1373239
dyninst: Process::attachProcess segfaults
Home
New
Search
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh90 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
[?]
This site requires JavaScript to be enabled to function correctly, please enable it.
dyninst-reattach-loop.cpp
dyninst-reattach-loop.cpp (text/plain), 1.45 KB, created by
Florian Weimer
on 2016-09-05 15:01:39 UTC
(
hide
)
Description:
dyninst-reattach-loop.cpp
Filename:
MIME Type:
Creator:
Florian Weimer
Created:
2016-09-05 15:01:39 UTC
Size:
1.45 KB
patch
obsolete
>#include <dyninst/PCProcess.h> >#include <dyninst/Symtab.h> >#include <dyninst/Variable.h> > >#include <err.h> >#include <gnu/lib-names.h> >#include <pthread.h> >#include <signal.h> >#include <stdio.h> >#include <stdlib.h> > >#include <atomic> >#include <thread> > >int >main(int argc, char **argv) >{ > if (argc != 2) { > fprintf(stderr, "usage: %s PID\n", argv[0]); > return 1; > } > > int pid = atoi(argv[1]); > if (pid <= 0) { > fprintf(stderr, "error: invalid PID: %s\n", argv[1]); > return 2; > } > > Dyninst::ProcControlAPI::Process::ptr proc > {Dyninst::ProcControlAPI::Process::attachProcess(pid)}; > > std::atomic<size_t> loops{}; > std::atomic<bool> running{true}; > std::thread watchdog([&loops, &running]() { > sigset_t blocked; > sigfillset(&blocked); > pthread_sigmask(SIG_BLOCK, &blocked, nullptr); > while (true) { > if (!running) { > fprintf(stderr, > "error: process appears to be stuck (%zu iterations)\n", > loops.load()); > pause(); > } > usleep (1000 * 1000); > running = false; > } > }); > > while (true) { > running = true; > if (!proc->temporaryDetach()) { > fprintf (stderr, "error: temporaryDetach failed (%zu iteratiosn)\n", > loops.load()); > _exit(2); > } > sched_yield(); > if (!proc->reAttach()) { > fprintf (stderr, "error: reAttach failed (%zu iterations)\n", > loops.load()); > _exit(2); > } > ++loops; > } >} >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1373239
: 1197970