This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 70045 - -malign-double option causes program to fail.
-malign-double option causes program to fail.
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
i686 Linux
medium Severity high
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2002-07-29 12:53 EDT by Need Real Name
Modified: 2007-04-18 12:44 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-07-29 12:56:09 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Source for test program to demonstrate -malign-double / stringstream interaction (299 bytes, text/plain)
2002-07-29 12:56 EDT, Need Real Name
no flags Details

  None (edit)
Description Need Real Name 2002-07-29 12:53:17 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.4.9-12smp i686)

Description of problem:
When I compile with the -malign-double option to g++, an application that uses a
stringstream to tokenize an input buffer does not operate correctly (no tokens
are found).  If I omit the -malign-double option, the program operates
correctly.  I've created and attached a test case that abstracts the problematic
code fragment.  In the actual application, this failure prevents the application
(a data server) from reading in the data it's supposed to provide to the rest of
our system, and causes a coredump.

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

How reproducible:

Steps to Reproduce:
1.  Compile the attached test program as follows:
"g++ -o tester"

2.  Run the program and note the output:
"5 tokens"

3.  Recompile the program as follows:
"g++ -o tester -malign-double"

4.  Run the program and note the output:
"0 tokens"

Actual Results:  The program should write the string "5 tokens" to stdout.

Expected Results:  The program wrote the string "0 tokens" to stdout.

Additional info:

From the test system, output of uname -a:

Linux itacsdev02 2.4.18-3 #1 Thu Apr 18 07:37:53 EDT 2002 i686 unknown

output of g++ -v:

Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-110)
Comment 1 Need Real Name 2002-07-29 12:56:02 EDT
Created attachment 67544 [details]
Source for test program to demonstrate -malign-double / stringstream interaction
Comment 2 Jakub Jelinek 2002-07-29 13:00:19 EDT
-malign-double changes the ABI, so all libraries which the program uses
(including glibc and libstdc++) must be recompiled with those options
for things to work.
      *Warning:* if you use the -malign-double' switch, structures
      containing the above types will be aligned differently than the
      published application binary interface specifications for the 386.

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