headers incompatible with eglibc

Bug #933045 reported by Serge Hallyn
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
eglibc (Ubuntu)
Fix Released
Medium
Canonical Foundations Team
linux (Ubuntu)
Triaged
Medium
Andy Whitcroft

Bug Description

/usr/include/asm-generic/fcntl.h:127:8: error: redefinition of 'struct f_owner_ex'
/usr/include/x86_64-linux-gnu/bits/fcntl.h:204:8: note: originally defined here
/usr/include/asm-generic/fcntl.h:167:8: error: redefinition of 'struct flock'
/usr/include/x86_64-linux-gnu/bits/fcntl.h:168:8: note: originally defined here
/usr/include/asm-generic/fcntl.h:184:8: error: redefinition of 'struct flock64'
/usr/include/x86_64-linux-gnu/bits/fcntl.h:183:8: note: originally defined here

$dpkg -S /usr/include/asm-generic/fcntl.h
linux-libc-dev: /usr/include/asm-generic/fcntl.h

$ dpkg -S /usr/include/x86_64-linux-gnu/bits/fcntl.h
libc6-dev: /usr/include/x86_64-linux-gnu/bits/fcntl.h

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

This was found as part of bug 930181

Revision history for this message
Brad Figg (brad-figg) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:

apport-collect 933045

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

Hi Serge,

This is in Precise?

Changed in linux (Ubuntu):
importance: Undecided → Medium
tags: added: kernel-da-key
Revision history for this message
Serge Hallyn (serge-hallyn) wrote : Re: [Bug 933045] Re: headers incompatible with eglibc

Quoting Joseph Salisbury (<email address hidden>):
> Hi Serge,
>
> This is in Precise?

Yup, up-to-date.

thanks,
-serge

Changed in linux (Ubuntu):
status: Confirmed → Triaged
tags: added: kernel-key
Revision history for this message
Andy Whitcroft (apw) wrote :

Seems that both the kernel and glibc are carrying the same header files. This does not seem optimal. I would have expected the kernel to carry this header, so I am passing over a task to eglibc for comment.

Revision history for this message
Andy Whitcroft (apw) wrote :

@serge -- could you also include the sample you are compiling to trigger this as simply including fcntl.h does not trigger this error.

Changed in eglibc (Ubuntu):
importance: Undecided → Medium
assignee: nobody → Canonical Foundations Team (canonical-foundations)
Revision history for this message
Matthias Klose (doko) wrote :

the reproducer is missing

Changed in eglibc (Ubuntu):
status: New → Incomplete
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

serge@ubuntu:~/test$ cat fail.c
#include <stdio.h>

#include <linux/fcntl.h> /* for AT_EMPTY_PATH */
#include <fcntl.h>

int main()
{
        printf("hello, world\n");
}
serge@ubuntu:~/test$ make fail
cc fail.c -o fail
In file included from /usr/include/fcntl.h:34:0,
                 from fail.c:4:
/usr/include/x86_64-linux-gnu/bits/fcntl.h:168:8: error: redefinition of ‘struct flock’
/usr/include/asm-generic/fcntl.h:167:8: note: originally defined here
make: *** [fail] Error 1

Changed in eglibc (Ubuntu):
status: Incomplete → New
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

@Andy, sorry I missed the comment asking for the reproducer before.

Comment #8 is the simplest reproducer. It's based on the (same) problem in qemu.git and qemu-kvm.git upstream trees.

I assume that in the past AT_EMPTY_PATH was defined in sys/fcntl.h or somesuch, but haven't checked. The upstream tree does NOT include linux/fcntl.h and used to compile. I tried adding linux/fcntl.h to fix the build, and ended up with the above failure.

(So what I'm saying is, IMO, there are two problems)

Revision history for this message
Andy Whitcroft (apw) wrote :

@Serge -- I have just been all the way back to lucid. Before oneiric there is no reference to AT_EMPTY_PATH in any header file. For oneiric and precise I see the same in both cases that linux/fcntl.h is the only place that this is define and it does not seem changed between oneiric and natty.

I guess I need to see the original package which is exhibiting this.

Changed in linux (Ubuntu):
assignee: nobody → Andy Whitcroft (apw)
status: Triaged → In Progress
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

@Andy,

note that the bug is not about AT_EMPTY_PATH being undefined, but about build failure when both <fcntl.h> and <linux/fcntl.h> are included. Unless there is some guidance (beyond "it causes this bug") why that shouldn't be done, in which case I need to justify the reason why I need to do that...

Otherwise I can go back and figure out why ther were no problems before the new glibc... My guess would be that <bits/fcntl.h> existed before (which is included by <fcntl.h>) and it #included <linux/fcntl.h>. But I haven't spooled up an image to verify that.

tags: removed: kernel-key
Revision history for this message
Adam Conrad (adconrad) wrote :

The AT_EMPTY_PATH missing definition bug was fixed, which renders this bug (IMO) invalid, as the answer to "those headers conflict" is "then don't include both", which is often true of kernel and userspace headers with similar names.

Changed in eglibc (Ubuntu):
status: New → Invalid
status: Invalid → Fix Released
Changed in linux (Ubuntu):
status: In Progress → Invalid
Revision history for this message
Steve Langasek (vorlon) wrote :

Kernel headers are often included indirectly. All headers that are shipped in the libc-linux-dev package need to be safe wrt sharing the namespace with the libc headers. This is the exact reason that definitions such as __kernel_pid_t and __kernel_time_t exist.

So this remains a valid bug.

Changed in linux (Ubuntu):
status: Invalid → Triaged
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.