Skip to content

Commit

Permalink
Maybe found the bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbert Van Renesse committed Mar 20, 2024
1 parent bc1a663 commit e57cb30
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions harmony_model_checker/charm/charm.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ static void process_step(
f->type = so->failed ? FAIL_SAFETY : FAIL_TERMINATION;
f->node = node;
f->edge = walloc_fast(w, sizeof(struct edge));
#ifdef SHORT_POINTER
#ifdef SHORT_PTR
f->edge->dest = (int64_t *) node - (int64_t *) f->edge;
printf("SET DST 1: %p\n", node);
#else
Expand Down Expand Up @@ -556,7 +556,7 @@ static void process_step(
struct dict_assoc *hn = dict_find_new(w->visited, &w->allocator,
sc, size, noutgoing * sizeof(struct edge), &new, &lock);
struct node *next = (struct node *) &hn[1];
#ifdef SHORT_POINTER
#ifdef SHORT_PTR
edge->dest = (int64_t *) next - (int64_t *) edge;
printf("SET DST 2: next=%p edge=%p diff=%ld(%ld,%ld) %p\n", next, edge, (int64_t) edge->dest,
(int64_t *) next - (int64_t *) edge,
Expand Down Expand Up @@ -2904,7 +2904,7 @@ static void worker(void *arg){
struct node *root = global.graph.nodes[0];
struct edge *re = node_edges(root);
struct node *rd = edge_dst(re);
#ifdef SHORT_POINTER
#ifdef SHORT_PTR
printf("N0: %d %d %p (%ld)\n", (int) root->id, root->nedges, rd, (int64_t) re->dest);
printf("N0...: %d %d %p (%d)\n", (int) root->id, root->nedges, rd, (int) rd->id);
#endif
Expand Down
4 changes: 2 additions & 2 deletions harmony_model_checker/charm/graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ unsigned int graph_add_multiple(struct graph *graph, unsigned int n) {
return node_id;
}

#ifndef notdef
#ifdef SHORT_PTR
void dump_edges(struct node *src){
struct edge *e = node_edges(src);
for (unsigned int i = 0; i < src->nedges; i++, e++) {
printf("--> dst=%p(%ld) stc=%u m=%u f=%u\n",
edge_dst(e), (int64_t) e->dest, e->stc_id, e->multiple, e->failed);
}
}
#endif // notdef
#endif

struct edge *find_edge(struct node *src, struct node *dst){
struct edge *e = node_edges(src);
Expand Down
3 changes: 2 additions & 1 deletion harmony_model_checker/charm/graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ struct step_comp {
// information of how a program can get from the source state to the destination
// state.
struct edge {
#ifdef SHORT_POINTER
#ifdef SHORT_PTR
XYXZZ
int64_t dest : 37; // "short" pointer to dst node
uint32_t stc_id : 25; // id of step_condition
#define edge_dst(e) ((struct node *) ((int64_t *) (e) + (e)->dest))
Expand Down
2 changes: 1 addition & 1 deletion harmony_model_checker/charm/head.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// #define DEBUGGING

// #define SHORT_POINTER
// #define SHORT_PTR

#ifdef DEBUGGING
# undef NDEBUG
Expand Down

0 comments on commit e57cb30

Please sign in to comment.