gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] branch master updated: -more fixmes


From: gnunet
Subject: [gnunet] branch master updated: -more fixmes
Date: Thu, 08 Dec 2022 11:22:00 +0100

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new f26345b68 -more fixmes
f26345b68 is described below

commit f26345b68768695391d9a8ae983a27c03b8ce874
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Thu Dec 8 19:21:52 2022 +0900

    -more fixmes
---
 src/include/gnunet_testing_ng_lib.h           | 21 +++++++++++----------
 src/testing/testing_api_cmd_barrier_reached.c |  6 +++++-
 src/testing/testing_api_loop.c                |  3 +++
 3 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/src/include/gnunet_testing_ng_lib.h 
b/src/include/gnunet_testing_ng_lib.h
index 88910f65f..1e2f4b30d 100644
--- a/src/include/gnunet_testing_ng_lib.h
+++ b/src/include/gnunet_testing_ng_lib.h
@@ -99,6 +99,17 @@ struct GNUNET_TESTING_AsyncContext
  */
 struct GNUNET_TESTING_Command
 {
+  // FIXME: This should not be here. Looking at the code commands are used
+  // in arrays. Not lists.
+  /**
+   * Pointer to the previous command in the DLL.
+   */
+  struct GNUNET_TESTING_Command *prev;
+
+  /**
+   * Pointer to the next command in the DLL.
+   */
+  struct GNUNET_TESTING_Command *next;
 
   /**
    * Closure for all commands with command-specific context information.
@@ -194,16 +205,6 @@ struct GNUNET_TESTING_Command
    */
   struct GNUNET_TIME_Relative default_timeout;
 
-  /**
-   * Pointer to the previous command in the DLL.
-   */
-  struct GNUNET_TESTING_Command *prev;
-
-  /**
-   * Pointer to the next command in the DLL.
-   */
-  struct GNUNET_TESTING_Command *next;
-
   /**
    * How often did we try to execute this command? (In case it is a request
    * that is repated.)  Note that a command must have some built-in retry
diff --git a/src/testing/testing_api_cmd_barrier_reached.c 
b/src/testing/testing_api_cmd_barrier_reached.c
index 43bf86398..c5b0b692e 100644
--- a/src/testing/testing_api_cmd_barrier_reached.c
+++ b/src/testing/testing_api_cmd_barrier_reached.c
@@ -50,7 +50,7 @@ struct BarrierReachedState
   const char *label;
 
   /**
-   * The name of the barrier this commands wait (if finishing asynchronous) 
for or/and reaches. 
+   * The name of the barrier this commands wait (if finishing asynchronous) 
for or/and reaches.
    */
   const char *barrier_name;
 
@@ -103,6 +103,10 @@ barrier_reached_run (void *cls,
   }
   else if (GNUNET_NO == brs->asynchronous_finish)
   {
+    /** FIXME: This is already fishy as commands in is are an array
+     * It is unclear how this does not end up with a DLL issue.
+     * We should create a dedicated struct to hold this list.
+     */
     cmd = GNUNET_TESTING_interpreter_get_current_command (is);
     GNUNET_CONTAINER_DLL_insert (barrier->cmds_head,
                                  barrier->cmds_tail,
diff --git a/src/testing/testing_api_loop.c b/src/testing/testing_api_loop.c
index 01af7da2a..f19654029 100644
--- a/src/testing/testing_api_loop.c
+++ b/src/testing/testing_api_loop.c
@@ -686,6 +686,9 @@ GNUNET_TESTING_finish_attached_cmds (struct 
GNUNET_TESTING_Interpreter *is,
     GNUNET_CONTAINER_DLL_remove (barrier->cmds_head,
                                  barrier->cmds_tail,
                                  pos);
+    // FIXME: DANGER DANGER! "pos" is a pointer to the array(!) element in an
+    // IS. This WILL crash and burn
+    GNUNET_break (0);
     GNUNET_free (pos);
   }
   free_barrier_node_cb_cls = GNUNET_new (struct FreeBarrierNodeCbCls);

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]