Bug 511573 - FTBFS gnupg-1.4.9-5.fc11
FTBFS gnupg-1.4.9-5.fc11
Product: Fedora
Classification: Fedora
Component: gnupg (Show other bugs)
All Linux
high Severity high
: ---
: ---
Assigned To: Nalin Dahyabhai
Fedora Extras Quality Assurance
Depends On:
Blocks: F12FTBFS
  Show dependency treegraph
Reported: 2009-07-14 23:25 EDT by FTBFS
Modified: 2009-07-22 17:30 EDT (History)
3 users (show)

See Also:
Fixed In Version: gcc-4.4.0-15
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-07-22 17:30:50 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
root.log (336.06 KB, text/plain)
2009-07-14 23:25 EDT, FTBFS
no flags Details
build.log (120.39 KB, text/plain)
2009-07-14 23:25 EDT, FTBFS
no flags Details
mock.log (1023 bytes, text/plain)
2009-07-14 23:25 EDT, FTBFS
no flags Details
root.log (455.88 KB, text/plain)
2009-07-14 23:25 EDT, FTBFS
no flags Details
build.log (114.67 KB, text/plain)
2009-07-14 23:25 EDT, FTBFS
no flags Details
mock.log (954 bytes, text/plain)
2009-07-14 23:25 EDT, FTBFS
no flags Details
cut-down reproducer (412 bytes, text/x-csrc)
2009-07-16 13:32 EDT, Nalin Dahyabhai
no flags Details
repro.i (51.02 KB, text/plain)
2009-07-16 14:21 EDT, Nalin Dahyabhai
no flags Details

  None (edit)
Description FTBFS 2009-07-14 23:25:25 EDT
gnupg-1.4.9-5.fc11.src.rpm Failed To Build From Source against the rawhide tree.  See http://fedoraproject.org/wiki/FTBFS for more information.
Comment 1 FTBFS 2009-07-14 23:25:28 EDT
Setting to ASSIGNED per Fedora Bug Triage workflow.  https://fedoraproject.org/wiki/BugZappers/BugStatusWorkFlow
Comment 2 FTBFS 2009-07-14 23:25:31 EDT
Created attachment 352540 [details]

root.log for i386
Comment 3 FTBFS 2009-07-14 23:25:32 EDT
Created attachment 352541 [details]

build.log for i386
Comment 4 FTBFS 2009-07-14 23:25:34 EDT
Created attachment 352542 [details]

mock.log for i386
Comment 5 FTBFS 2009-07-14 23:25:35 EDT
Created attachment 352543 [details]

root.log for x86_64
Comment 6 FTBFS 2009-07-14 23:25:36 EDT
Created attachment 352544 [details]

build.log for x86_64
Comment 7 FTBFS 2009-07-14 23:25:38 EDT
Created attachment 352545 [details]

mock.log for x86_64
Comment 8 Nalin Dahyabhai 2009-07-16 13:31:04 EDT
Hmm, __builtin_object_size() doesn't seem to allow for how gnupg allocates and uses "struct para_data_s" in g10/keygen.c.  Changing the way the structure is
laid out will work as a temporary fix, but we should probably ask the toolchain folks about it, too.
Comment 9 Nalin Dahyabhai 2009-07-16 13:32:49 EDT
Created attachment 354021 [details]
cut-down reproducer
Comment 10 Nalin Dahyabhai 2009-07-16 14:21:41 EDT
Created attachment 354030 [details]

preprocessed version of repro.c (attachment #354021 [details])
Comment 11 Nalin Dahyabhai 2009-07-16 14:30:03 EDT
Jakub, I boiled down the code in gnupg that crashes during the test suite down to attachment #354030 [details].  Building it with -O2 using gcc-4.4.0-12 triggers __fortify_fail on my x86_64 system.

Do you know if this is something that gcc needs to be allowing for, or should I be looking at reworking the structure definition in gnupg?  I'd appreciate any advice you have.  Thanks!
Comment 12 Jakub Jelinek 2009-07-16 14:54:39 EDT
Yes, this is considered invalid for str*/stp* functions with -D_FORTIFY_SOURCE=2 (valid for -D_FORTIFY_SOURCE=1 and -U_FORTIFY_SOURCE).
Either use memcpy instead of strcpy (memcpy accross field boundaries is valid even with -D_FORTIFY_SOURCE=2, memcpy (l->u.value, "DSA", sizeof "DSA")), or rework the data structures.  Say:
struct list_item {
 struct list_item *next;
 int blah;
union list_item_union {
 struct list_item header;
 struct list_item_foo { struct list_item header; foo *foo; } foo;
 struct list_item_bar { struct list_item header; bar *bar; } bar;
 struct list_item_baz { struct list_item header; uint32_t baz; } baz;
 struct list_item_value { struct list_item header; char value[1]; } value;
should work (or obviously you can have union for the stuff you don't abuse as wannabe flexible array member).
Comment 13 Nalin Dahyabhai 2009-07-16 17:28:21 EDT
Is there a reference for what's valid and what isn't?  I've found mention of some things that aren't valid in assorted bug reports and mailing list archives, but haven't found a full list to check against.  I'd like to avoid proposing a change upstream that happens to be accepted now but later turns out to be problematic.
Comment 14 Jakub Jelinek 2009-07-20 10:49:22 EDT
Actually, now that I got another similar report (#512689), after some discussions on upstream IRC I'm considering allowing this:
Comment 15 Nalin Dahyabhai 2009-07-22 17:30:50 EDT
Thanks, Jakub!  The scratch build now succeeds with 4.4.0-15, so I'll mark this as fixed in Raw Hide.

Note You need to log in before you can comment on or make changes to this bug.