gcc-2.96 causes trouble (was: Re: segfault backtrace)

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: gcc-2.96 causes trouble (was: Re: segfault backtrace)
From: Kai Vehmanen (k_AT_eca.cx)
Date: Sat Oct 26 2002 - 19:22:38 EEST

On Wed, 16 Oct 2002, Mario Lang wrote:

>>> #1 0x4041ead9 in kvu_remove_surrounding_spaces (a=@0xbfffea04)
>>> at /usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/std/bastring.h:229
>>> #2 0x4021c445 in RESOURCE_FILE::load (this=0xbfffedb4) at resource-file.cpp:60

It seems that this problem is specific to the gcc-2.96 compiler
that comes with redhat-7.x distros. I just tried compiling
ecasound with gcc-2.96-100 and then running 'make check'
in ecasound/libecasound. It crashes at random points almost on every
run, and always inside the libstdc++ (ie. the C++ standard library).
My current best guess is that gcc-2.96 simply miscompiles ecasound
or there is a serious resource management problem in the libstdc++
version that is shipped with 2.96-100.

If you have some version of gcc-2.96 installed, could you try the test
I've described above. You should run 'make check' at least a few times.

Previously I was using egcs-1.12 (also known as gcc-2.91.66) and
never saw this type of problems. Also, I'm now using gcc-3.2, and
it also works fine.

>> The problem is that in all the bug scenarios I've traced, ecasound doesn't
>> really do anything wrong. The libstdc++ just crashes... :(
> In other words, C++ is not only heavily complicated, but also
> unstable. wow :).

Well, these kinds of seemingly random errors are actually quite
rare. But I admit that C++ is far from an ideal language.
Complex language and libraries, lack of standard ABI, lack of
standard compliant compilers and runtimes, slow compilation, ...
and the list goes on.

But still, C++ has a few qualities that are really difficult to beat: 1)
it doesn't hide anything from the programmer (you can go as low-level as
you like if you need -> this is extremely important for programs like
ecasound), 2) there's no hidden overhead, 3) many features that help
large-scale development (OO, generic programming, namespaces) and 4) C++
standard covers most of the little things that are missing from C (string
handling, lists, vectors, associative maps and so forth).

I've written non-trivial programs in for instance C, Eiffel, Java and
Python, so I'm not a C++-only man. :) But when it comes to ecasound, I
couldn't imagine using anything else than C++. C is possibly the best
alternative, but that would require so much more code that I'm not sure
whether I could maintain it all by myself.

 Audio software for Linux!

New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Sat Oct 26 2002 - 19:24:40 EEST