Comments (4)
You're right -- looks like I was chasing a red herring.
I can modify the expected output to expect either a 0 or 1 for that line.
from dynamorio.
Oh I think it's the SF:/opt/actions-runner/_work/dynamorio/dynamorio/suite/tests/linux/eintr.c
line written by
from dynamorio.
The difference is this line:
output:
2024-04-04T21:14:23.5132299Z 206: DA:126,0
expected:
2024-04-04T21:14:25.4889115Z 206: DA:126,1
which corresponds to this code:
124: pthread_mutex_lock(&lock);
125: while (!child_ready)
126: pthread_cond_wait(&condvar, &lock); // <-- Is this line not executed for some reason?
127: child_ready = false;
128: pthread_mutex_unlock(&lock);
from dynamorio.
Is this just a racy test? If the handler()
has been called before the main thread gets to the while
loop child_ready
will already be set to true
and the loop body won't be executed.
/*
* test of restarted syscalls
*/
#include "tools.h"
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <signal.h>
#include <stdlib.h>
#include <pthread.h>
static pthread_cond_t condvar;
static bool child_ready;
static pthread_mutex_t lock;
static void
handler(int sig)
{
print("in handler %d\n", sig);
/* potentially unsafe but we risk it: we should be in our read syscall */
pthread_mutex_lock(&lock);
child_ready = true;
pthread_cond_signal(&condvar);
pthread_mutex_unlock(&lock);
}
/* snip */
int
main(int argc, char **argv)
{
/* snip */
/* test signal w/ handler */
print("sending SIGUSR1\n");
pthread_kill(thread, SIGUSR1);
/* <-- handler() is executed here, setting child_ready = true */
pthread_mutex_lock(&lock);
while (!child_ready) /* child_ready == true so the loop gets skipped */
pthread_cond_wait(&condvar, &lock);
child_ready = false;
pthread_mutex_unlock(&lock);
/* snip */
return 0;
}
from dynamorio.
Related Issues (20)
- AArch64 linux.thread-reset fails on non-SVE hardware HOT 1
- Handle different iret behavior in user vs kernel space
- X86_32 Invariant checker test failure in check_kernel_syscall_trace: Too many read/write records
- drmemtrace -trace_after_instrs introduces gap between first and second timestamps HOT 1
- generalize reg_{to,is}_pointer_sized() to non-GPR registers
- Pretty printer for #trace_entry_t-format traces HOT 3
- tool.record_filter_bycore_multi failured due to inaccurate pi estimation HOT 3
- linux.signalNNN1 test failing due to non-determinism in floating point operations
- AArch64: add client.cleancall to AArch64's pre-commit tests.
- AArch64: Fix P register save/restore on 128-bit vector length systems HOT 1
- drrun fails on windows without YMM support HOT 4
- `client.detach_test` is intermittently timing out on the `vs2019-32` CI build
- xsave* also loads data
- drcachesim.TLB-threads fails in aarch64-precommit HOT 3
- AArch64 SVE: Add 128 bit vector length tests to CI
- CRASH drcachesim with fewer simulated cores than present in a core-sharded-on-disk trace
- Unable to see read/write addresses in dynamorio kernel traces that got generated with libipt HOT 1
- [CRASH] when using drsym_lookup_address [Windows 19045]
- ubuntu22 GA workflows failing apt-get update HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dynamorio.