[torquedev] [Bug 50] New: Check fread/fwrite returns values (GCC error with pedantic checking turned on)

bugzilla-daemon at supercluster.org bugzilla-daemon at supercluster.org
Wed Feb 17 08:11:36 MST 2010


http://www.clusterresources.com/bugzilla/show_bug.cgi?id=50

           Summary: Check fread/fwrite returns values (GCC error with
                    pedantic checking turned on)
           Product: TORQUE
           Version: 2.4.x
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: pbs_mom
        AssignedTo: glen.beane at gmail.com
        ReportedBy: burnus at net-b.de
                CC: torquedev at supercluster.org
   Estimated Hours: 0.0


While Torque 2.4.5 fixed:
  b - updated to a newer gcc and fixed warnings related to disregarded
      return values. Logging was added.

It did not do so for all files; torque-2.4.5/src/resmom/linux/cpuset.c still
contains fread (4 times) and fwrite (5 times) without checking for the return
value.

By the way, the TODO comment in torque-2.4.5/src/resmom/checkpoint.c is now
obsolete (occurs twice):

        /* TODO check return value of fchown */
        if (fchown(fd,pjob->ji_qs.ji_un.ji_momt.ji_exuid,
              pjob->ji_qs.ji_un.ji_momt.ji_exgid))

 * * *

By the way, rpmlint warns about:

libtorque2.x86_64: W: shared-lib-calls-exit /usr/lib64/libtorque.so.2.0.0
exit at GLIBC_2.2.5
This library package calls exit() or _exit(), probably in a non-fork()
context. Doing so from a library is strongly discouraged - when a library
function calls exit(), it prevents the calling program from handling the
error, reporting it to the user, closing files properly, and cleaning up any
state that the program has. It is preferred for the library to return an
actual error code and let the calling program decide how to handle the
situation.

-- 
Configure bugmail: http://www.clusterresources.com/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the torquedev mailing list