Memory problem in winelib apps?

Mark Knecht markknecht at gmail.com
Wed Jun 22 10:53:16 CDT 2005


Walt,
   (Probably not copied to wine-devel as I'm not subscribed. Pass it
on if you see fit.)

   I haven't played much with this lately, however when I was using it
I saw no real indication that the revision of Jack made any
difference. IIRC I debugged the fix we did down to a certain (huge!)
set of memory management modifications made to Wine all on one day.
Before that set of edits jack_fst worked fine. After that set it never
worked again without your hack to jack_fst. That said I updated Jack
many times after that, probably up through the end of 2004, and never
saw this problem again when using the hack. Since the first of the
year I've hardly touched it and cannot say anything about it at this
time.

   I'm wondering if Chris's note about Jack not working under Wine was
spurred on by my conversations with him a few months ago when I was
getting iTunes working. I tried using Jack with Wine and it didn't
work for me so I contacted Chris but hadn't heard much back since
those conversations.

   Anyway, I think those two (jack_fst and Wine/Jack) are sort of
orthogonal in my mind. I'm not sure the have much to do with each
other but I could be wrong about that. I've tried many times over the
last 2 years to get Wine and Jack to work together and have never been
successful, but jack_fst did work when Jack itself didn't.

   Go figure... ;-)

   If I can be of some help in this let me know.

Cheers,
Mark

On 6/21/05, Walt Ogburn <reuben at ugcs.caltech.edu> wrote:
> Thanks Chris.  Mark, do you see the problem go away with a later Jack
> version?  I was just trying to see if I could understand better what was
> going on when we were trying to get this working last year.
> 
> - Walter
> 
> 
> 
> On Tue, 21 Jun 2005, Chris Morgan wrote:
> 
> > This should have been fixed in jack around 20040325 with a jack to the jack
> > variable, JACK_THREAD_STACK_TOUCH.  The value was changed from 1048576
> > (#define BIG_ENOUGH_STACK in client.c:jack_activate():1033 or so) and moved
> > into configure.in.
> >
> > The change was made in this rev of configure.in:
> > ----------------------------
> > revision 1.253
> > date: 2004/03/26 04:41:57;  author: joq;  state: Exp;  lines: +17 -4
> > [0.96.1] config fixes for shm; stack touch
> > ----------------------------
> >
> > The reason jack does this is to ensure that all pages of the shared memory for
> > all jack clients is mapped so there are no delays during excution.  The value
> > was reduced because wine was taking up a bunch of the stack and jack/wine
> > were crashing.
> >
> > Which version of jack are you using?  Which version of wine?
> >
> > The last time I tried jack under wine it didn't work but I wasn't able to
> > figure out why this time and haven't gone back to it in a few months.
> >
> > Chris
> >
> >
> >
> >
> > On Tuesday 21 June 2005 10:02 pm, Alex Villací­s Lasso wrote:
> > > Walt Ogburn wrote:
> > > >Hi developers,
> > > >
> > > >I'm trying to understand why the following simple program crashes.  I
> > > >think this is the same problem that prevents jack_fst from running with
> > > >the current version of wine.  (Jack_fst allows a lot of programs called
> > > >VSTs to be run, for audio work).
> > > >
> > > >I compiled this with:
> > > >>winemaker .
> > > >>make
> > > >
> > > >and ran it with:
> > > >>wine membug.exe.so
> > > >
> > > >If BUFSIZE is 1044097, there's an error like this:
> > > >err:seh:setup_exception stack overflow 12 bytes in thread 0009 eip
> > > > 4057426f esp 40580ff4 stack 0x40580000-0x40680000
> > > >
> > > >If BUFSIZE is 1044096 or lower, there's no error.  If BUFSIZE is much
> > > >higher (like 2000000), there's a segfault.
> > > >
> > > >All the program does is define a character array of size BUFSIZE and
> > > >scribble in it to make sure it really gets allocated.  Maybe this simple
> > > >example will show how to make jack_fst work.
> > > >
> > > >Thanks,
> > > >Walter
> > > >
> > > >------------------------------------------------------------------------
> > > >
> > > >#include "windows.h"
> > > >
> > > >#define BUFSIZE 1044096
> > > >/* #define BUFSIZE 2000000 */
> > > >
> > > >int PASCAL WinMain (HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int
> > > > show) {
> > > >   char buf[BUFSIZE];
> > > >   int i;
> > > >
> > > >   for (i=0; i<BUFSIZE; i++)
> > > >   {
> > > >      buf[i] = (char) (i % 256);
> > > >   }
> > > >
> > > >   return 0;
> > > >}
> > >
> > > Your sample program is trying to use almost 1 megabyte (!) of stack
> > > space. No wonder it crashes. Are you sure that your program jack_fst is
> > > trying to allocate such an enormous amount of stack space? Most (sane)
> > > programs would just declare a pointer and allocate the required space
> > > via malloc() or HeapAlloc().
> > >
> > > Where can somebody else get a copy of jack_fst? Is there a public
> > > download somewhere?
> > > Maybe jack_fst corrupts the stack in some strange way that was
> > > misdiagnosed as as request for a 1Mb stack?
> >
> >
>




More information about the wine-devel mailing list