sysklogd: FTBFS on s390 - missing atomic_t / __KERNEL__

Bug #6784 reported by Debian Bug Importer
4
Affects Status Importance Assigned to Milestone
sysklogd (Debian)
Fix Released
Unknown
sysklogd (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

Automatically imported from Debian bug report #245513
http://bugs.debian.org/245513

Revision history for this message
In , Phil Blundell (pb) wrote :

Using <linux/module.h> from an application is a bad idea. In
particular, atomic_t is just not available in userspace on some
architectures, because there is no datatype that is inherently atomic.

You probably want to copy module.h from modutils/include and use that
instead.

p.

Revision history for this message
In , Nathanael Nerode (neroden-twcny) wrote : FYI

FYI for anyone following this bug:

Herbert Xu has indicated elsewhere
(http://lists.debian.org/debian-release/2004/04/msg00004.html) that the
entire scheme for which this package uses module.h (extracting symbol names
for modules) doesn't work properly with kernel 2.2, 2.4, or 2.6. I'm not
sure exactly to what extent this is true, but it probably indicates that
ripping out the affected code entirely is appropriate.

Apparently for 2.2/2.4 'ksymoops' should be used, but I don't (yet) understand
that well enough to implement it. And apparently for 2.6 "the kernel itself
will do the decoding", though again I don't know what needs to be done to ask
the kernel to do that, if anything.

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Automatically imported from Debian bug report #245513
http://bugs.debian.org/245513

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-Id: <email address hidden>
Date: Fri, 23 Apr 2004 17:34:01 +0200
From: Petter Reinholdtsen <email address hidden>
To: <email address hidden>
Subject: sysklogd: FTBFS on s390 - missing atomic_t / __KERNEL__

Package: sysklogd
Version: 1.4.1-14
Severity: serious
Tags: patch

The latest sysklogd source fail to build on s390. This keep the
latest version from propagating into sarge, and make the bug a serious
problem.

The problem is in the new module.h, where hte atomic_t type is missing
when including <asm/atomic.h> on s390 and hppa. This is the build
error from s390 (identical to the one on hppa):

 gcc -O2 -Wall -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DSYSV
   -fomit-frame-pointer -fno-strength-reduce -DFSSTND -c ksym_mod.c
  In file included from ksym_mod.c:97:
  module.h:65: error: parse error before "atomic_t"
  module.h:65: warning: no semicolon at end of struct or union
  module.h:65: warning: no semicolon at end of struct or union
  module.h:67: error: parse error before '}' token
  module.h:67: warning: type defaults to `int' in declaration of `uc'
  module.h:67: warning: data definition has no type or storage class
  module.h:90: error: parse error before '}' token
  ksym_mod.c:144: error: field `module' has incomplete type
  ksym_mod.c: In function `AddModule':
  ksym_mod.c:418: error: invalid application of `sizeof' to an incomplete type
  make[1]: *** [ksym_mod.o] Error 1

I had a look on raptor.debian.org, and there I discovered that the
problem is that everything in <asm/atomic.h> is protected by #ifdef
__KERNEL__, including the atomic_t type.

Making sure to define __KERNEL__ before including <asm/atomic.h> fixed
the build problem on s390. This might not be safe on all other archs.
Here is a patch against sysklogd 1.4.1-14 to do that:

diff -ur sysklogd-1.4.1/module.h sysklogd-1.4.1-pere/module.h
--- sysklogd-1.4.1/module.h 2004-04-23 17:28:43.000000000 +0200
+++ sysklogd-1.4.1-pere/module.h 2004-04-23 17:29:03.000000000 +0200
@@ -28,6 +28,7 @@
  * recent content from Linux 2.4/2.6.
  */

+#define __KERNEL__ /* get it compiling on s390 */
 #include <asm/atomic.h>

 #define MODULE_NAME_LEN (64 - sizeof(unsigned long))

Another approach is to change the s390 kernel headers to be more like
the other archs. I checked on i386, and there the <asm/atomic.h>
header isn't protected by #ifdef __KERNEL__.

Here is a patch against linux-kernel-headers version
2.5.999-test7-bk-15. It will also fix the problem.

--- /usr/include/asm/atomic.h.orig 2003-10-15 17:10:24.000000000 +0200
+++ /usr/include/asm/atomic.h 2004-04-23 17:31:26.000000000 +0200
@@ -1,7 +1,6 @@
 #ifndef __ARCH_S390_ATOMIC__
 #define __ARCH_S390_ATOMIC__

-#ifdef __KERNEL__
 /*
  * include/asm-s390/atomic.h
  *
@@ -193,5 +192,4 @@
 #define smp_mb__before_atomic_inc() smp_mb()
 #define smp_mb__after_atomic_inc() smp_mb()

-#endif /* __KERNEL__ */
 #endif /* __ARCH_S390_ATOMIC__ */

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-Id: <email address hidden>
Date: Fri, 23 Apr 2004 17:05:14 +0100
From: Philip Blundell <email address hidden>
To: <email address hidden>
Cc: Petter Reinholdtsen <email address hidden>
Subject: Re: sysklogd: FTBFS on s390 - missing atomic_t / __KERNEL__

Using <linux/module.h> from an application is a bad idea. In
particular, atomic_t is just not available in userspace on some
architectures, because there is no datatype that is inherently atomic.

You probably want to copy module.h from modutils/include and use that
instead.

p.

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-Id: <email address hidden>
Date: Thu, 20 May 2004 16:46:26 -0400
From: Nathanael Nerode <email address hidden>
To: <email address hidden>
Subject: FYI

FYI for anyone following this bug:

Herbert Xu has indicated elsewhere
(http://lists.debian.org/debian-release/2004/04/msg00004.html) that the
entire scheme for which this package uses module.h (extracting symbol names
for modules) doesn't work properly with kernel 2.2, 2.4, or 2.6. I'm not
sure exactly to what extent this is true, but it probably indicates that
ripping out the affected code entirely is appropriate.

Apparently for 2.2/2.4 'ksymoops' should be used, but I don't (yet) understand
that well enough to implement it. And apparently for 2.6 "the kernel itself
will do the decoding", though again I don't know what needs to be done to ask
the kernel to do that, if anything.

Revision history for this message
Matt Zimmerman (mdz) wrote :

This bug is s390-specific

Revision history for this message
In , Martin Schulze (joey-infodrom) wrote : Bug#245513: fixed in sysklogd 1.4.1-15

Source: sysklogd
Source-Version: 1.4.1-15

We believe that the bug you reported is fixed in the latest version of
sysklogd, which is due to be installed in the Debian FTP archive:

klogd_1.4.1-15_i386.deb
  to pool/main/s/sysklogd/klogd_1.4.1-15_i386.deb
sysklogd_1.4.1-15.diff.gz
  to pool/main/s/sysklogd/sysklogd_1.4.1-15.diff.gz
sysklogd_1.4.1-15.dsc
  to pool/main/s/sysklogd/sysklogd_1.4.1-15.dsc
sysklogd_1.4.1-15_i386.deb
  to pool/main/s/sysklogd/sysklogd_1.4.1-15_i386.deb

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to <email address hidden>,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Martin Schulze <email address hidden> (supplier of updated sysklogd package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing <email address hidden>)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Tue, 27 Jul 2004 17:28:49 +0200
Source: sysklogd
Binary: sysklogd klogd
Architecture: source i386
Version: 1.4.1-15
Distribution: unstable
Urgency: low
Maintainer: Martin Schulze <email address hidden>
Changed-By: Martin Schulze <email address hidden>
Description:
 klogd - Kernel Logging Daemon
 sysklogd - System Logging Daemon
Closes: 245513
Changes:
 sysklogd (1.4.1-15) unstable; urgency=low
 .
   * Applied patch by Steve Grubb <email address hidden> to adjust memory
     calculation in crunch_list().
   * Removed atomic_t in the usecount field of the module struct for
     compatibility reasons (closes: Bug#245513)
Files:
 607606bc02c92cbee143dc1cd33ac25c 539 base important sysklogd_1.4.1-15.dsc
 33cc1741637412d074c8ac20ef1299a7 23946 base important sysklogd_1.4.1-15.diff.gz
 c937c7feca104f4eda901a2698290e69 56516 base important sysklogd_1.4.1-15_i386.deb
 8bb0bdcc61be46b9d9dcfe32cf9f5ea6 38130 base important klogd_1.4.1-15_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBBnVdW5ql+IAeqTIRApepAJ4uhTfoHBRBsvaCW+bk9NcA9hw25ACgg+E5
OMF/C6sS/B5BDnk6nfqzAPk=
=JwAp
-----END PGP SIGNATURE-----

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-Id: <email address hidden>
Date: Tue, 27 Jul 2004 11:47:02 -0400
From: Martin Schulze <email address hidden>
To: <email address hidden>
Subject: Bug#245513: fixed in sysklogd 1.4.1-15

Source: sysklogd
Source-Version: 1.4.1-15

We believe that the bug you reported is fixed in the latest version of
sysklogd, which is due to be installed in the Debian FTP archive:

klogd_1.4.1-15_i386.deb
  to pool/main/s/sysklogd/klogd_1.4.1-15_i386.deb
sysklogd_1.4.1-15.diff.gz
  to pool/main/s/sysklogd/sysklogd_1.4.1-15.diff.gz
sysklogd_1.4.1-15.dsc
  to pool/main/s/sysklogd/sysklogd_1.4.1-15.dsc
sysklogd_1.4.1-15_i386.deb
  to pool/main/s/sysklogd/sysklogd_1.4.1-15_i386.deb

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to <email address hidden>,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Martin Schulze <email address hidden> (supplier of updated sysklogd package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing <email address hidden>)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Tue, 27 Jul 2004 17:28:49 +0200
Source: sysklogd
Binary: sysklogd klogd
Architecture: source i386
Version: 1.4.1-15
Distribution: unstable
Urgency: low
Maintainer: Martin Schulze <email address hidden>
Changed-By: Martin Schulze <email address hidden>
Description:
 klogd - Kernel Logging Daemon
 sysklogd - System Logging Daemon
Closes: 245513
Changes:
 sysklogd (1.4.1-15) unstable; urgency=low
 .
   * Applied patch by Steve Grubb <email address hidden> to adjust memory
     calculation in crunch_list().
   * Removed atomic_t in the usecount field of the module struct for
     compatibility reasons (closes: Bug#245513)
Files:
 607606bc02c92cbee143dc1cd33ac25c 539 base important sysklogd_1.4.1-15.dsc
 33cc1741637412d074c8ac20ef1299a7 23946 base important sysklogd_1.4.1-15.diff.gz
 c937c7feca104f4eda901a2698290e69 56516 base important sysklogd_1.4.1-15_i386.deb
 8bb0bdcc61be46b9d9dcfe32cf9f5ea6 38130 base important klogd_1.4.1-15_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBBnVdW5ql+IAeqTIRApepAJ4uhTfoHBRBsvaCW+bk9NcA9hw25ACgg+E5
OMF/C6sS/B5BDnk6nfqzAPk=
=JwAp
-----END PGP SIGNATURE-----

Revision history for this message
Daniel Robitaille (robitaille) wrote :

Fixed in Debian in July 2004

Changed in sysklogd:
status: Unconfirmed → Fix Released
Changed in sysklogd:
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.