[Cs-dev] Problems building QuteCsound
Date | 2009-12-01 21:16 |
From | Andy Fillebrown |
Subject | [Cs-dev] Problems building QuteCsound |
Attachments | None None |
I've been banging my head on the wall all day trying to build the next release of QuteCsound for Windows, but it's just not working. There's a mysterious crash occurring after a .csd is played internally, but it only shows itself when switching away from QuteCsound to another application, which is making it difficult to track down. The only debug info I have to work with is that user32.dll's GetDC is on the stack when it happens. Here's what I've been able to divine by compiling and recompiling different things... - Removing all calls to csoundDestroy makes the bug disappear. - Removing all csound callbacks does not make the bug disappear. - Removing everything from QuteCsound that updates the gui while Csound is playing does not make the bug disappear. From what I've read, it seems like it may be due to shared library issues between mingw and msvc, which makes me wonder if my assumptions about how the Csound 5.11 package is built are correct. With Csound 5.10 I was able to make able to use dlltool to make libcsound64-5.10.a to link against with mingw 3.4.5 because there was a csound64.def file included in the download. With Csound 5.11 there is no .def file -- so I made libcsound64-5.11.a by just using the csound64.def file from Csound 5.10. Maybe that's not ok to do, but I don't know for sure and it seems like that's not the problem since everything links without error. Also, the same crash occurs in my AudioCarver project and I link to Csound 5.11 at runtime in there, not during the build like in QuteCsound. Either way, it leads to the same crash in user32 GetDC. So that has me thinking it might be an msvcrt.dll issue ...so I replaced my system msvcrt.dll with the newer one in Csound 5.11 but it didn't help. I still get the same crash. Does anybody have any ideas on what the problem could be, or know a good way to figure these kinds of bugs out? Is it possible the bug is in Csound 5.11 itself and is only showing up in complex apps, or maybe there is something I'm doing on my end that's messing things up? Is it even possible to link to the Csound api from mingw 3.4.5? Regards, ~ andy.f |
Date | 2009-12-01 21:47 |
From | victor |
Subject | Re: [Cs-dev] Problems building QuteCsound |
Attachments | None None |
Maybe not a mingw thing. I am also continuing
getting these funny crashes when using MIDI on OSX. My feeling is also that
csoundDestroy is involved, but have not been able to trace where, why and
how.
What I have also observed is that if I try to close
qutecsound after a MIDI run, the application never exits (although the main
window does) and becomes a kind of a zombie. It seems to happen only when MIDI
is used.
Victor
|
Date | 2009-12-01 22:41 |
From | Andy Fillebrown |
Subject | Re: [Cs-dev] Problems building QuteCsound |
On Windows I'm only testing one run of toot1.csd which afaik is not doing anything with the MIDI ports. The window-switching crash happens as soon as csoundDestroy is called after that one run, though. Maybe something is going on with MIDI anyway? Is there a way to completely and reliably disable MIDI in Csound so I can tell if it's related? To me it feels like stack memory is being overwritten somewhere because there were a couple of times early this morning when gdb stopped in strange places in the main qutecsound class's member functions. I used to accidentally write past the end of my stack buffers all the time and it usually led to v-tables getting stomped on causing the debugger to stop in all kinds of strange places. How to find out for sure, though? I can reproduce the crash reliably, I just don't know how to debug it to track it down. Any ideas? Would having a debug version of Csound help? Can somebody build one for me? =) Cheers, ~ andy.f ----- Original Message ----- From: "victor" |
Date | 2009-12-01 22:54 |
From | victor |
Subject | Re: [Cs-dev] Problems building QuteCsound |
Can't you build your own Csound? It should be straightforward for you. ----- Original Message ----- From: "Andy Fillebrown" |
Date | 2009-12-01 23:02 |
From | Andy Fillebrown |
Subject | Re: [Cs-dev] Problems building QuteCsound |
Attachments | None None |
Yeah, it's probably time to take another crack at building it since it would probably take less time than testing guesses at this point. ----- Original Message ----- From: "victor" <Victor.Lazzarini@nuim.ie> To: "Developer discussions" <csound-devel@lists.sourceforge.net> Sent: Tuesday, December 1, 2009 5:54:03 PM (GMT-0500) America/New_York Subject: Re: [Cs-dev] Problems building QuteCsound Can't you build your own Csound? It should be straightforward for you. ----- Original Message ----- From: "Andy Fillebrown" <andy@audiosculptures.com> To: "Developer discussions" <csound-devel@lists.sourceforge.net> Sent: Tuesday, December 01, 2009 10:41 PM Subject: Re: [Cs-dev] Problems building QuteCsound > > > > On Windows I'm only testing one run of toot1.csd which afaik is not doing > anything with the MIDI ports. The window-switching crash happens as soon > as csoundDestroy is called after that one run, though. Maybe something is > going on with MIDI anyway? Is there a way to completely and reliably > disable MIDI in Csound so I can tell if it's related? > > To me it feels like stack memory is being overwritten somewhere because > there were a couple of times early this morning when gdb stopped in > strange places in the main qutecsound class's member functions. I used to > accidentally write past the end of my stack buffers all the time and it > usually led to v-tables getting stomped on causing the debugger to stop in > all kinds of strange places. How to find out for sure, though? I can > reproduce the crash reliably, I just don't know how to debug it to track > it down. Any ideas? Would having a debug version of Csound help? Can > somebody build one for me? =) > > Cheers, > ~ andy.f > > > > ----- Original Message ----- > From: "victor" <Victor.Lazzarini@nuim.ie> > To: "Developer discussions" <csound-devel@lists.sourceforge.net> > Sent: Tuesday, December 1, 2009 4:47:12 PM (GMT-0500) America/New_York > Subject: Re: [Cs-dev] Problems building QuteCsound > > > > Maybe not a mingw thing. I am also continuing getting these funny crashes > when using MIDI on OSX. My feeling is also that csoundDestroy is involved, > but have not been able to trace where, why and how. > What I have also observed is that if I try to close qutecsound after a > MIDI run, the application never exits (although the main window does) and > becomes a kind of a zombie. It seems to happen only when MIDI is used. > > Victor > > > ----- Original Message ----- > From: Andy Fillebrown > To: Csound-devel@lists.sourceforge.net > Sent: Tuesday, December 01, 2009 9:16 PM > Subject: [Cs-dev] Problems building QuteCsound > > I've been banging my head on the wall all day trying to build the next > release of QuteCsound for Windows, but it's just not working. There's a > mysterious crash occurring after a .csd is played internally, but it only > shows itself when switching away from QuteCsound to another application, > which is making it difficult to track down. The only debug info I have to > work with is that user32.dll's GetDC is on the stack when it happens. > Here's what I've been able to divine by compiling and recompiling > different things... > > - Removing all calls to csoundDestroy makes the bug disappear. > - Removing all csound callbacks does not make the bug disappear. > - Removing everything from QuteCsound that updates the gui while Csound is > playing does not make the bug disappear. > > From what I've read, it seems like it may be due to shared library issues > between mingw and msvc, which makes me wonder if my assumptions about how > the Csound 5.11 package is built are correct. With Csound 5.10 I was able > to make able to use dlltool to make libcsound64-5.10.a to link against > with mingw 3.4.5 because there was a csound64.def file included in the > download. With Csound 5.11 there is no .def file -- so I made > libcsound64-5.11.a by just using the csound64.def file from Csound 5.10. > Maybe that's not ok to do, but I don't know for sure and it seems like > that's not the problem since everything links without error. Also, the > same crash occurs in my AudioCarver project and I link to Csound 5.11 at > runtime in there, not during the build like in QuteCsound. Either way, it > leads to the same crash in user32 GetDC. So that has me thinking it might > be an msvcrt.dll issue ...so I replaced my system msvcrt.dll with the > newer one in Csound 5.11 but it didn't help. I still get the same crash. > > Does anybody have any ideas on what the problem could be, or know a good > way to figure these kinds of bugs out? Is it possible the bug is in Csound > 5.11 itself and is only showing up in complex apps, or maybe there is > something I'm doing on my end that's messing things up? Is it even > possible to link to the Csound api from mingw 3.4.5? > > Regards, > ~ andy.f > > > > > > > ------------------------------------------------------------------------------ > Join us December 9, 2009 for the Red Hat Virtual Experience, > a free event focused on virtualization and cloud computing. > Attend in-depth sessions from your desk. Your couch. Anywhere. > http://p.sf.net/sfu/redhat-sfdev2dev > > > > > _______________________________________________ > Csound-devel mailing list > Csound-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/csound-devel > > > ------------------------------------------------------------------------------ > Join us December 9, 2009 for the Red Hat Virtual Experience, > a free event focused on virtualization and cloud computing. > Attend in-depth sessions from your desk. Your couch. Anywhere. > http://p.sf.net/sfu/redhat-sfdev2dev > _______________________________________________ > Csound-devel mailing list > Csound-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/csound-devel > ------------------------------------------------------------------------------ Join us December 9, 2009 for the Red Hat Virtual Experience, a free event focused on virtualization and cloud computing. Attend in-depth sessions from your desk. Your couch. Anywhere. http://p.sf.net/sfu/redhat-sfdev2dev _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/csound-devel |
Date | 2009-12-02 10:03 |
From | Andres Cabrera |
Subject | Re: [Cs-dev] Problems building QuteCsound |
I would think that if you specify "none" as your rtmidi module, even though the module is loaded, it won't do much, so you should be able to discard that possibility. It would be strange if the rtmidi module was doing anything without actually being used, or am I wrong? Cheers, Andrés On Tue, Dec 1, 2009 at 11:02 PM, Andy Fillebrown |
Date | 2009-12-02 21:37 |
From | Davis Pyon |
Subject | Re: [Cs-dev] Problems building QuteCsound |
Could you try removing/deleting fluidOpcodes.dll from the plugins/plugins64 directory, then testing csoundDestroy? I had a similar problem with [csound~] and I'm wondering whether other programs that use the API suffer from the same problem. Thanks, DAvis ----- Original Message ---- > From: Andy Fillebrown |
Date | 2009-12-02 21:48 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] Problems building QuteCsound |
All programs use the API. I would have thought the problem would also appear in the csound command-line program (it calls csoundDestroy()). Victor On 2 Dec 2009, at 21:37, Davis Pyon wrote: > Could you try removing/deleting fluidOpcodes.dll from the plugins/ > plugins64 > directory, then testing csoundDestroy? > > I had a similar problem with [csound~] and I'm wondering whether > other programs > that use the API suffer from the same problem. > > Thanks, > > DAvis > > > > ----- Original Message ---- >> From: Andy Fillebrown |
Date | 2009-12-02 22:14 |
From | Davis Pyon |
Subject | Re: [Cs-dev] Problems building QuteCsound |
Yes, but not all of them have windows (or are plugged into programs that have windows). The problem I was experiencing was window related: the fluid code was creating a dummy window for DirectSound but never destroying it. If your program also creates windows, then there's a conflict. Davis ----- Original Message ---- > From: Victor Lazzarini |
Date | 2009-12-02 23:22 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] Problems building QuteCsound |
You mean windows as in graphics? So libfluidsynth is creating graphics, when it shouldn't really? Interesting to hear. I wonder if that is the case on OSX. By the way is that fixed at all? Victor On 2 Dec 2009, at 22:14, Davis Pyon wrote: > Yes, but not all of them have windows (or are plugged into programs > that have > windows). The problem I was experiencing was window related: the > fluid code was creating a dummy window for DirectSound but never > destroying it. If your program also creates windows, then there's a > conflict. > > Davis > > > > ----- Original Message ---- >> From: Victor Lazzarini |
Date | 2009-12-03 00:15 |
From | dp51 |
Subject | Re: [Cs-dev] Problems building QuteCsound |
Fluid doesn't do anything with the window except use the handle to initialize/use DirectSound, so it wouldn't affect OSX. I just downloaded QuteCsound 0.4.4 (nice work BTW) and tested it with/without fluidOpcodes.dll and it does make a difference. Hopefully, Andy Fillebrown can confirm. I also just downloaded fluidsynth-1.1.0.tar.gz and you can see the call to fluid_win32_create_window() in DllMain() in fluid_dll.c. I remember Michael Gogins modified his copy of fluid (at my request) for one of the Csound releases (5.09 I think), but the problem has returned in 5.11. Davis Victor Lazzarini wrote: > > You mean windows as in graphics? So libfluidsynth is creating > graphics, when it shouldn't really? Interesting to hear. I wonder if > that is the case on OSX. > > By the way is that fixed at all? > > Victor > > > On 2 Dec 2009, at 22:14, Davis Pyon wrote: > >> Yes, but not all of them have windows (or are plugged into programs >> that have >> windows). The problem I was experiencing was window related: the >> fluid code was creating a dummy window for DirectSound but never >> destroying it. If your program also creates windows, then there's a >> conflict. >> >> Davis >> >> >> >> ----- Original Message ---- >>> From: Victor Lazzarini |
Date | 2009-12-03 06:09 |
From | Andy Fillebrown |
Subject | Re: [Cs-dev] Problems building QuteCsound |
Excellent! Removing fluidOpcodes.dll works for both QuteCsound and AudioCarver! Thank you thank you. Cheers, ~ af ----- Original Message ----- From: "dp51" |
Date | 2009-12-03 19:09 |
From | Andy Fillebrown |
Subject | Re: [Cs-dev] Problems building QuteCsound |
More on this... Following the same train of thought that it's plugins causing the issues regarding the Windows clipboard in QuteCsound, I've discovered that removing virtual.dll and wigdets.dll makes the clipboard remain useable after calling csoundDestroy(). The windows clipboard only breaks in QuteCsound when virtual.dll or widgets.dll is present in the plugins directory. ~ andy.f ----- Original Message ----- From: "Andy Fillebrown" |
Date | 2009-12-03 21:30 |
From | Andy Fillebrown |
Subject | Re: [Cs-dev] Problems building QuteCsound |
Does anybody know of a way to programmatically prevent fluidOpcodes.dll, virtual.dll, and widgets.dll from loading automatically? ----- Original Message ----- From: "Andy Fillebrown" |
Date | 2009-12-03 21:39 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] Problems building QuteCsound |
I don't think there is one. A solution is make a private plugin directory containing only well behave plugins and set OPCODEDIR before compilation. Victor On 3 Dec 2009, at 21:30, Andy Fillebrown wrote: > > > > Does anybody know of a way to programmatically prevent > fluidOpcodes.dll, virtual.dll, and widgets.dll from loading > automatically? > > > > ----- Original Message ----- > From: "Andy Fillebrown" |
Date | 2009-12-03 21:43 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] Problems building QuteCsound |
Or, if you can stand the hackish solution: programmatically rename the files removing the .dll extension before compilation and restore them as your program exits! on Windows csound looks for the .dll extension. On 3 Dec 2009, at 21:39, Victor Lazzarini wrote: > I don't think there is one. A solution is make a private plugin > directory containing only well behave plugins and set OPCODEDIR before > compilation. > > Victor > > On 3 Dec 2009, at 21:30, Andy Fillebrown wrote: > >> >> >> >> Does anybody know of a way to programmatically prevent >> fluidOpcodes.dll, virtual.dll, and widgets.dll from loading >> automatically? >> >> >> >> ----- Original Message ----- >> From: "Andy Fillebrown" |
Date | 2009-12-03 21:54 |
From | Andy Fillebrown |
Subject | Re: [Cs-dev] Problems building QuteCsound |
That may work, but it's awful close to just packaging an entire release of Csound in with the QuteCsound installers. "Deploy the emergency Csound 5.11.2 release", I say!!! =) lol, ~ andy.f ----- Original Message ----- From: "Victor Lazzarini" |
Date | 2009-12-03 21:56 |
From | Andy Fillebrown |
Subject | Re: [Cs-dev] Problems building QuteCsound |
Oy, but if QuteCsound crashes then they won't get renamed back to the original. ----- Original Message ----- From: "Victor Lazzarini" |
Date | 2009-12-03 22:02 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] Problems building QuteCsound |
Another idea: set OPCODEDIR somewhere else, which will not load anything by default and then pass the good plugins via command-line option --opcode-lib=NAMES Dynamic libraries to load using their full path. Hackish but might work. Victor On 3 Dec 2009, at 21:56, Andy Fillebrown wrote: > > > > Oy, but if QuteCsound crashes then they won't get renamed back to > the original. > > > > ----- Original Message ----- > From: "Victor Lazzarini" |
Date | 2009-12-03 22:09 |
From | andy fillebrown |
Subject | Re: [Cs-dev] Problems building QuteCsound |
That's a much better solution, imo. Thank you for the idea! Cheers, ~ andy.f On Thu, Dec 3, 2009 at 5:02 PM, Victor Lazzarini |