Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000871 [Squeak] Sound major always 02-09-05 01:46 04-28-05 19:32
Reporter johnmci View Status public  
Assigned To
Priority normal Resolution open  
Status assigned   Product Version 3.9
Summary 0000871: unix sound plugin produces sharp noise under certain conditions.
Description I compiled sqUnixSoundMacOSX.c under the carbon VM and shipped as mac vm 3.8.6b5. Bert reported a problem of a sharp loud noise at various times. If for example draging an item out of the toolbox, then back in and hold the cursor down for extended periods while doing this. Dropping the item back in the toolbox does result in a beep (as expected).
Additional Information The Problem code is

static OSStatus bufferDataProc(AudioConverterRef inAudioConverter, UInt32 *ioDataSize, void **outData, void *context)
  Stream *s= (Stream *)context;
  Buffer *b= s->buffer;
  char *p1, *p2;
  int n1, n2;
  Buffer_getOutputPointers(b, &p1, &n1, &p2, &n2);
  if (!n1)
      static char empty[256];
      *ioDataSize= min(256, *ioDataSize);
      *outData= (void *)empty;
# if (DEBUG)
      putchar('-'); fflush(stdout);
# endif

where you attempt to pass back an address to a local storage area (perhaps on the stack) that is not been initialized to zero. This then is processed by coreaudio resulting in a loud unwanted sound.
Attached Files

- Relationships

- Notes
(0001141 - 511 - 747 - 747 - 747 - 747 - 747)
02-09-05 01:54

I'l will note I would like to assign to Ian, but he's not listed as a person in Mantis.

One solution would be to create a file variable (static) assign the first element to zero, the C standards say the other 255 elements will get filled with 0. The use that variable when passing back zeros to process.

char empty[256] = { 0 };

  if (!n1)
      *ioDataSize= min(256, *ioDataSize);
      *outData= (void *)empty;
# if (DEBUG)
      putchar('-'); fflush(stdout);
# endif


- Issue History
Date Modified Username Field Change
02-09-05 01:46 johnmci New Issue
02-09-05 01:50 johnmci Additional Information Updated
02-09-05 01:54 johnmci Note Added: 0001141
02-09-05 01:54 johnmci Assigned To  => andreas
02-09-05 01:54 johnmci Status new => assigned
02-09-05 01:54 johnmci Additional Information Updated
04-28-05 19:32 andreas Assigned To andreas =>

Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
39 total queries executed.
29 unique queries executed.
Powered by Mantis Bugtracker