0
0

I’m recording with fmod on linux (ALSA, Ubuntu 5.04 and fmod 4.04.04).

If I close FMOD (FMOD_System_Close and Release) and init/open it again a few times, setting up the recorder each time, it eventually crashes with:

[code:7npwyrbw]

0 0xb6ffbb88 in __malloc_initialize_hook () from /lib/tls/i686/cmov/libc.so.6

1 0xb54264e9 in snd_pcm_poll_descriptors_revents () from /usr/lib/libasound.so.2

2 0xb54432bd in _snd_pcm_rate_open () from /usr/lib/libasound.so.2

3 0xb54264e9 in snd_pcm_poll_descriptors_revents () from /usr/lib/libasound.so.2

4 0xb5427cc9 in snd_pcm_wait_nocheck () from /usr/lib/libasound.so.2

5 0xb542e3ef in snd_pcm_wait () from /usr/lib/libasound.so.2

6 0xb542e9db in snd_pcm_read_areas () from /usr/lib/libasound.so.2

7 0xb5447b84 in snd_pcm_mmap_readi () from /usr/lib/libasound.so.2

8 0xb5426012 in snd_pcm_readi () from /usr/lib/libasound.so.2

9 0xb7de5032 in FMOD::OutputALSA::updateRecord () from fmod/api/lib/libfmodex.so

10 0xb7de4fe4 in FMOD::OutputALSA::updateRecord () from fmod/api/lib/libfmodex.so

11 0xb7de50a5 in FMOD::OutputALSA::recordThreadCallback () from fmod/api/lib/libfmodex.so

12 0x00000000 in ?? ()

13 0x00000000 in ?? ()

14 0x00000000 in ?? ()

15 0x00000000 in ?? ()

16 0x00000000 in ?? ()

17 0xb7e594f0 in ?? () from fmod/api/lib/libfmodex.so

18 0xb7ddfc37 in FMOD::Thread::callback () from fmod/api/lib/libfmodex.so

19 0xb7ddfc1c in FMOD::Thread::callback () from fmod/api/lib/libfmodex.so

20 0xb7211381 in start_thread () from /lib/tls/i686/cmov/libpthread.so.0

21 0xb6f98bfe in clone () from /lib/tls/i686/cmov/libc.so.6

[/code:7npwyrbw]

Is this a bug in FMOD, or am I doing something wrong?

  • You must to post comments
0
0

I made a small testcase based on the "recording" example:

[code:3dnaovf4]
/===============================================================================================
Crash example, built on "Record example"
Copyright (c), Firelight Technologies Pty, Ltd 2004-2005.
===============================================================================================
/

include "../../api/inc/fmod.hpp"

include "../../api/inc/fmod_errors.h"

include "../common/wincompat.h"

include <string.h>

void ERRCHECK(FMOD_RESULT result)
{
if (result != FMOD_OK) {
printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result));
exit(-1);
}
}

int main(int argc, char *argv[])
{
FMOD::System * system = 0;
FMOD::Sound * sound = 0;
FMOD_RESULT result;
FMOD_CREATESOUNDEXINFO exinfo;
unsigned int recordpos, version;
int i;

while (true) {

    result = FMOD::System_Create(&amp;system);
    ERRCHECK(result);

    result = system-&gt;getVersion(&amp;version);
    ERRCHECK(result);

    if (version &lt; FMOD_VERSION) {
        printf(&quot;Error!  You are using an old version of FMOD %08x.  This program requires %08x\n&quot;, version, FMOD_VERSION);
        return 0;
    }

    result = system-&gt;setOutput(FMOD_OUTPUTTYPE_ALSA);
    ERRCHECK(result);

    result = system-&gt;init(32, FMOD_INIT_NORMAL, 0);
    ERRCHECK(result);

    memset(&amp;exinfo, 0, sizeof(FMOD_CREATESOUNDEXINFO));

    exinfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO);
    exinfo.numchannels = 1;
    exinfo.format = FMOD_SOUND_FORMAT_PCM16;
    exinfo.defaultfrequency = 16000;
    exinfo.length = exinfo.defaultfrequency * sizeof(short) * exinfo.numchannels * 1;

    result = system-&gt;createSound(0, FMOD_2D | FMOD_SOFTWARE | FMOD_OPENUSER, &amp;exinfo, &amp;sound);
    ERRCHECK(result);

    result = system-&gt;recordStart(sound, true);
    ERRCHECK(result);

    for (i = 0; i &lt; 100; i++) {
        system-&gt;getRecordPosition(&amp;recordpos);
        ERRCHECK(result);
        printf(&quot;Record pos = %6d\r&quot;, recordpos);
        fflush(stdout);
        system-&gt;update();
        usleep(10000);
    }

    result = system-&gt;recordStop();
    ERRCHECK(result);

    printf(&quot;\n&quot;);

    result = sound-&gt;release();
    ERRCHECK(result);

    result = system-&gt;release();
    ERRCHECK(result);

}
return 0;

}
[/code:3dnaovf4]

This eventually crashes with:

[code:3dnaovf4]

0 0xb7b0b4c2 in snd_pcm_poll_descriptors_revents () from /usr/lib/libasound.so.2

1 0xb7b282bd in _snd_pcm_rate_open () from /usr/lib/libasound.so.2

2 0xb7b0b4e9 in snd_pcm_poll_descriptors_revents () from /usr/lib/libasound.so.2

3 0xb7b0ccc9 in snd_pcm_wait_nocheck () from /usr/lib/libasound.so.2

4 0xb7b133ef in snd_pcm_wait () from /usr/lib/libasound.so.2

5 0xb7b139db in snd_pcm_read_areas () from /usr/lib/libasound.so.2

6 0xb7b2cb84 in snd_pcm_mmap_readi () from /usr/lib/libasound.so.2

7 0xb7b0b012 in snd_pcm_readi () from /usr/lib/libasound.so.2

8 0xb7e6e032 in FMOD::OutputALSA::updateRecord () from ../../api/lib/libfmodex.so

9 0xb7e6dfe4 in FMOD::OutputALSA::updateRecord () from ../../api/lib/libfmodex.so

10 0xb7e6e0a5 in FMOD::OutputALSA::recordThreadCallback () from ../../api/lib/libfmodex.so

11 0x00000000 in ?? ()

12 0x00000000 in ?? ()

13 0x00000000 in ?? ()

14 0x00000000 in ?? ()

15 0x00000000 in ?? ()

16 0xb7ee24f0 in ?? () from ../../api/lib/libfmodex.so

17 0xb7e68c37 in FMOD::Thread::callback () from ../../api/lib/libfmodex.so

18 0xb7e68c1c in FMOD::Thread::callback () from ../../api/lib/libfmodex.so

19 0xb7cbb381 in start_thread () from /lib/tls/i686/cmov/libpthread.so.0

20 0xb7c50bfe in clone () from /lib/tls/i686/cmov/libc.so.6

[/code:3dnaovf4]

It has other crashpoints as well, which seem to mostly be in the malloc/calloc related functions.

  • You must to post comments
0
0

Hi,

Thanks for reporting this.

A fix will be in the next release.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.