Skip to content

Commit

Permalink
debug musl build failures.
Browse files Browse the repository at this point in the history
  • Loading branch information
insertinterestingnamehere committed Oct 18, 2024
1 parent 925ba14 commit 47dc9d6
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 10 deletions.
15 changes: 12 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,24 @@ jobs:
steps:
- checkout
- run: |
apk add --no-cache --no-progress bash make musl-dev hwloc-dev libtool autoconf automake gcc g++
apk add --no-cache --no-progress bash make musl-dev hwloc-dev libtool autoconf automake gcc g++ gdb
- run: |
bash autogen.sh
bash configure --enable-picky --with-scheduler=<< parameters.scheduler >> -with-topology=<< parameters.topology >>
make -j2
make tests -j2
QT_NUM_SHEPHERDS=2 QT_NUM_WORKERS_PER_SHEPHERD=1 gdb -batch -ex "set disable-randomization off" -ex "run" -ex "bt" --args bash test/basics/qthread_timer_wait || true
QT_NUM_SHEPHERDS=2 QT_NUM_WORKERS_PER_SHEPHERD=1 bash test/basics/aligned_writeFF_basic > test/basics/aligned_writeFF_basic.log 2>&1 &
P1=$!
sleep 10
cat test/basics/aligned_writeFF_basic.log
kill $P1 || true
cat proc/cpuinfo
- run:
command: make check
no_output_timeout: 180s
command: |
QT_NUM_SHEPHERDS=2 QT_NUM_WORKERS_PER_SHEPHERD=1 bash test/stress/task_spawn
make check; cat test/basics/qthread_timer_wait.log
no_output_timeout: 1200s

workflows:
build_and_test:
Expand Down
7 changes: 6 additions & 1 deletion test/basics/aligned_writeFF_basic.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,22 @@ static void testConcurrentWriteFF(void) {
concurrent_t = 0;
qthread_fill(&concurrent_t);

printf("starting concurrent writeFF test\n");
fflush(stdout);
for (int i = 0; i < num_writers; i++) {
qthread_fork(alignedWriteFF_iters, (void *)ALL_ZEROS, &rets[i]);
qthread_fork(
alignedWriteFF_iters, (void *)ALL_ONES, &rets[i + num_writers]);
}

printf("calling readFF\n");
fflush(stdout);
for (int i = 0; i < num_writers * 2; i++) {
qthread_readFF(&rets[i], &rets[i]);
}

iprintf("concurrent_t=%x\n", concurrent_t);
printf("concurrent_t=%x\n", concurrent_t);
fflush(stdout);
test_check((concurrent_t == ALL_ZEROS) || (concurrent_t == ALL_ONES));
test_check(qthread_feb_status(&concurrent_t) == 1);
}
Expand Down
2 changes: 1 addition & 1 deletion test/stress/lock_acq_rel.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static void task_2(size_t start, size_t stop, void *args_) {
}

int main(int argc, char *argv[]) {
uint64_t iters = 10000l;
uint64_t iters = 1000l;
test_check(qthread_initialize() == 0);

/* Simple lock acquire and release */
Expand Down
2 changes: 1 addition & 1 deletion test/stress/precond_fib.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ inline static aligned_t fib(aligned_t value) {
}

int main(int argc, char *argv[]) {
aligned_t n = 20;
aligned_t n = 16;
aligned_t r = 0;

test_check(qthread_initialize() == 0);
Expand Down
13 changes: 9 additions & 4 deletions test/stress/task_spawn.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ static aligned_t null_task(void *args_) { return qthread_incr(&donecount, 1); }
static void par_null_task(size_t start, size_t stop, void *args_) {}

int main(int argc, char *argv[]) {
uint64_t count = 524288; // 1048576;
uint64_t count = 32768; //524288; // 1048576;

CHECK_VERBOSE();

Expand All @@ -23,19 +23,24 @@ int main(int argc, char *argv[]) {

test_check(qthread_initialize() == 0);

printf("initialized\n");
fflush(stdout);
for (uint64_t i = 0; i < count; i++) { qthread_fork(null_task, NULL, NULL); }
do {
aligned_t tmp = donecount;
qthread_yield();
if (tmp != donecount) {
iprintf(
printf(
"donecount = %u, tmp = %u\n", (unsigned int)donecount, (unsigned)tmp);
fflush(stdout);
}
} while (donecount != count);
iprintf("manually spawned and sync'd %u threads\n", (unsigned)count);
printf("manually spawned and sync'd %u threads\n", (unsigned)count);
fflush(stdout);

qt_loop(0, count, par_null_task, NULL);
iprintf("automatically spawned and sync'd %u threads\n", (unsigned)count);
printf("automatically spawned and sync'd %u threads\n", (unsigned)count);
fflush(stdout);

return 0;
}
Expand Down

0 comments on commit 47dc9d6

Please sign in to comment.