Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FAILURE IN SERVER /b_getn index out of range #3873

Closed
prko opened this issue Jul 13, 2018 · 8 comments
Closed

FAILURE IN SERVER /b_getn index out of range #3873

prko opened this issue Jul 13, 2018 · 8 comments
Labels
bug Issues that relate to unexpected/unwanted behavior. Don't use for PRs. comp: class library SC class library fix proposed
Milestone

Comments

@prko
Copy link
Contributor

prko commented Jul 13, 2018

While testing the latetst version which I rendered under OS X, I experienced the error

FAILURE IN SERVER /b_getn index out of range

after evaluating the following code:

{
var src= SinOsc.ar(440), amp= SinOsc.ar(440/20, 0, 2);
[src, amp, src * amp, (src * amp).clip(-1, 1)]
}.plot(20/440)

In 3.9.3, the code works well.
If the error occurs because 3.10 is not yet completed, Please close this issue.

@patrickdupuis
Copy link
Contributor

The full message I'm getting on branch 3.10 is this. The last two lines appear a couple seconds after the failure message.

-> a Plotter
FAILURE IN SERVER /b_getn index out of range
WARNING: Buffer-streamToFloatArray failed!
Try increasing wait time

@miczac
Copy link
Contributor

miczac commented Jul 13, 2018

just tried this w/ 43e9244, can confirm.
Is this related / connected to what this PR #3848 addresses for supernova?

@nhthn nhthn added the bug Issues that relate to unexpected/unwanted behavior. Don't use for PRs. label Jul 13, 2018
@prko
Copy link
Contributor Author

prko commented Jul 13, 2018

I don't know.
However, I rendered SC with the supernova-enabled option, but supernova does not boot and I booted with sclang.

When I evaluate

Server.supernova

sc returns

-> Server

then evaluating

s.reboot

returns

server 'localhost' disconnected shared memory interface
'/quit' message sent to server 'localhost'.
-> localhost
Server 'localhost' exited with exit code 0.
Booting server 'localhost' on address 127.0.0.1:57110.
Error when parsing command line arguments:
the argument ('2097152.0') for option '--rt-memory' is invalid

Server 'localhost' exited with exit code 1.

@nhthn
Copy link
Contributor

nhthn commented Jul 13, 2018

i found that this is sufficient:

{ DC.ar(0) ! 2 }.plot(0.0101)

strangely, this bug appears to be sensitive to the plot duration. this consistently works for me:

{ DC.ar(0) ! 2 }.plot(0.0100)

conjecture: the duration must translate to an integer number of samples.

if you check the Function:plot source code, you'll fin immediately translates to getToFloatArray, and if you replace plot with getToFloatArray the bug is still visible.

...wait a minute, i could have sworn it was actually loadToFloatArray at some point. when did that change? git blame tells me that it was changed to getToFloatArray recently, in #3088.

{ DC.ar(0) ! 2 }.getToFloatArray(0.0101) // fails
{ DC.ar(0) ! 2 }.getToFloatArray(0.0100) // OK

@telephon mind looking into this? thanks :)

@telephon
Copy link
Member

...wait a minute, i could have sworn it was actually loadToFloatArray at some point. when did that change?

Sure it did, in the commit you refer to. loadToFloatArray also exists, but requires access to the same file system, while getToFloatArray will also allow plotting remote server signals.

I'll take a look.

@nhthn nhthn added the comp: class library SC class library label Jul 13, 2018
@nhthn nhthn added this to the 3.10 milestone Jul 13, 2018
@telephon
Copy link
Member

Interesting.

// works fine
(
{
	var src= SinOsc.ar(440), amp= SinOsc.ar(440/20, 0, 2);
	[src, amp, src * amp, (src * amp).clip(-1, 1)]
}.plot(2 * 1633 + 67 / s.sampleRate)
)

/*
[ 'b_getn', 1, 0, 1633 ]
[ 'b_getn', 1, 1633, 1633 ]
[ 'b_getn', 1, 3266, 1633 ]
[ 'b_getn', 1, 4899, 1633 ]
[ 'b_getn', 1, 6532, 1633 ]
[ 'b_getn', 1, 8165, 1633 ]
[ 'b_getn', 1, 9798, 1633 ]
[ 'b_getn', 1, 11431, 1633 ]
[ 'b_getn', 1, 13064, 267 ]
*/
// fails
(
{
	var src= SinOsc.ar(440), amp= SinOsc.ar(440/20, 0, 2);
	[src, amp, src * amp, (src * amp).clip(-1, 1)]
}.plot(2 * 1633 + 69 / s.sampleRate)
)
/*
[ 'b_getn', 1, 0, 1633 ]
[ 'b_getn', 1, 1633, 1633 ]
[ 'b_getn', 1, 3266, 1633 ]
[ 'b_getn', 1, 4899, 1633 ]
[ 'b_getn', 1, 6532, 1633 ]
[ 'b_getn', 1, 8165, 1633 ]
[ 'b_getn', 1, 9798, 1633 ]
[ 'b_getn', 1, 11431, 1633 ]
[ 'b_getn', 1, 13064, 274 ]
FAILURE IN SERVER /b_getn in
*/

no time to check further. Maybe someone spots an off by one error somewhere here in getToFloatArray?

@telephon
Copy link
Member


(
a = 2 * 1633 + 67 / s.sampleRate;
{
	var src= SinOsc.ar(440), amp= SinOsc.ar(440/20, 0, 2);
	[src, amp]
}.getToFloatArray(a, action: { |x| x.postln })
)


(
a = 2 * 1633 + 69 / s.sampleRate;
{
	var src= SinOsc.ar(440), amp= SinOsc.ar(440/20, 0, 2);
	[src, amp]
}.getToFloatArray(a, action: { |x| x.postln })
)

telephon added a commit to telephon/supercollider that referenced this issue Jul 13, 2018
Because getToFloatArray is broken in some specific boundary case, for
now we just use loadToFloatArray instead. This used to be the case in
previous versions of the method, so this change doesn’t break expected
functionality.

Note that for now this again limits plotting to local servers.

By curing the symptom, this fixes supercollider#3873.

getToFloatArray still needs to be fixed.
telephon added a commit to telephon/supercollider that referenced this issue Jul 13, 2018
We need to make sure that the numFrames variable of the buffer is an
integer.

This fixes supercollider#3873.
@mossheim
Copy link
Contributor

mossheim commented Aug 5, 2018

Closed in #3875.

@mossheim mossheim closed this as completed Aug 5, 2018
dyfer pushed a commit to dyfer/supercollider that referenced this issue Aug 23, 2018
We need to make sure that the numFrames variable of the buffer is an
integer.

This fixes supercollider#3873.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues that relate to unexpected/unwanted behavior. Don't use for PRs. comp: class library SC class library fix proposed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants