Skip to content

Random "Index Out of range" crash in FloatPlot #69

Open

Description

@lucarocchi

macOS Version(s) Used to Build

macOS 13 Ventura, macOS 12 Monterey

Xcode Version(s)

Xcode 14

Description

I'm working on an iOS app that uses NodeOutputView
Randomly I get this "Index Out of range" as you can see in the screen shot

Crash Logs, Screenshots or Other Attachments (if applicable)

Screenshot 2022-12-10 alle 19 24 32

Screenshot 2022-12-07 alle 17 41 54

Activity

  1. NickCulbertson commented on Dec 11, 2022

    @NickCulbertson
    Member

    My guess would be that samples[j + 1] is out of range. It would be helpful to put

    print("samples")
    print(samples.count)
    print(j+i)
    print("resampled")
    print(resampled.count)
    print(i)
    

    before that line to see if that is the crash. Can you make a simple example project to recreate the issue?

  2. NickCulbertson commented on Dec 11, 2022

    @NickCulbertson
    Member

    samples[min(j + 1, samples.count)] might work if the index is too high, but I'm not really sure what that line is doing.

  3. emurray2 commented on Jan 3, 2023

    @emurray2
    Member
    Quoted reply

    macOS Version(s) Used to Build

    macOS 13 Ventura, macOS 12 Monterey

    Xcode Version(s)

    Xcode 14

    Description

    I'm working on an iOS app that uses NodeOutputView
    Randomly I get this "Index Out of range" as you can see in the screen shot

    Crash Logs, Screenshots or Other Attachments (if applicable)

    Screenshot 2022-12-10 alle 19 24 32 Screenshot 2022-12-07 alle 17 41 54
    It's difficult to debug this without knowing the size of `bufferSampleCount`, but everything else looks fine.

    Try following the stack trace in the debugger. Xcode will show the error on every instruction leading up to where the error actually occurred.

    If you can pin it down to happening on a line of code involving NodeOutputView, I also recommend writing an example to demonstrate the bug as Nick mentioned.

    Edit: Looking at this with a fresh set of eyes, now I can see how this involves FloatPlot on line 115. Going to see if I can investigate further when I get another chance. Where are the samples coming from? I'm guessing some sort of Node?

  4. changed the title [-]Random "Index Out of range" crash in NodeOutputView[/-] [+]Random "Index Out of range" crash in FloatPlot[/+] on Jan 4, 2023
  5. JonL-iOS commented on Jan 6, 2023

    @JonL-iOS

    I have experienced this bug as well. I use NodeOutputView, and sometimes it would crash with an error similar to the above.

    @emurray2, I saw you asking about buffer size...I noticed that for NodeOutputView, the default buffer is 1024. I had been using a buffer of 150. I'm still testing, but so far It seems that changing the buffer to 1024 has eliminated the crashes.

  6. lucarocchi commented on Jan 6, 2023

    @lucarocchi
    Author

    I don't think buffer size matters i have experienced it also with default buffer size or 2048

  7. emurray2 commented on Jan 6, 2023

    @emurray2
    Member

    I don't think buffer size matters i have experienced it also with default buffer size or 2048

    What I've noticed when I got this error is the node I was using was not stereo, and I was trying to access a buffer which was not there.

    You may want to double check the node format or wherever the data inside FloatPlot is coming from.

    But definitely make an example project if you can with 1 node and the FloatPlot demonstrating the bug. You could even try using different nodes and see if you get the same effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions