public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* ioctl crash in mpg123
@ 2014-05-02 11:16 JonY
  2014-05-02 15:15 ` Christopher Faylor
  0 siblings, 1 reply; 3+ messages in thread
From: JonY @ 2014-05-02 11:16 UTC (permalink / raw)
  To: The Cygwin Mailing List

[-- Attachment #1: Type: text/plain, Size: 681 bytes --]

Hi,

I am debugging a crash in Cygwin 1.7.29-2 ioctl but I am not familiar
with the OSS sounds API. I traced the ioctl calls and made this example,
is it supposed to work?

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/soundcard.h>

int main(){
  int fmt = AFMT_MU_LAW;
  int chan = 0;
  int fd = open("/dev/dsp", O_WRONLY);
  ioctl(fd, SNDCTL_DSP_RESET, NULL);
  ioctl(fd, SNDCTL_DSP_RESET, NULL);
  ioctl(fd, SNDCTL_DSP_RESET, NULL);
  ioctl(fd, SNDCTL_DSP_SETFMT, &fmt);
  ioctl(fd, SNDCTL_DSP_STEREO, &chan); /* crashes here */
  close(fd);
  exit(0);
}


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 834 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ioctl crash in mpg123
  2014-05-02 11:16 ioctl crash in mpg123 JonY
@ 2014-05-02 15:15 ` Christopher Faylor
  2014-05-03  0:14   ` JonY
  0 siblings, 1 reply; 3+ messages in thread
From: Christopher Faylor @ 2014-05-02 15:15 UTC (permalink / raw)
  To: cygwin

On Fri, May 02, 2014 at 07:16:25PM +0800, JonY wrote:
>Hi,
>
>I am debugging a crash in Cygwin 1.7.29-2 ioctl but I am not familiar
>with the OSS sounds API. I traced the ioctl calls and made this example,
>is it supposed to work?

If you're asking if Cygwin is supposed to SEGV in certain situations the
answer is "no".

This should be fixed in the next snapshot.

Thanks for the test case.

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ioctl crash in mpg123
  2014-05-02 15:15 ` Christopher Faylor
@ 2014-05-03  0:14   ` JonY
  0 siblings, 0 replies; 3+ messages in thread
From: JonY @ 2014-05-03  0:14 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 530 bytes --]

On 5/2/2014 23:15, Christopher Faylor wrote:
> On Fri, May 02, 2014 at 07:16:25PM +0800, JonY wrote:
>> Hi,
>>
>> I am debugging a crash in Cygwin 1.7.29-2 ioctl but I am not familiar
>> with the OSS sounds API. I traced the ioctl calls and made this example,
>> is it supposed to work?
> 
> If you're asking if Cygwin is supposed to SEGV in certain situations the
> answer is "no".
> 
> This should be fixed in the next snapshot.
> 
> Thanks for the test case.
> 
> cgf
> 

Thanks for fixing this quickly!



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 834 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-05-03  0:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-02 11:16 ioctl crash in mpg123 JonY
2014-05-02 15:15 ` Christopher Faylor
2014-05-03  0:14   ` JonY

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).