Re: Evil in Http.cpp? HELP!

2000-09-21 Thread Chris Kuklewicz

I need help diagnosing this segfault.  Because I have failed.
It is clockwork reproducible.

Does anyone else (in unix / linux) have the same segfault after
opening the streams tree in the music browser?

I think something is compiling / linking / loading wrong.  I notice
that when I touch Http.cpp, that the Http.o and freeamp executable and
plugins/musicbrowser.ui and plugins/freeamp.ui are re-compiled.

When I add output to this function:

int Http::WriteToBuffer(unsigned char *buffer, unsigned int size)
{
cerr  "WriteToBuffer "  size  endl  flush;
if (m_buffer == NULL)
{
_you_are_here;
m_bufferSize = kBufferSize;
m_buffer = new unsigned char[m_bufferSize];
}
_show_args1(m_buffer);
...
...
return size;
}

That it does NOT output any message.  This function is called from
this sequence in Download (line numbers for me in left column):

483: _show_args1(wcount);
484: _show_args3(m_bufferSize,m_bytesInBuffer,m_buffer);
485: wcount = this-Http::WriteToBuffer((unsigned char *)cp,
486:   total - (cp-buffer));
487: _show_args1(wcount);
488: _show_args3(m_bufferSize,m_bytesInBuffer,m_buffer);

This does produce output:

@ lib/http/src/Http.cpp : 483 : enum Error Http::Download(const class string , bool)
args: wcount=0
@ lib/http/src/Http.cpp : 484 : enum Error Http::Download(const class string , bool)
args: m_bufferSize=0, m_bytesInBuffer=0, m_buffer=(null)
@ lib/http/src/Http.cpp : 487 : enum Error Http::Download(const class string , bool)
args: wcount=1804
@ lib/http/src/Http.cpp : 488 : enum Error Http::Download(const class string , bool)
args: m_bufferSize=1804, m_bytesInBuffer=0, m_buffer=
[2]+  Segmentation fault  /opt/freeamp-mine/bin/freeamp

So even though the WriteToBuffer does not seems to execute the output
to cerr, it does change m_buffer and return size to wcount.  I cannot
trace this in gdb, I set a breakpoint on Http::Download but it passed
right over it.

I am guessing my dificulty may lie in the way plugins are loaded and
symbols are resolved?  Is gdb setting a breakpoint in freeamp's version
of Http.o and not seeing the one in musicbrowser.ui?

I still do not understand how musicbrowser.ui writes to cerr in
Download but not in WriteToBuffer.

I am out of ideas.
I am attaching the header file that defines the macros I am using,
for completeness, and my copy of Http.cpp.

I am running RH 6.2/HelixGnome with gcc 2.91.66
The make output from touching Http.cpp is 

[1525|ckuklewicz /usr/local/src/freeamp/freeamp-mine]$ make
for p in base base/beos base/beos/src base/src base/unix base/unix/src  dlm dlm/rmp io 
io/alsa io/alsa/unix io/alsa/unix/linux io/alsa/unix/linux/src io/esound io/esound/src 
io/http io/local io/obs io/src io/soundcard io/soundcard/beos io/soundcard/unix 
io/soundcard/beos io/soundcard/unix/linux  io/soundcard/unix/linux/src 
io/soundcard/beos/src io/soundcard/unix/linux/src  io/wavout io/wavout/src 
io/wavout/include io/signature lib lib/xml lib/xml/src lib/http lib/http/src lib/zlib 
lmc lmc/xingmp3 lmc/xingmp3/src lib/gdbm lib/zlib/src lmc/vorbis  plm plm/metadata 
plm/playlist plm/portable plm/portable/pmp300 lmc/xingmp3/src plm/metadata/id3v1 
plm/metadata/id3v2  plm/metadata/misc plm/playlist/m3u plm/portable/pmp300/sba ui 
ui/download ui/download/unix ui/freeamp ui/freeamp/beos  ui/cmdline 
ui/download/unix/src ui/freeamp/beos/src  ui/freeamp/tools ui/freeamp/unix ui/irman 
ui/lcd ui/musicbrowser ui/freeamp/src ui/freeamp/tools/src ui/freeamp/unix/src 
ui/musicbrowser/src ui/musicbrowser/unix ui/mpg123 plm/playlist/pls ui/irman/src 
ui/lcd/src ui/musicbrowser/unix/src ui/ncurses update update/unix lmc/cd lmc/cd/src 
io/cd io/cd/unix  io/cd/unix/src lib/unzip lib/unzip/src ftc ftc/kjofol ftc/winamp 
plm/metadata/cddb base/aps lmc/vorbis/src io/signature/src lib/musicbrainz 
lib/musicbrainz/expat lib/musicbrainz/expat/xmlparse lib/musicbrainz/expat/xmltok 
lib/musicbrainz/osdep lib/musicbrainz/lib; do \
  test -d $p || mkdir $p; \
done
c++ -I. -I. -I./config -DUNIX_LIBDIR=\"/opt/freeamp-mine//lib\" -Dlinux -I. 
-I./lib/gdbm -I./base/include -I./config -I./io/include -I./ui/include -I./lmc/include 
-I./base/unix/include -I./base/unix/linux/include -I./io/esound/include 
-I./ui/musicbrowser/unix/include -I./ui/freeamp/include -I./ui/freeamp/unix/include 
-I./ui/download/unix/include -I./ui/musicbrowser/include -I./ftc/kjofol 
-I./io/soundcard/unix/linux/include -I./lmc/xingmp3/include -I./lmc/cd/include 
-I./plm/portable/pmp300/sba -I./lib/xml/include -I./lib/zlib/include 
-I./lib/unzip/include -I./io/cd/unix/include -I./base/aps -I./io/wavout/include 
-I./ui/lcd/include -I./ui/irman/include -I./lib/http/include -I./io/signature/include 
-I./lib/musicbrainz/lib -I./lib/musicbrainz/expat/xmltok 
-I./lib/musicbrainz/expat/xmlparse -I./lmc/vorbis/include -Wall -g -O0 
-I/usr/lib/glib/include -I/usr/X11R6/include -I/usr/lib/glib/include 
-I/usr/X11R6/include -D_REENTRANT

Re: Evil in Http.cpp? HELP!

2000-09-21 Thread Isaac Richards

Could you upgrade mb_client from CVS and see if that fixes it?

Isaac

On 21-Sep-2000 Chris Kuklewicz wrote:
 I need help diagnosing this segfault.  Because I have failed.
 It is clockwork reproducible.
 
___
[EMAIL PROTECTED]
http://www.freeamp.org/mailman/listinfo/freeamp-dev



Re: Evil in Http.cpp? HELP!

2000-09-21 Thread rob

On 21 Sep, Isaac Richards wrote:
 Could you upgrade mb_client from CVS and see if that fixes it?

I've got all the latest and greatest and the crash happens for me as
well


--ruaok Freezerburn! All else is only icing. -- Soul Coughing

Robert Kaye -- [EMAIL PROTECTED]  http://moon.eorbit.net/~robert

___
[EMAIL PROTECTED]
http://www.freeamp.org/mailman/listinfo/freeamp-dev



Re: Evil in Http.cpp? HELP!

2000-09-21 Thread rob

On 21 Sep, Isaac Richards wrote:
 
 On 21-Sep-2000 [EMAIL PROTECTED] wrote:
 I've got all the latest and greatest and the crash happens for me as
 well
 
 Positive about that?  Problem was the Http class in libmusicbrainz was clashing
 w/ the Http class in freeamp..  Renamed it to MBHttp and the problem went away
 here.

Nope. I had the latest and greatest, but it was not installed. :-|


--ruaok Freezerburn! All else is only icing. -- Soul Coughing

Robert Kaye -- [EMAIL PROTECTED]  http://moon.eorbit.net/~robert

___
[EMAIL PROTECTED]
http://www.freeamp.org/mailman/listinfo/freeamp-dev



Re: Evil in Http.cpp? HELP!

2000-09-21 Thread rob

On 21 Sep, Chris Kuklewicz wrote:

 Use namespaces.
 
 C++ has even more flexible namespaces than Java.
 
 You library code become more legible since your library can call MB::Http as Http.
 People using the library get to only pull in what they want to into their namespace.
 
 Since this library is still "alpha" cvs only code, such a change should be possible.

You're totally right -- I will make this change.


--ruaok Freezerburn! All else is only icing. -- Soul Coughing

Robert Kaye -- [EMAIL PROTECTED]  http://moon.eorbit.net/~robert

___
[EMAIL PROTECTED]
http://www.freeamp.org/mailman/listinfo/freeamp-dev



Re: Evil in Http.cpp? HELP!

2000-09-21 Thread rob

On 21 Sep, Isaac Richards wrote:
 Only problem is that namespaces don't work with current versions of g++.

Yea. They don't work at all? Where can I find some details on this?


--ruaok Freezerburn! All else is only icing. -- Soul Coughing

Robert Kaye -- [EMAIL PROTECTED]  http://moon.eorbit.net/~robert

___
[EMAIL PROTECTED]
http://www.freeamp.org/mailman/listinfo/freeamp-dev



Re: Evil in Http.cpp? HELP!

2000-09-21 Thread Chris Kuklewicz

On Thu, Sep 21, 2000 at 11:41:19AM -0700, [EMAIL PROTECTED] wrote:
 On 21 Sep, Isaac Richards wrote:
  Only problem is that namespaces don't work with current versions of g++.
 
 Yea. They don't work at all? Where can I find some details on this?
 
 

Wellit depends on the definition of "current".

Look at http://gcc.gnu.org/releases.html

Redhat 6.2 is build using the egcs-1.1.2 with gcc version 2.91.66
My C++ code on RH6.2 handles almost all namespace / using commands.

Redhat rawhide (and I assume pinstripe, expected to be released
as RH7.0 on monday) uses gcc 2.95.2

But...back when I had RH 5.2 the compiler did not handle namespaces.
I think RH5.2 had egcs 1.0.3a with gcc 2.90.xx
___
[EMAIL PROTECTED]
http://www.freeamp.org/mailman/listinfo/freeamp-dev