Bug 436374 - Error: file number 2 already allocated
Summary: Error: file number 2 already allocated
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc   
(Show other bugs)
Version: rawhide
Hardware: ia64
OS: Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
Depends On:
Blocks: fedora-ia64
TreeView+ depends on / blocked
Reported: 2008-03-06 20:55 UTC by Doug Chapman
Modified: 2008-03-06 21:26 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-03-06 21:13:40 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
asm file from g++ -g -S foo.cc (157.30 KB, text/plain)
2008-03-06 20:55 UTC, Doug Chapman
no flags Details

Description Doug Chapman 2008-03-06 20:55:28 UTC
Description of problem:

This is an odd one.  It was first seen with "real" code but the reproducer is
simply this:

create a file "foo.cc" with nothing but:

#include <iostream>

then build it in 2 steps:
g++ -g -S foo.cc
g++ -g foo.s

foo.s: Assembler messages:
foo.s:155: Error: file number 2 already allocated

If I do it in 1 step as normal:
g++ -g foo.cc

it works just fine.  There is at least 1 package in Fedora (I forget which one
right now) that for some reason does this in 2 steps and breaks.

I realize you may not have easy access to an ia64 box.  I will attach the .s
file which I imagine might be helpful.  Don't hesitate to ask me to try things
out to get more info.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
Actual results:

Expected results:

Additional info:

Comment 1 Doug Chapman 2008-03-06 20:55:28 UTC
Created attachment 297101 [details]
asm file from g++ -g -S foo.cc

Comment 2 Jakub Jelinek 2008-03-06 21:13:40 UTC
User error.  You can't use -g twice.  Either you use -g to compile foo.cc, then
foo.s will already contain debug info, or you assemble with -g and the assembler
adds debugging info for the assembler.  If you both compile with -g, the
assembler already contains debug info and thus adding assembler debug info for
it is a bug.

Comment 3 Doug Chapman 2008-03-06 21:26:39 UTC
Thanks, I will get the offending package to fix their makefiles.

- Doug

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