[torquedev] mistake in torque-4.1.1/src/server/node_manager.c

Go Yoshimura go-yoshimura at sstc.co.jp
Fri Aug 31 06:03:29 MDT 2012


Hello,

I found mistake in torque-4.1.1/src/server/node_manager.c.

[test01 at torque03 server]$ gcc -DHAVE_CONFIG_H -I. -I../../src/include  -I../../src/include  -DPBS_SERVER_HOME=\"/var/torque\" -DPBS_ENVIRON=\"/var/torque/pbs_environment\" `xml2-config --cflags` -g -
O2 -W -Wall -Wno-unused-parameter -Wno-long-long -pedantic -Werror -MT node_manager.o -MD -MP -MF .deps/node_manager.Tpo -c -o node_manager.o node_manager.c
cc1: warnings being treated as errors
node_manager.c: In function ‘is_reserved_property’:
node_manager.c:3814: warning: comparison of unsigned expression < 0 is always false
[test01 at torque03 server]$ cp -p node_manager.c node_manager.c.orig
[test01 at torque03 server]$ vi node_manager.c
[test01 at torque03 server]$ diff -u node_manager.c node_manager.c.orig 
--- node_manager.c	2012-08-31 20:42:57.000000000 +0900
+++ node_manager.c.orig	2012-08-25 05:42:59.000000000 +0900
@@ -3811,7 +3811,7 @@
 
   {
   if ((strncmp(prop, "ppn", strlen("ppn")) == 0) ||
-      (strncmp(prop, "gpus", strlen("gpus")) == 0) ||
+      (strncmp(prop, "gpus", strlen("gpus") == 0)) ||
       (strncasecmp(prop, "exclusive_thread", strlen("exclusive_thread")) == 0) ||
       (strncasecmp(prop, "exclusive", strlen("exclusive")) == 0) ||
       (strncasecmp(prop, "exclusive_process", strlen("exclusive_process")) == 0) ||
[test01 at torque03 server]$ gcc -DHAVE_CONFIG_H -I. -I../../src/include  -I../../src/include  -DPBS_SERVER_HOME=\"/var/torque\" -DPBS_ENVIRON=\"/var/torque/pbs_environment\" `xml2-config --cflags` -g -
O2 -W -Wall -Wno-unused-parameter -Wno-long-long -pedantic -Werror -MT node_manager.o -MD -MP -MF .deps/node_manager.Tpo -c -o node_manager.o node_manager.c
[test01 at torque03 server]$ pwd
/usr/local/src/torque-4.1.1/src/server


((reproduce))
(1) with "--enable-gcc-warnings"
./configure --prefix=/usr/local/torque --with-server-home=/var/torque  --enable-docs --with-rcp=rcp --enable-gcc-warnings
make --jobs=4

gcc -DHAVE_CONFIG_H -I. -I../../src/include  -I../../src/include  -DPBS_SERVER_HOME=\"/var/torque\" -DPBS_ENVIRON=\"/var/torque/pbs_environment\" `xml2-config --cflags` -g -O2 -W -Wall -Wno-unused-
parameter -Wno-long-long -pedantic -Werror -MT dis_read.o -MD -MP -MF .deps/dis_read.Tpo -c -o dis_read.o dis_read.c
cc1: warnings being treated as errors
array_func.c: In function ‘modify_array_range’:
array_func.c:1545: warning: dereferencing type-punned pointer will break strict-aliasing rules
make[3]: *** [array_func.o] Error 1
make[3]: *** Waiting for unfinished jobs....
mv -f .deps/accounting.Tpo .deps/accounting.Po
mv -f .deps/attr_recov.Tpo .deps/attr_recov.Po
mv -f .deps/dis_read.Tpo .deps/dis_read.Po
make[3]: Leaving directory `/usr/local/src/torque-4.1.1/src/server'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/local/src/torque-4.1.1/src/server'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/torque-4.1.1/src'
make: *** [all-recursive] Error 1

(2)skip above error with -fno-strict-aliasing
[test01 at torque03 torque-4.1.1]$ cd src/server/
[test01 at torque03 server]$ gcc -DHAVE_CONFIG_H -I. -I../../src/include  -I../../src/include  -DPBS_SERVER_HOME=\"/var/torque\" -DPBS_ENVIRON=\"/var/torque/pbs_environment\" `xml2-config --cflags` -g -
O2 -W -Wall -Wno-unused-parameter -Wno-long-long -pedantic -Werror -MT array_func.o -MD -MP -MF .deps/array_func.Tpo -c -o array_func.o array_func.c
cc1: warnings being treated as errors
array_func.c: In function ‘modify_array_range’:
array_func.c:1545: warning: dereferencing type-punned pointer will break strict-aliasing rules
[test01 at torque03 server]$ gcc -DHAVE_CONFIG_H -I. -I../../src/include  -I../../src/include  -DPBS_SERVER_HOME=\"/var/torque\" -DPBS_ENVIRON=\"/var/torque/pbs_environment\" `xml2-config --cflags` -g -
O2 -W -Wall -Wno-unused-parameter -Wno-long-long -pedantic -Werror -MT array_func.o -MD -MP -MF .deps/array_func.Tpo -c -o array_func.o array_func.c -fno-strict-aliasing

(3)back to the top of src and re-run make
[test01 at torque03 server]$ cd ..
[test01 at torque03 src]$ cd ..
[test01 at torque03 torque-4.1.1]$ make
gcc -DHAVE_CONFIG_H -I. -I../../src/include  -I../../src/include  -DPBS_SERVER_HOME=\"/var/torque\" -DPBS_ENVIRON=\"/var/torque/pbs_environment\" `xml2-config --cflags` -g -O2 -W -Wall -Wno-unused-
parameter -Wno-long-long -pedantic -Werror -MT node_manager.o -MD -MP -MF .deps/node_manager.Tpo -c -o node_manager.o node_manager.c
cc1: warnings being treated as errors
node_manager.c: In function ‘is_reserved_property’:
node_manager.c:3814: warning: comparison of unsigned expression < 0 is always false
make[3]: *** [node_manager.o] Error 1
make[3]: Leaving directory `/usr/local/src/torque-4.1.1/src/server'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/local/src/torque-4.1.1/src/server'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/torque-4.1.1/src'
make: *** [all-recursive] Error 1

----
Go Yoshimura <go-yoshimura at sstc.co.jp>
Scalable Systems Co., Ltd.  <http://www.sstc.co.jp/>
Osaka Office            HONMACHI-COLLABO Bldg. 4F, 4-4-2 Kita-kyuhoji-machi, Chuo-ku, Osaka 541-0057 Japan
              Tel: 81-6-6224-4115
Tokyo Kojimachi Office  BUREX Kojimachi 11F, 3-5-2 Kojimachi, Chiyoda-ku, Tokyo 102-0083 Japan 
              Tel: 81-3-5875-4718 Fax: 81-3-3237-7612              



More information about the torquedev mailing list