[Csnd-dev] String bug and chnset
Date | 2022-04-26 09:38 |
From | Steven Yi |
Subject | [Csnd-dev] String bug and chnset |
Attachments | project_prtintf_chnset_bug.zip glide.csd |
Hi All, I noticed that using sprintf and chnset seems to be breaking now in ways that it did not previously. I found this in a new project I was writing today, and also in an older project that I did a couple years ago on the web-ide (https://ide.csound.com/editor/JwG9QJNyCFmEv0nKshsU). I've attached both projects. Both report errors with chnset.k at perf time with messages of: PERF ERROR in instr 2 (opcode chnset.k) line 40: invalid channel name I ran with a debugger and adding this code: printf("PERFK: %s | %s\n", p->chname, p->iname->data); to line 1253 of OOps/bus.c, it shows some odd behavior with glide.csd such as: PERFK: | frq.10 PERFK: | frq.20 PERFK: | frq.30 PERFK: frq.10 | frq.10 PERF ERROR in instr 2 (opcode chnset.k) line 40: [minvalid channel name [m [m from file /Users/stevenyi/glide.csd (1), [m chnset.k kfrq Schan note aborted [m PERFK: frq.20 | frq.20 PERF ERROR in instr 2 (opcode chnset.k) line 40: [minvalid channel name [m [m from file /Users/stevenyi/glide.csd (1), [m chnset.k kfrq Schan note aborted [m PERFK: frq.30 | frq.30 PERF ERROR in instr 2 (opcode chnset.k) line 40: [minvalid channel name [m [m from file /Users/stevenyi/glide.csd (1), [m chnset.k kfrq Schan note aborted [minstr 2: [m ivoice = 10.000 [m [mfrq.10 [minstr 2: [m ivoice = 20.000 [m [mfrq.20 [minstr 2: [m ivoice = 30.000 [m [mfrq.30 [m PERFK: frq.30 | frq.10 PERFK: frq.20 | frq.20 This seems to have worked in csound 6.16 but broke somewhere along the lines into 6.17. Anyone have any ideas on what introduced this error now? I'll try a bisect session tomorrow to see about getting more info. Steven |
Date | 2022-04-26 11:42 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] [EXTERNAL] [Csnd-dev] String bug and chnset |
The glide.csd runs here with no problems, is that what you are seeing?
--Csound version 6.17 (double samples) Feb 2 2022
[commit: deff4f9aaeaf44f7db445c215f004bca8d50901f]
sr = 44100.0, kr = 689.062, ksmps = 64
0dBFS level = 1.0, A4 tuning = 440.0
audio buffered in 16 sample-frame blocks
writing 32 sample blks of 64-bit floats to dac
SECTION 1:
instr 1: ivoice = 10.000
instr 1: ivoice = 20.000
instr 1: ivoice = 30.000
instr 2: ivoice = 10.000
frq.10instr 2: ivoice = 20.000
frq.20instr 2: ivoice = 30.000
frq.30instr 2: ivoice = 10.000
frq.10instr 2: ivoice = 20.000
frq.20instr 2: ivoice = 30.000
frq.30instr 2: ivoice = 10.000
frq.10instr 2: ivoice = 20.000
frq.20instr 2: ivoice = 30.000
frq.30Score finished in csoundPerformKsmps() with 2.
end of score. overall amps: 0.92870 0.92870
overall samples out of range: 0 0
0 errors in performance
11052 32 sample blks of 64-bit floats written to dac
|
Date | 2022-04-26 17:00 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] [EXTERNAL] [Csnd-dev] String bug and chnset |
I found that the attached project runs with
--Csound version 6.17 (double samples) Feb 2 2022
[commit: deff4f9aaeaf44f7db445c215f004bca8d50901f] but does not run with the current 6.18 code in the csound6 branch.
On 26 Apr 2022, at 11:42, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
|
Date | 2022-04-26 19:23 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] [EXTERNAL] [Csnd-dev] String bug and chnset |
Also confirmed that 6.17.0 as in the current master also runs your code. So it looks like the regression happened post-release.
|
Date | 2022-04-26 21:38 |
From | Steven Yi |
Subject | Re: [Csnd-dev] [EXTERNAL] [Csnd-dev] String bug and chnset |
Yes, my mistake, I rolled back to 6.17.0 tag and it does indeed work for both projects. So whatever bug that has been introduced is just in dev versions. The one issue is that the latest webaudio Csound release is being built from csound6 tag which threw me off (which is also being used on the web-ide at the moment). We'll have to address this before we release the final 6.17.0 webaudio release. On Tue, Apr 26, 2022 at 2:23 PM Victor Lazzarini |
Date | 2022-04-26 23:06 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] [EXTERNAL] [Csnd-dev] String bug and chnset |
By the way the csound-wasm build in the csound6 branch appears to be broken. I noticed it a few weeks ago. Prof. Victor Lazzarini Maynooth University Ireland > On 26 Apr 2022, at 21:40, Steven Yi |
Date | 2022-05-02 01:59 |
From | Steven Yi |
Subject | Re: [Csnd-dev] [EXTERNAL] [Csnd-dev] String bug and chnset |
I found the bug and pushed a commit. The bug was introduced in this commit: https://github.com/csound/csound/commit/512984db5dbb637fc53b3a50ff8480dbf715d6a1 and the fix I put in is here: https://github.com/csound/csound/commit/ccd82b9f21357c2913fff6ffe7b26d25ade11c65 There was a check if a channel name did not match the one for the channel that was allocated and, if not, try to allocate the new channel. However, the code in the first commit treated the valid path (channel name is a match) as an invalid channel name, which I believe is not what that code was meant to do. Victor: could you review the commit to see if this changes anything for what your commit was addressing? On Tue, Apr 26, 2022 at 6:06 PM Victor Lazzarini |
Date | 2022-05-02 16:49 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] [EXTERNAL] [Csnd-dev] String bug and chnset |
We just have to see if the crash happens still, I can't remember what this was but the commit message says it addresses a crash with empty channel names. As far as I can see you reverted the code so I suspect the crash is not being avoided now, but I can't remember any details right now. Prof. Victor Lazzarini Maynooth University Ireland > On 2 May 2022, at 02:00, Steven Yi |
Date | 2022-05-02 17:03 |
From | Steven Yi |
Subject | Re: [Csnd-dev] [EXTERNAL] [Csnd-dev] String bug and chnset |
Well the change I put in only modifies the perf-code, but the change for init-time is still there. On Mon, May 2, 2022 at 11:50 AM Victor Lazzarini |
Date | 2022-05-02 17:09 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] [EXTERNAL] [Csnd-dev] String bug and chnset |
and of course, the fix was wrong. Prof. Victor Lazzarini Maynooth University Ireland > On 2 May 2022, at 16:50, Victor Lazzarini |
Date | 2022-05-02 17:14 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] [EXTERNAL] [Csnd-dev] String bug and chnset |
yes, it looks like the issue might not arise at perf time. Prof. Victor Lazzarini Maynooth University Ireland > On 2 May 2022, at 17:05, Steven Yi |
Date | 2022-05-02 21:32 |
From | Iain Duncan |
Subject | Re: [Csnd-dev] [EXTERNAL] [Csnd-dev] String bug and chnset |
Don't know if this is helpful (or obvious) but that crash was surfaced from my code where I had it crashing on on empty channel name if a bad event message was sent in real time. I could find that code and test it again if that is helpful Victor. iain On Mon, May 2, 2022 at 9:14 AM Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote: yes, it looks like the issue might not arise at perf time. |
Date | 2022-05-03 18:01 |
From | Hlöðver Sigurðsson |
Subject | Re: [Csnd-dev] [EXTERNAL] [Csnd-dev] String bug and chnset |
it seems the plugin tests are failing, but I'm also seeing ``` [browser] log: INIT ERROR in instr 1 (opcode chnset.S) line 10: channel already exists with incompatible type ``` On Mon, 2 May 2022 at 22:32, Iain Duncan <iainduncanlists@gmail.com> wrote:
|
Date | 2022-05-03 18:04 |
From | Hlöðver Sigurðsson |
Subject | Re: [Csnd-dev] [EXTERNAL] [Csnd-dev] String bug and chnset |
simply put, I broke the test myself, my apologies :D On Tue, 3 May 2022 at 19:01, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
|
Date | 2022-05-04 12:43 |
From | Hlöðver Sigurðsson |
Subject | Re: [Csnd-dev] [EXTERNAL] [Csnd-dev] String bug and chnset |
the tests have been fixed and I publish an npm package 6.17.1 |
Date | 2022-05-04 17:15 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] [EXTERNAL] [Csnd-dev] String bug and chnset |
Hang on, 6.17 did not have a channel issue. That was in 6.18, not sure what is going on there. Prof. Victor Lazzarini
Maynooth University
Ireland
On 4 May 2022, at 12:45, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
|
Date | 2022-05-04 18:20 |
From | Steven Yi |
Subject | Re: [Csnd-dev] [EXTERNAL] [Csnd-dev] String bug and chnset |
The WebAudio csound package was being built from the csound6 branch so it picked up that issue, but it should be all good now. On Wed, May 4, 2022 at 12:16 PM Victor Lazzarini |
Date | 2022-05-05 09:15 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] [EXTERNAL] [Csnd-dev] String bug and chnset |
ok, but just note that the version there is 6.18, not 6.17.x. Maybe that needs to be patched if you are releasing as 6.17.1 Ideally a 6.17.1 would be from master as a hotfix (as we have done in the past). > On 4 May 2022, at 18:20, Steven Yi |
Date | 2022-05-05 13:24 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] [EXTERNAL] [Csnd-dev] String bug and chnset |
it would be good alright. Thanks.
|