[SRU] Syntax error defien in socket.h
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
glibc (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Jammy |
Fix Released
|
High
|
Unassigned |
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:/
wget https:/
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-
b.) unzip instantclient-
c.) unzip instantclient-
5. Add configuration to use x86-64 arcitecture and glibc include folder location:
a.) echo "define=__x86_64__" >> /opt/oracle/
b.) echo "sys_include=
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_
b.) export LD_LIBRARY_
8. Run the preprocessor:
$ORACLE_
This will result in the following error message:
Syntax error at line 184, column 4, file /usr/include/
Error at line 184, column 4 in file /usr/include/
# 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/
# defien sendmsg __sendmsg64
which obviously should read "define" instead.
ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: libc6-dev 2.35-0ubuntu3.1
ProcVersionSign
Uname: Linux 4.4.0-22000-
ApportVersion: 2.20.11-0ubuntu82.1
Architecture: amd64
CasperMD5CheckR
Date: Fri Oct 7 13:06:34 2022
ProcEnviron:
LD_LIBRARY_
TERM=xterm-
PATH=(custom, no user)
LANG=en_GB.UTF-8
SHELL=/bin/bash
SourcePackage: glibc
UpgradeStatus: No upgrade log present (probably fresh install)
Changed in glibc (Ubuntu): | |
status: | Confirmed → Triaged |
importance: | Undecided → Critical |
tags: | added: foundations-todo |
Changed in glibc (Ubuntu): | |
importance: | Critical → High |
description: | updated |
summary: |
- Syntax error defien in socket.h + [SRU] Syntax error defien in socket.h |
Changed in glibc (Ubuntu Jammy): | |
status: | New → Triaged |
importance: | Undecided → High |
Changed in glibc (Ubuntu): | |
status: | Triaged → Fix Released |
Changed in glibc (Ubuntu Jammy): | |
status: | Triaged → In Progress |
tags: |
added: verification-done removed: verification-needed |
tags: |
added: verification-done removed: verification-needed |
tags: | removed: foundations-todo |
This was fixed upstream in https:/ /sourceware. org/git/ ?p=glibc. git;a=commitdif f;h=999835533bc 60fbd0b0b65d241 2a6742e5a54b9d which made it into 2.36 (and thus is fixed in kinetic) and on the 2.35 release branch in https:/ /sourceware. org/git/ ?p=glibc. git;a=commitdif f;h=fe9ca732ace 94cb49e4d4846a4 492db40cde34e4 .
(glibc bugzilla ref: https:/ /sourceware. org/bugzilla/ show_bug. cgi?id= 29225)