From: Matt K. <ra...@ch...> - 2004-03-26 02:05:33
|
Perhaps this is a tad premature, but: Every time I run the latest and greatest build of JAZZ, when I perform a File -> Exit, it dumps core. There is a problem with some delete calls in jazz.cpp, which where shown by valgrind. I fixed those, but now I get a seg fault. Valgrind says: ==18348== valgrind's libpthread.so: KLUDGED call to: pthread_cond_destroy NumConfigNames: 66 ==18348== ==18348== Invalid read of size 4 ==18348== at 0x405B79B2: wxVariant::~wxVariant() (in /usr/X11R6/lib/libwx_gtk-2.4.so.0.0.0) ==18348== by 0x405BC2AF: __tcf_4 (in /usr/X11R6/lib/libwx_gtk-2.4.so.0.0.0) ==18348== by 0x408EAD89: __cxa_finalize (in /lib/libc.so.6) ==18348== by 0x40371061: (within /usr/X11R6/lib/libwx_gtk-2.4.so.0.0.0) ==18348== Address 0xFFFFFFF4 is not stack'd, malloc'd or free'd Segmentation fault (core dumped) I'm guessing this is being caused by a destructor in a global class which ends up calling the wxVariant destructor. But, it leaves no other trace. The gdb stack trace looks similar: (gdb) where #0 0x403c59b2 in wxVariant::~wxVariant() () from /usr/X11R6/lib/libwx_gtk-2.4.so.0 #1 0x403ca2b0 in __tcf_4 () from /usr/X11R6/lib/libwx_gtk-2.4.so.0 #2 0x40723d8a in __cxa_finalize () from /lib/libc.so.6 #3 0x4017f062 in __do_global_dtors_aux () from /usr/X11R6/lib/libwx_gtk-2.4.so.0 #4 0x40444bc6 in _fini () from /usr/X11R6/lib/libwx_gtk-2.4.so.0 #5 0x4000b9a0 in _dl_fini () from /lib/ld-linux.so.2 #6 0x40723b0f in exit () from /lib/libc.so.6 #7 0x4070d8b6 in __libc_start_main () from /lib/libc.so.6 This could be a bugger to find. Oh. I guess I meant to ask if anyone else is seeing this? The fix I put in for the delete problem is in jazz.cpp: diff -r1.6 jazz.cpp 274c274,275 < delete [] Names[i]; --- > if (Names[i]) > delete Names[i]; More in context: tConfig::~tConfig() { int i; for (i = 0; i < NumConfigNames; i++) { if (Names[i]) delete Names[i]; } } I'm also chasing an odd new/delete mismatch in track.cpp which is being caused by old code. I'll post the fix when I find it. Matt |
From: Matt K. <ra...@ch...> - 2004-03-26 02:40:14
|
Matt Kelly wrote: > Perhaps this is a tad premature, but: > > Every time I run the latest and greatest build of JAZZ, when I perform > a File -> Exit, it dumps core. > Replying to my own post... I found the source of the valgrind complaints. Bad use of 'delete'. In events.h: Line 546-ish: virtual ~tMetaEvent() { delete [] Data; } In track.cpp: diff -r1.4 track.cpp 1111,1116c1111,1116 < tJazzMeta jazz; < jazz.SetAudioMode(audio_mode); < jazz.SetTrackState(State); < jazz.SetTrackDevice(Device); < jazz.SetIntroLength(TheSong->GetIntroLength()); < jazz.Write(io); --- > tJazzMeta *jazz = new tJazzMeta; > jazz->SetAudioMode(audio_mode); > jazz->SetTrackState(State); > jazz->SetTrackDevice(Device); > jazz->SetIntroLength(TheSong->GetIntroLength()); > jazz->Write(io); In jazz.cpp -- the first one is in function tConfigEntry::~tConfigEntry(), and the second one is in tConfig::~tConfig(): diff -r1.6 jazz.cpp 101c101,102 < delete StrValue; --- > if (StrValue) > delete [] StrValue; 274c275,276 < delete [] Names[i]; --- > if (Names[i]) > delete Names[i]; Please apply these to the sources. Maybe I should have write access to the repository? Matt |
From: Patrick E. <pa...@pa...> - 2004-03-26 04:57:36
|
On Thursday 25 March 2004 22:38, Matt Kelly wrote: > Maybe I should have write access to the repository? Uh ya, sounds like a good idea. :) What's your SF id? There's 2.5 million Matt Kelly's. Patrick |
From: Matt K. <ra...@ch...> - 2004-03-26 17:45:02
|
> > On Thursday 25 March 2004 22:38, Matt Kelly wrote: > > Maybe I should have write access to the repository? > > Uh ya, sounds like a good idea. :) What's your SF id? There's 2.5 > million Matt Kelly's. 2,500,001 now. My ID is "mpkelly". Thanks, Matt |
From: Patrick E. <pa...@pa...> - 2004-03-27 06:46:59
|
Done. You now have the rights and responsibilities of a jazz developer. Just don't ask me what those are. ;) Patrick On Friday 26 March 2004 11:00, Matt Kelly wrote: > > On Thursday 25 March 2004 22:38, Matt Kelly wrote: > > > Maybe I should have write access to the repository? > > > > Uh ya, sounds like a good idea. :) What's your SF id? There's > > 2.5 million Matt Kelly's. > > 2,500,001 now. My ID is "mpkelly". > > Thanks, > > Matt > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO > of GenToo technologies. Learn everything from fundamentals to > system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=cli >ck _______________________________________________ > jazzplusplus-devel mailing list > jaz...@li... > https://lists.sourceforge.net/lists/listinfo/jazzplusplus-devel |
From: Dave F. <dav...@co...> - 2004-03-26 05:20:12
|
On Friday 26 March 2004 05:38 am, Matt Kelly wrote: > In events.h: > > Line 546-ish: > > virtual ~tMetaEvent() > { > delete [] Data; > } > > In track.cpp: > > diff -r1.4 track.cpp > 1111,1116c1111,1116 > < tJazzMeta jazz; > < jazz.SetAudioMode(audio_mode); > < jazz.SetTrackState(State); > < jazz.SetTrackDevice(Device); > < jazz.SetIntroLength(TheSong->GetIntroLength()); > < jazz.Write(io); > --- > > > tJazzMeta *jazz = new tJazzMeta; > > jazz->SetAudioMode(audio_mode); > > jazz->SetTrackState(State); > > jazz->SetTrackDevice(Device); > > jazz->SetIntroLength(TheSong->GetIntroLength()); > > jazz->Write(io); > > In jazz.cpp -- the first one is in function > tConfigEntry::~tConfigEntry(), and the second one is in > tConfig::~tConfig(): > > > diff -r1.6 jazz.cpp > 101c101,102 > < delete StrValue; > --- > > > if (StrValue) > > delete [] StrValue; > > 274c275,276 > < delete [] Names[i]; > --- > > > if (Names[i]) > > delete Names[i]; What type is Names? wxWidgets is supposed to clean itself up, and if tConfig is deleting wxWidgets stuff that the library is cleaning up itself, then that's what the problem is. In any case, it looks like tConfig was written before there was wxConfig, because it duplicates all of the function of wxConfig. Anybody willing to take a crack at rewriting tConfig to use wxConfig instead? It's sorta on the list of things to do.... ;) Dave > Please apply these to the sources. > > Maybe I should have write access to the repository? > > Matt > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > jazzplusplus-devel mailing list > jaz...@li... > https://lists.sourceforge.net/lists/listinfo/jazzplusplus-devel -- Visit my website! http://www.davefancella.com/?event=em Never try to outstubborn a cat. -- Lazarus Long, "Time Enough for Love" |
From: Matt K. <ra...@ch...> - 2004-03-26 17:40:40
|
> > diff -r1.6 jazz.cpp > > 101c101,102 > > < delete StrValue; > > --- > > > > > if (StrValue) > > > delete [] StrValue; > > > > 274c275,276 > > < delete [] Names[i]; > > --- > > > > > if (Names[i]) > > > delete Names[i]; > > What type is Names? wxWidgets is supposed to clean itself up, and if tConfig > is deleting wxWidgets stuff that the library is cleaning up itself, then > that's what the problem is. > > In any case, it looks like tConfig was written before there was wxConfig, > because it duplicates all of the function of wxConfig. Anybody willing to > take a crack at rewriting tConfig to use wxConfig instead? It's sorta on the > list of things to do.... ;) Names is a home-brewed class, not connected to anything wx. So, I don't think this is causing the core dump. Besides, I tried commenting out the deletion of Names, and it still dumps core. Matt |