[Bug 1992159] Re: [SRU] Syntax error defien in socket.h

Brian Murray 1992159 at bugs.launchpad.net
Fri Jul 28 18:36:22 UTC 2023


Hello Karsten, or anyone else affected,

Accepted glibc into jammy-proposed. The package will build now and be
available at https://launchpad.net/ubuntu/+source/glibc/2.35-0ubuntu3.3
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 on 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, what testing has been
performed on the package and change the tag from verification-needed-
jammy to verification-done-jammy. If it does not fix the bug for you,
please add a comment stating that, and change the tag to verification-
failed-jammy. In either case, without details of your testing we will
not be able to proceed.

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

N.B. The updated package will be released to -updates after the bug(s)
fixed by this package have been verified and the package has been in
-proposed for a minimum of 7 days.

** Tags removed: verification-done verification-done-jammy
** Tags added: verification-needed verification-needed-jammy

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

Title:
  [SRU] Syntax error defien in socket.h

Status in glibc package in Ubuntu:
  Fix Released
Status in glibc source package in Jammy:
  Fix Committed

Bug description:
  [ Impact ]

   * What are the effects of the bug on users?
     Some Compilers will exit with a syntax error when
     a user tries to compile glibc for systems where the
     'time_t' type of the default ABI is 32 bits (e.g. arm,
     hppa, microblaze). The compiler must be a Clang compiler
     with a major version of less than four and is either a
     GNUC compiler with a major version of less than two or no
     GNUC compiler.

     If someone should be confused; here is the logical notation
     (See "Other Info" before you evaluate this!):
     TIME_BITS_SIZE = 32 AND CLANG_MAJOR < 4
     AND (NOT GNUC OR GNUC < 2)

     Additionally, a few C pre-processors (an overwhelming
     minority) will throw a syntax error if they encounter an
     unknown pre-processor keyword, even if it is unreachable
     (like this bug).

   * What is the justification for backporting the fix to the
     stable release?

     The bug is already fixed upstream, and some users reported
     the error.

   * How does the upload fix the bug?
     The bug is caused by a typographical error of a pre-processor
     keyword ("#defien" instead of "#define"). The bug fix
     includes correcting the typographical error. "Just" two
     characters get changed.

  [ Test Plan ]

   * How to reproduce the bug?
     We will reproduce this bug with the Oracle Embedded SQL
     Pro*C Pre-processor (Oracle ESQL ProC).
     I tested this on a fresh installation of 22.04.2 and a
     pre-existing installation of 22.04.1.

     1. Install glibc:
     sudo apt install libc6-dev

     2. Download the binaries Oracle ESQL ProC binaries
     (they are licensed under the Oracle Technology Network
     License Agreement https://www.oracle.com/downloads/licenses/standard-license.html):
     wget https://download.oracle.com/otn_software/linux/instantclient/219000/instantclient-basic-linux.x64-21.9.0.0.0dbru.zip https://download.oracle.com/otn_software/linux/instantclient/219000/instantclient-sdk-linux.x64-21.9.0.0.0dbru.zip https://download.oracle.com/otn_software/linux/instantclient/219000/instantclient-precomp-linux.x64-21.9.0.0.0dbru.zip

     3. Create the destination where the binaries will be copied to:
     sudo mkdir -m a=rwx /opt/oracle

     4. Unzip the binaries:
     a.) unzip instantclient-basic-linux.x64-21.9.0.0.0dbru.zip -d /opt/oracle
     b.) unzip instantclient-sdk-linux.x64-21.9.0.0.0dbru.zip -d /opt/oracle
     c.) unzip instantclient-precomp-linux.x64-21.9.0.0.0dbru.zip -d /opt/oracle

     5. Add configuration to use x86-64 arcitecture and glibc include folder location:
     a.) echo "define=__x86_64__" >> /opt/oracle/instantclient_21_9/precomp/admin/pcscfg.cfg
     b.) echo "sys_include=/usr/include/x86_64-linux-gnu" >> /opt/oracle/instantclient_21_9/precomp/admin/pcscfg.cfg

     6. Create a test source file:
     echo "include <sys/socket.h>" | tee test.cp

     7. Add envirenment variables for the pre-processor:
     a.) export ORACLE_HOME=/opt/oracle/instantclient_21_9
     b.) export LD_LIBRARY_PATH=/opt/oracle/instantclient_21_9

     8. Run the preprocessor:
     $ORACLE_HOME/sdk/proc iname=test.pc oname=test.c sqlcheck=syntax code=ansi_c parse=partial

     This will result in the following error message:
      Syntax error at line 184, column 4, file /usr/include/x86_64-linux-gnu/sys/socket.h:
      Error at line 184, column 4 in file /usr/include/x86_64-linux-gnu/sys/socket.h
      #  defien sendmsg __sendmsg64
      ...1
      PCC-S-02014, Encountered the symbol "defien" when expecting one of the following
      :

         a numeric constant, newline, define, endif, error, if, ifdef,
         ifndef, include, include_next, line, pragma, _Pragma, undef,
         an immediate preprocessor command, a C token

  [ Where problems could occur ]

   * The bugfix allows compiling glibc for systems where it
     couldn't get compiled before. This could enable the build
     of packages that break others, but this should not count as
     the fault of glibc.

   * A theoretical regression is limited to the sys/socket.h
     sendmsg function because it gets redirected through the
     "#define" macro.

   * A pre-compiler of a non-GNUC compiler that tries to appear
     as a GNUC compiler with an incorrect lexical analyzer could
     result in a different syntax tree. I don't know of an
     example, and Canonical should not support such a
     configuration

  [ Other Info ]
                                                                  |
   * Many non-GNUC compilers try to appear as a GNUC compiler by
     using pre-defined compiler macros typical for GNUC compilers.
     A non-GNUC compiler that tries to appear as GNUC version two
     or higher may NOT be affected, while a non-GNUC compiler may
     be affected.

   * The original bug report description:

  On line 184 in/usr/include/x86_64-linux-gnu/sys/socket.h it says

  #  defien sendmsg __sendmsg64

  which obviously should read "define" instead.

  ProblemType: Bug
  DistroRelease: Ubuntu 22.04
  Package: libc6-dev 2.35-0ubuntu3.1
  ProcVersionSignature: Microsoft 4.4.0-22000.653-Microsoft 4.4.35
  Uname: Linux 4.4.0-22000-Microsoft x86_64
  ApportVersion: 2.20.11-0ubuntu82.1
  Architecture: amd64
  CasperMD5CheckResult: unknown
  Date: Fri Oct  7 13:06:34 2022
  ProcEnviron:
   LD_LIBRARY_PATH=<set>
   TERM=xterm-256color
   PATH=(custom, no user)
   LANG=en_GB.UTF-8
   SHELL=/bin/bash
  SourcePackage: glibc
  UpgradeStatus: No upgrade log present (probably fresh install)

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




More information about the foundations-bugs mailing list