I likes the version of Freeamp I just tried (2.1beta8), but it would
segfault in a matter of minutes. I would like to spend some time
tracking these down, so I got the CVS version and compiled it.
But I got stuck. I have written and debugged my own simple C++
multithreaded gnome-- application (Mmmm..deadlocks), but I still got
stuck. The observer effect produced wildly different problems when
running under gdb vs normal execution. The gory details are below.
If anyone can get me started on debugging, then I really will track
down the crashes. So here are the details:
It needs an rpm for id3lib-devel, of course, so I grabbed the official
id3lib rpms from sourceforge. The binary i386 were compiled with what
I think of the "rawhide" 2.96 version of gcc, where I still have the
RH6.2 version: "gcc --version" gives egcs-2.91.66
So I had to rpm --rebuild the id3lib src.rpm....but it failed, until
I took out the "-mpreferred-stack-boundary=2":
[root@kuklewicz SPECS]# diff id3lib.spec~ id3lib.spec
87c87
< RPM_OPT_FLAGS="-O3 -fomit-frame-pointer -pipe -s -mcpu=$ID3_ARCH -march=$ID3_ARCH
-ffast-math -fexpensive-optimizations -malign-loops=2 -malign-jumps=2
-malign-functions=2 -mpreferred-stack-boundary=2"
---
> RPM_OPT_FLAGS="-O3 -fomit-frame-pointer -pipe -s -mcpu=$ID3_ARCH -march=$ID3_ARCH
>-ffast-math -fexpensive-optimizations -malign-loops=2 -malign-jumps=2
>-malign-functions=2"
For the record, I only have Pentium 233/MMX on hand right now, the
spec file used ID#_ARCH=i486. Once id3lib was rebuilt and installed,
freeamp configure/make/install went well.
Simply running freeamp produced my first Segfault to track down:
1) It asked about default file associations, where I clicked "No"
2) The main freeamp window appeared, "Welcome to FreeAmp!"
3) I clicked the close button in the corner
4) The window disappeared.
5) "Segmentation fault" was printed on the terminal.
Now try gdb
[root@kuklewicz bin]# gdb ./freeamp
GNU gdb 5.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
(gdb) run
Starting program: /opt/freeamp-cvs/bin/./freeamp
[New Thread 1024 (runnable)]
[New Thread 2049 (runnable)]
[New Thread 1026 (runnable)]
[New Thread 2051 (runnable)]
[New Thread 3076 (runnable)]
[New Thread 4101 (runnable)]
[New Thread 5126 (runnable)]
[New Thread 6151 (runnable)]
Program received signal SIGTRAP, Trace/breakpoint trap.
[Switching to Thread 6151 (runnable)]
__default_alloc_template<true, 0>::refill (n=???) at /usr/include/g++-2/stl_alloc.h:514
514 {
(gdb) bt
#0 __default_alloc_template<true, 0>::refill (n=???) at
/usr/include/g++-2/stl_alloc.h:514
This is after I dismiss the file association dialog and the main
freeamp window is visible ("Welcome to FreeAmp!"). There is no useful
back trace with this thread (using my gdb 5.0). A more confusing thing
happens next:
(gdb) list
510 /* We assume that n is properly aligned. */
511 /* We hold the allocation lock. */
512 template <bool threads, int inst>
513 void* __default_alloc_template<threads, inst>::refill(size_t n)
514 {
515 int nobjs = 20;
516 char * chunk = chunk_alloc(n, nobjs);
517 obj * __VOLATILE * my_free_list;
518 obj * result;
519 obj * current_obj, * next_obj;
(gdb) n
Program received signal SIGILL, Illegal instruction.
__default_alloc_template<true, 0>::refill (n=???) at /usr/include/g++-2/stl_alloc.h:514
514 {
(gdb) n
Program terminated with signal SIGILL, Illegal instruction.
The program no longer exists.
And so the "We assume n is properly aligned" bothers me. Perhaps this
is an id3lib problem created by removing the compiler option
"-mpreferred-stack-boundary=2". But the id3lib-examples command line
programs do not seem to segfault. So I get a different crash when
running under gdb, which effectively prevents me from doing *anything*
under gdb.
Any advice on understanding this SIGTRAP/SIGILL? Or should I use another
debugging technique (e.g. "printf and/or cerr <<" everywhere).
I looked into doing an easy upgrade to egcs 2.96 with the rawhide src
and i386 rpms, but the dependency requirements bleed over to rpm v4,
and tcltk, and bzip2. And from there to most of my system! Attempts
to see a clean upgrade path using -ivh and rebuilding from src rpms
has yet to yield success. Any advice on the easiest way to "get from
here (egcs 2.91) to there (egcs 2.96)" ?
Last question: I did not happen to --enable-mutex-debug or
--enable-dmalloc. What would your recommendations be for options for
./configure for trying to track down the crashes?
--
Chris Kuklewicz
_______________________________________________
[EMAIL PROTECTED]
http://www.freeamp.org/mailman/listinfo/freeamp-dev