[GE issues] [Issue 3112] New - memset: wrong order of arguments

h_koenig koenig at science-computing.de
Fri Aug 21 16:59:22 BST 2009


http://gridengine.sunsource.net/issues/show_bug.cgi?id=3112
                 Issue #|3112
                 Summary|memset: wrong order of arguments
               Component|gridengine
                 Version|6.2u3
                Platform|All
                     URL|
              OS/Version|All
                  Status|NEW
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|PATCH
                Priority|P3
            Subcomponent|build
             Assigned to|andreas
             Reported by|h_koenig






------- Additional comments from h_koenig at sunsource.net Fri Aug 21 08:59:18 -0700 2009 -------
trying to build 6.2u3 on SUSE 9.0 64bit with gcc-4.3.2 I got the following error msg:

../daemons/common/admin_mail.c: In function 'job_related_adminmail':
../daemons/common/admin_mail.c:137: error: statement with no effect
../daemons/common/admin_mail.c: In function 'adm_mail_reset':
../daemons/common/admin_mail.c:336: error: statement with no effect

pointing to calls of memset with wrong sequence of arguments. 
grepping for that argument pattern showed two more such errors.

here is a patch which makes 6.2u3 compile for me[tm] :



--- 8< ------ 8< ------ 8< ------ 8< ------ 8< ------ 8< ------ 8< ---
Index: source/clients/qmon/qmon_qaction.c
===================================================================
RCS file: /cvs/gridengine/source/clients/qmon/qmon_qaction.c,v
retrieving revision 1.52
diff -u -r1.52 qmon_qaction.c
--- source/clients/qmon/qmon_qaction.c	11 Feb 2009 10:35:52 -0000	1.52
+++ source/clients/qmon/qmon_qaction.c	21 Aug 2009 15:52:24 -0000
@@ -1615,7 +1615,7 @@
 ) {
    DENTER(GUI_LAYER, "qmonInitQCEntry");
 
-   memset((void*)data, sizeof(tQCEntry), 0);
+   memset((void*)data, 0, sizeof(tQCEntry));
 
    DEXIT;
 
Index: source/clients/qmon/qmon_cluster.c
===================================================================
RCS file: /cvs/gridengine/source/clients/qmon/qmon_cluster.c,v
retrieving revision 1.52
diff -u -r1.52 qmon_cluster.c
--- source/clients/qmon/qmon_cluster.c	11 Feb 2009 10:35:50 -0000	1.52
+++ source/clients/qmon/qmon_cluster.c	21 Aug 2009 15:52:27 -0000
@@ -2336,7 +2336,7 @@
 ) {
    DENTER(GUI_LAYER, "qmonInitCClEntry");
 
-   memset((void*)clen, sizeof(tCClEntry), 0);
+   memset((void*)clen, 0, sizeof(tCClEntry));
 
    DEXIT; 
 }
Index: source/daemons/common/admin_mail.c
===================================================================
RCS file: /cvs/gridengine/source/daemons/common/admin_mail.c,v
retrieving revision 1.21
diff -u -r1.21 admin_mail.c
--- source/daemons/common/admin_mail.c	8 Oct 2007 14:15:53 -0000	1.21
+++ source/daemons/common/admin_mail.c	21 Aug 2009 15:52:30 -0000
@@ -134,7 +134,7 @@
 
    DPRINTF(("sizeof(admail_times) : %d\n", sizeof(admail_times)));
    if (first) {
-      memset(admail_times, sizeof(admail_times), 0);
+      memset(admail_times, 0, sizeof(admail_times));
       first = 0;
    }
 
@@ -333,7 +333,7 @@
    ** let 0 be a reset all
    */
    if (!state) {
-      memset(admail_times, sizeof(admail_times), 0);
+      memset(admail_times, 0, sizeof(admail_times));
       return 0;
    }
 
--- 8< ------ 8< ------ 8< ------ 8< ------ 8< ------ 8< ------ 8< ---

------------------------------------------------------
http://gridengine.sunsource.net/ds/viewMessage.do?dsForumId=36&dsMessageId=213499

To unsubscribe from this discussion, e-mail: [issues-unsubscribe at gridengine.sunsource.net].



More information about the gridengine-users mailing list