Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 65752 - GCC 3.4.2 alignment bug possibly, media-sound/zynaddsubfx-2.0.0 crashes
Summary: GCC 3.4.2 alignment bug possibly, media-sound/zynaddsubfx-2.0.0 crashes
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High major
Assignee: Please assign to toolchain
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-28 18:39 UTC by Eric Shattow
Modified: 2004-10-16 14:44 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emergeinfo.txt,2.39 KB, text/plain)
2004-09-28 20:30 UTC, Eric Shattow
Details
src/Synth/OscilGen.s: OscilGen::prepare() / gcc 3.3.4 (OscilGen-prepare.s,6.80 KB, text/plain)
2004-10-13 04:22 UTC, Eric Shattow
Details
src/Synth/OscilGen.s: OscilGen::prepare() / 3.4.2 (OscilGen-prepare.s,11.93 KB, text/plain)
2004-10-13 04:24 UTC, Eric Shattow
Details
src/Synth/OscilGen.C: OscilGen::prepare() (OscilGen-prepare.C,2.87 KB, text/plain)
2004-10-13 04:29 UTC, Eric Shattow
Details
src/Synth/OscilGen.s: gcc 3.4.2 (OscilGen.o,134.76 KB, text/plain)
2004-10-13 13:52 UTC, Eric Shattow
Details
src/Synth/OscilGen.s: gcc 3.3.4 (OscilGen.o,135.96 KB, text/plain)
2004-10-13 13:55 UTC, Eric Shattow
Details
src/Synth/OscilGen.C (OscilGen.C,32.71 KB, text/plain)
2004-10-13 14:02 UTC, Eric Shattow
Details
gdb output from zynaddsubfx crash (gdb_output,6.45 KB, text/plain)
2004-10-13 14:21 UTC, Eric Shattow
Details
diff -burN OscilGen-OscilGen_prepare.s-3.3.4 OscilGen-OscilGen_prepare.s-3.4.2 (OscilGen-OscilGen_prepare.s.diff,9.07 KB, text/plain)
2004-10-13 14:29 UTC, Eric Shattow
Details
IRC session, #gcc on OFTC (gooberirc.log,2.43 KB, text/plain)
2004-10-13 20:08 UTC, Eric Shattow
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Shattow 2004-09-28 18:39:22 UTC
Zyn crashes when you send midi data to it, after being compiled with gcc 3.4.2-r2

nothing else changed, i simply switched compilers with 'gcc-config' to 3.3.4, recompiled Zyn, and it works.

backtrace: http://paste.phpfi.com/31482

i even tried patching the Zyn makefile to use sensible compiler flags, but there was no change in behavior (still crashed).
Comment 1 Disenchanted (RETIRED) gentoo-dev 2004-09-28 18:55:05 UTC
need emerge info
when was gcc-3.4.2-r2 merged? if not after Sept. 21st, please remerge

Comment 2 Eric Shattow 2004-09-28 20:30:33 UTC
Created attachment 40681 [details]
emerge --info
Comment 3 Eric Shattow 2004-09-28 21:34:54 UTC
remerged gcc 3.4.2-r2, remerged zyn with it.  no change in behavior.  zyn loads, then when you send midi data or try to play the virtual keyboard, crash!   it's gotta be a compiler bug.

no crash happens if you gcc-config to a 3.3.x compiler to emerge zyn
Comment 4 Eric Shattow 2004-09-28 22:28:44 UTC
maybe it's just me and thom having this problem?     i'm thinking, "glibc bug"

anyways leave this bug open until the next glibc is available in the tree, in case someone else besides thom and i experience trouble.

the work around if you run into this is to compile your zyn with gcc 3.3.4
Comment 5 Eric Shattow 2004-10-01 01:15:34 UTC
confirmed by 3 other people. cause is  ?  no idea.   amd64 and ~x86
Comment 6 Eric Shattow 2004-10-13 04:06:06 UTC
more info coming.     newer version of Zyn brings forth the same flaw in GCC 3.4.2, and i have some assembler code to share.   compiled with -O0 -S -Wall flags.
Comment 7 Eric Shattow 2004-10-13 04:22:04 UTC
Created attachment 41704 [details]
src/Synth/OscilGen.s: OscilGen::prepare() / gcc 3.3.4

-O0 -Wall -S
Comment 8 Eric Shattow 2004-10-13 04:24:51 UTC
Created attachment 41705 [details]
src/Synth/OscilGen.s: OscilGen::prepare() / 3.4.2

-O0 -Wall -S
Comment 9 Eric Shattow 2004-10-13 04:29:12 UTC
Created attachment 41707 [details]
src/Synth/OscilGen.C: OscilGen::prepare()

source code portion from media-sound/zynaddsubfx
Comment 10 Eric Shattow 2004-10-13 04:34:09 UTC
relevent part that seems to be dying from bad gcc 3.4.x generation is line 32-33 of the ::prepare function in OscilGen.C, no matter what you put after those 'for' statements it is corrupted and dies inexplicably.
Comment 11 Eric Shattow 2004-10-13 13:52:44 UTC
Created attachment 41757 [details]
src/Synth/OscilGen.s: gcc 3.4.2

g++ -O0 -S    -c -o OscilGen.s OscilGen.C
Comment 12 Eric Shattow 2004-10-13 13:55:04 UTC
Created attachment 41759 [details]
src/Synth/OscilGen.s: gcc 3.3.4

g++ -O0 -S    -c -o OscilGen.s OscilGen.C
Comment 13 Eric Shattow 2004-10-13 14:02:04 UTC
Created attachment 41763 [details]
src/Synth/OscilGen.C

when built with these flags...
  CXXFLAGS= -O0 -ggdb -Wall
...and the gcc 3.3.4-r1 compiler, the program operates normally.
when built with the same flags and the gcc 3.4.2-r1 compiler, the program loads
but crashes when trying to run the part of the code that generates the Additive
Synthesis.

The invalid code appears in the "OscilGen::prepare" function, at line 677 of
the OscilGen.C source code.
Comment 14 Eric Shattow 2004-10-13 14:21:02 UTC
Created attachment 41764 [details]
gdb output from zynaddsubfx crash

compiled w/ 3.4.2-r2,  ran zyn the first time and enabled only the SUBSynth =
no crash, then enabled the PADsynth = crash, ran zyn a second time and enabled
only the ADSynth = crash
Comment 15 Eric Shattow 2004-10-13 14:29:16 UTC
Created attachment 41766 [details]
diff -burN OscilGen-OscilGen_prepare.s-3.3.4 OscilGen-OscilGen_prepare.s-3.4.2

diff of assembler output pertaining to the relevent problematic compiler
output, in the OscilGen::prepare function.
Comment 16 Eric Shattow 2004-10-13 18:33:46 UTC
gcc folks said it was not likely a gcc bug.   i'm not so sure about that, but they suggested using valgrind and some other tricks to get a better idea.  valgrind blew up, and refused to get farther than a "generic error" in libc.  for now, i think i've found a workaround;  it is ugly, doesn't make any sense, and if there is indeed some sort of problem with the Zyn code i would rather get the source of the problem solved.

closing this bug as CANTFIX because i have nfc how to find the memory problem in the code.   there's just too many "x-y-z" operator precedence assumptions where i do not know what the author intended, or why this code ever worked when compiled with gcc 3.4.2 anyways.
Comment 17 Eric Shattow 2004-10-13 19:59:23 UTC
according to the gcc guys on IRC, this is not a problem with gcc / glibc / kernel and parts of the official specifications not being real clear on how to do memory alignement for operator :: new.
Comment 18 Eric Shattow 2004-10-13 20:08:35 UTC
Created attachment 41778 [details]
IRC session, #gcc on OFTC

conversation, detailing how this is some kind of gcc/glibc related bug,
possibly an alignement issue.
Comment 19 Eric Shattow 2004-10-13 20:13:45 UTC
see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15795
Comment 20 Eric Shattow 2004-10-16 14:44:41 UTC
this is a gcc bug (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17990).  closing.