Menu

#1 null pointer dereference when calling ProcOn

open
nobody
None
5
2012-12-05
2008-12-19
asomers
No

I am trying to open a 1-channel wave file, apply some gain, and play it using an SndThread in python. This all works when all of my sndobj library calls happen from the same python function. However, if I move the call to ProcOn to a different function, I get a bug. The order of the library calls is exactly the same; the only difference is the caller function.

The bug is that I get no audio output, and the SndThread prints a stream of numbers very rapidly to the screen. Usually they are all 0, but slight variations of the program will produce integers or floats instead. When I kill the program with ctrl-C, Windows pops up an error message telling me that the program tried to reference memory at 0x00000000 . Other slight code variations have caused the null dereference to happen before the stream of zeros, or the address be 0x00000004 instead of null.

My platform is windows xp 32 bit, python 2.5.1 . I can't find a version number in my sndobj files, but I downloaded them on July-14-2008, which I think is the latest release.

I've attached the test case and a test wave file. However, the problem happens identically with at least one other wave file.

Two interesting variatons on the test case:
1) uncomment line 30 and comment line 36. Now the program runs successfully, but there is no audio output.

2) Do the above, and also uncomment lines 31-32 and comment line 39. Now the program is nondeterministic. Sometimes it runs correctly with audio output, sometimes with no audio output, and sometimes i get the stream of zeros and the null pointer dereference.

Discussion

  • asomers

    asomers - 2008-12-19

    test case

     
  • asomers

    asomers - 2008-12-19

    wave file to use with the test case

     
  • asomers

    asomers - 2008-12-19

    Attached the test case's wave file.
    File Added: 1chan-normalized.wav

     
  • Nobody/Anonymous

    I have reproduced this bug on linux. I'm running Ubuntu hardy heron i686, python 2.5.1, and SndObj-2.6.6 . My sound interface is an Echo Gina3G. I changed the test case to use SndRTIO (with ALSA). When I run ProcOn_bug_linux.py, I get a segfault and no audio. Same thing when I run variation 1. With variation 2, I get audio and then a segfault after the sleep().

     
  • asomers

    asomers - 2009-01-17

    test case for linux

     
  • asomers

    asomers - 2009-01-17

    File Added: ProcOn_bug_linux.py