[Bug 1547060] Re: cant use -d switch

Martin Pitt martin.pitt at ubuntu.com
Tue Apr 26 09:00:45 UTC 2016


Hello stsp, or anyone else affected,

Accepted tgt into xenial-proposed. The package will build now and be
available at
https://launchpad.net/ubuntu/+source/tgt/1:1.0.63-1ubuntu1.1 in a few
hours, and then in the -proposed repository.

Please help us by testing this new package.  See
https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to
enable and use -proposed.  Your feedback will aid us getting this update
out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug,
mentioning the version of the package you tested, and change the tag
from verification-needed to verification-done. If it does not fix the
bug for you, please add a comment stating that, and change the tag to
verification-failed.  In either case, details of your testing will help
us make a better decision.

Further information regarding the verification process can be found at
https://wiki.ubuntu.com/QATeam/PerformingSRUVerification .  Thank you in
advance!

** Tags added: verification-needed

-- 
You received this bug notification because you are a member of Ubuntu
Sponsors Team, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/1547060

Title:
  cant use -d switch

Status in tgt package in Ubuntu:
  Fix Committed
Status in tgt source package in Xenial:
  Fix Committed
Status in tgt package in Debian:
  New

Bug description:
  [Impact]

   * Users of tgt who wish to make use of the server command line options:
     -d,--debug , -t,--nr_iothreads, -C,--control-port will fail due to
     an option parsing error.  This prevents users from exercising
     additional control of the tgtd, regressing the capabilities of tgtd.

     This affects the 1.0.63 release of tgt and is not yet fixed upstream.
     Patches have been sumitted.
     
   * Backporting fixes from upstream release is required to ensure
     users of tgtd can exercise all capabilities, including enabling
     debugging and other features previously available to tgt users.

   * The patch fixes a misuderstanding of the use of errno after calling
     the strtoull libc call.  Errno is not set in all cases for strtoull
     so extra checks must be used to determine if the current value of
     errno is related to the strtoull call.

  [Test Case]

   * On a Xenial 16.04 system
      1. lxd init
      2. lxc launch ubuntu-daily:xenial x1
      3. lxc exec x1 -- /bin/bash -c 'apt-get update && apt-get -y install tgt && tgtd -d1; echo $?'

      # On FAILURE: return code will be non-zero with the following
  output

      -d argument value '1' invalid
      Try `tgtd --help' for more information.
      22

      # After installing the newer tgt package, return code will be 0

  [Regression Potential]

   * Unlikely any new regressions will take place as the current package
     prevents users from using portions of tgtd due to not being able to
     pass numeric values to tgtd options.

  [Other Info]
   * Debian Bug filed:
     - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=822160
   * Upstream request to accept patch
     - http://article.gmane.org/gmane.linux.stgt/535

  
  [Original Description]
  tgt-1:1.0.62-1ubuntu2

  # ./tgtd -d 1
  -d argument value '1' invalid
  Try `tgtd --help' for more information.

  The following change should fix the problem:

  --- util.h.old  2015-12-02 03:27:15.000000000 +0300
  +++ util.h      2016-02-18 18:04:08.749932076 +0300
  @@ -148,7 +148,7 @@
          unsigned long long ull_val;                     \
          ull_val = strtoull(str, &ptr, 0);               \
          val = (typeof(val)) ull_val;                    \
  -       if (errno || ptr == str)                        \
  +       if (ull_val == ULONG_MAX || ptr == str)         \
                  ret = EINVAL;                           \
          else if (val != ull_val)                        \
                  ret = ERANGE;                           \

  Here, the errno is checked incorrectly: you can't check
  errno unless the returned value allows you to. In case
  of strtoull(), errno should be checked only if ULONG_MAX is
  returned.
  I however can't test the fix properly because when compiled
  from source, the bug doesn't happen. The value of errno is
  unspecified, and it just happens to be 0 when I compile from
  sources.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/tgt/+bug/1547060/+subscriptions



More information about the Ubuntu-sponsors mailing list