1

Does anybody know why I get a SIGSEGV as soons as the superpoweredReverb object gets deleted?

int size = 3056;
SuperpoweredReverb* superpoweredReverb = new SuperpoweredReverb(44100);
superpoweredReverb->enable(true);
float* buffer = new float[size * 2];
superpoweredReverb->process(buffer, buffer, size);
delete(superpoweredReverb); // <-- error SIGSEGV
delete[](buffer);

If size is 16, 32, 64 or 1024 all works fine. But by using other multiples of 8 like 1032, 2048 or 4096 I get the following error message:

  • A/libc: invalid address or address of corrupt block 0x63647000 passed to dlfree
  • A/libc: Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 7148 (Thread-4888)

I am using the Superpowered SDK for offline processing with an android app. I would be thankful for any help.

Sebastian
  • 183
  • 1
  • 12
  • you know that your input buffer contains invalid floats do you? Not sure if it's the problem, but I would put some valid values in it. – Jean-François Fabre Sep 19 '16 at 19:29
  • Or `float* buffer = new float[size * 2] {};` to initialize the floats to 0. Or call `superpoweredReverb->process(nullptr, buffer, size)` – kfsone Sep 19 '16 at 19:30
  • Also, is this your actual code or is this a pseudo-mockup of what your actual code does? I.e. does the problem actually manifest with the exact code posted? – kfsone Sep 19 '16 at 19:32
  • Why all the usage of `new`, especially for things that absolutely do not need it, such as `SuperpoweredReverb`? Looks like you're writing Java code, not C++. `SuperpoweredReverb superpoweredReverb(44100);` is all you need. – PaulMcKenzie Sep 19 '16 at 19:52
  • Thanks for your good hints but they did not solve the problem. When I don't use `new`/`delete` I get the same error as soon as the function returns. I have opened a new issue on github: https://github.com/superpoweredSDK/Low-Latency-Android-Audio-iOS-Audio-Engine/issues/168 The creators of the sdk might hopefully know it. @kfsone: this is not my actual code but executing the sample code above leads to the same error. – Sebastian Sep 20 '16 at 15:28

1 Answers1

2

Seems to be a bug in the sdk. Use buffer sizes <= 1024 for the SuperpoweredReverb until it gets fixed. See https://github.com/superpoweredSDK/Low-Latency-Android-Audio-iOS-Audio-Engine/issues/168

Sebastian
  • 183
  • 1
  • 12