[Csnd] slicearray problem?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[Csnd] slicearray problem?

Dave Seidel
Hi all,

I am having an issue with slicearry, and have boiled it down to the following code. Unless I comment out the call to slicearray, the program terminates with "csound command: Segmentation fault", and never even prints the usual message about OSC initialization. Am I doing something wrong?

Thanks,
Dave

<CsoundSynthesizer>
<CsOptions>
-m7
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1

giosc OSCinit 7110

instr 1
kArr[] init 25
kSlice[] init 5
kk = OSClisten(giosc, "/foo", "A", kArr)
if (kk == 0) then
goto DONE
endif
kSlice = slicearray(kArr, 0, 4)

DONE:
endin

</CsInstruments>
<CsScore>
</CsScore>
</CsoundSynthesizer>

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] slicearray problem?

jpff
It is crashing earlier than calling slicearray, actually in the semantic
pass after the parse.

For Steven!!
(gdb) where
#0  0x00007ffff7b1e9f9 in create_array_arg_type
(csound=csound@entry=0x6044a0,
     arrayVar=0x80e220) at
/home/jpff/csound6/Engine/csound_orc_semantics.c:188
#1  0x00007ffff7b217e5 in get_arg_type2 (csound=csound@entry=0x6044a0,
     tree=0x7f5580, typeTable=typeTable@entry=0x786860)
     at /home/jpff/csound6/Engine/csound_orc_semantics.c:554
#2  0x00007ffff7b262bc in collapse_last_assigment (typeTable=0x786860,
     anchor=0x80df70, csound=0x6044a0)
     at /home/jpff/csound6/Engine/csound_orc_expressions.c:893
#3  expand_statement (csound=csound@entry=0x6044a0,
     current=current@entry=0x7f5850, typeTable=typeTable@entry=0x786860)
     at /home/jpff/csound6/Engine/csound_orc_expressions.c:1074
#4  0x00007ffff7b238a4 in verify_tree (csound=csound@entry=0x6044a0,
     root=<optimized out>, typeTable=typeTable@entry=0x786860)
     at /home/jpff/csound6/Engine/csound_orc_semantics.c:1893
#5  0x00007ffff7b23ad4 in verify_tree (csound=csound@entry=0x6044a0,
     root=<optimized out>, typeTable=typeTable@entry=0x786860)
     at /home/jpff/csound6/Engine/csound_orc_semantics.c:1770
#6  0x00007ffff7b2d078 in csoundParseOrc (csound=csound@entry=0x6044a0,
     str=str@entry=0x0) at /home/jpff/csound6/Engine/new_orc_parser.c:258
#7  0x00007ffff7b2cc4b in csoundCompileOrcInternal (
     csound=csound@entry=0x6044a0, str=str@entry=0x0, async=async@entry=0)
     at /home/jpff/csound6/Engine/csound_orc_compile.c:1837
#8  0x00007ffff7a7015d in csoundCompileArgs (csound=csound@entry=0x6044a0,
     argc=2, argc@entry=3, argv=argv@entry=0x7fffffffdef8)
     at /home/jpff/csound6/Top/main.c:252
#9  0x00007ffff7a70f99 in csoundCompile (csound=csound@entry=0x6044a0,
     argc=argc@entry=3, argv=argv@entry=0x7fffffffdef8)
     at /home/jpff/csound6/Top/main.c:497
#10 0x0000000000401477 in main (argc=3, argv=0x7fffffffdef8)
     at /home/jpff/csound6/Frontends/csound/csound_main.c:324
(gdb) list
183
184         int i, len = arrayVar->dimensions + 3;
185         char* retVal = csound->Malloc(csound, len);
186         retVal[len - 1] = '\0';
187         retVal[len - 2] = ']';
188         retVal[len - 3] = *arrayVar->subType->varTypeName;
189         for (i = len - 4; i >= 0; i--) {
190             retVal[i] = '[';
191         }
192         return retVal;
(gdb) print *arrayVar
$1 = {varName = 0x80e160 "#.2[]",
   varType = 0x7ffff7db5860 <CS_VAR_TYPE_ARRAY>, memBlockSize = 40,
   memBlockIndex = 19, dimensions = 1, refCount = 0, next = 0x0, subType =
0x0,
   updateMemBlockSize = 0x0, initializeVariableMemory =
     0x7ffff795d3c0 <arrayInitMemory>, memBlock = 0x0}

Note subtype is null

On Sat, 7 Apr 2018, Dave Seidel wrote:

> Hi all,
> I am having an issue with slicearry, and have boiled it down to the following
> code. Unless I comment out the call to slicearray, the program terminates with
> "csound command: Segmentation fault", and never even prints the usual message
> about OSC initialization. Am I doing something wrong?
>
> Thanks,
> Dave
>
> <CsoundSynthesizer>
> <CsOptions>
> -m7
> </CsOptions>
> <CsInstruments>
>
> sr = 44100
> ksmps = 32
> nchnls = 2
> 0dbfs = 1
>
> giosc OSCinit 7110
>
> instr 1
> kArr[] init 25
> kSlice[] init 5
> kk = OSClisten(giosc, "/foo", "A", kArr)
> if (kk == 0) then
> goto DONE
> endif
> kSlice = slicearray(kArr, 0, 4)
>
> DONE:
> endin
>
> </CsInstruments>
> <CsScore>
> </CsScore>
> </CsoundSynthesizer>
>
> Csound mailing list [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here
>

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] slicearray problem?

jpff
In reply to this post by Dave Seidel
More investigation; if you replace the functional form by the old style
kSlice slicearray kArr, 0, 4
it does not crash.
A problem in the xpansion of assignments

==John



On Sat, 7 Apr 2018, Dave Seidel wrote:

> Hi all,
> I am having an issue with slicearry, and have boiled it down to the following
> code. Unless I comment out the call to slicearray, the program terminates with
> "csound command: Segmentation fault", and never even prints the usual message
> about OSC initialization. Am I doing something wrong?
>
> Thanks,
> Dave
>
> <CsoundSynthesizer>
> <CsOptions>
> -m7
> </CsOptions>
> <CsInstruments>
>
> sr = 44100
> ksmps = 32
> nchnls = 2
> 0dbfs = 1
>
> giosc OSCinit 7110
>
> instr 1
> kArr[] init 25
> kSlice[] init 5
> kk = OSClisten(giosc, "/foo", "A", kArr)
> if (kk == 0) then
> goto DONE
> endif
> kSlice = slicearray(kArr, 0, 4)
>
> DONE:
> endin
>
> </CsInstruments>
> <CsScore>
> </CsScore>
> </CsoundSynthesizer>
>
> Csound mailing list [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here
>

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] slicearray problem?

Dave Seidel
Thanks John, will try that when I get back home this evening. 

On Sat, Apr 7, 2018, 12:04 PM jpff <[hidden email]> wrote:
More investigation; if you replace the functional form by the old style
kSlice slicearray kArr, 0, 4
it does not crash.
A problem in the xpansion of assignments

==John



On Sat, 7 Apr 2018, Dave Seidel wrote:

> Hi all,
> I am having an issue with slicearry, and have boiled it down to the following
> code. Unless I comment out the call to slicearray, the program terminates with
> "csound command: Segmentation fault", and never even prints the usual message
> about OSC initialization. Am I doing something wrong?
>
> Thanks,
> Dave
>
> <CsoundSynthesizer>
> <CsOptions>
> -m7
> </CsOptions>
> <CsInstruments>
>
> sr = 44100
> ksmps = 32
> nchnls = 2
> 0dbfs = 1
>
> giosc OSCinit 7110
>
> instr 1
> kArr[] init 25
> kSlice[] init 5
> kk = OSClisten(giosc, "/foo", "A", kArr)
> if (kk == 0) then
> goto DONE
> endif
> kSlice = slicearray(kArr, 0, 4)
>
> DONE:
> endin
>
> </CsInstruments>
> <CsScore>
> </CsScore>
> </CsoundSynthesizer>
>
> Csound mailing list [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here
>

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] slicearray problem?

jpff
Yes, but there is still a bug to fix.

Sent from Blue
On 7 Apr 2018, at 19:38, Dave Seidel <[hidden email]> wrote:
Thanks John, will try that when I get back home this evening. 

On Sat, Apr 7, 2018, 12:04 PM jpff <[hidden email]> wrote:
More investigation; if you replace the functional form by the old style
kSlice slicearray kArr, 0, 4
it does not crash.
A problem in the xpansion of assignments

==John



On Sat, 7 Apr 2018, Dave Seidel wrote:

> Hi all,
> I am having an issue with slicearry, and have boiled it down to the following
> code. Unless I comment out the call to slicearray, the program terminates with
> "csound command: Segmentation fault", and never even prints the usual message
> about OSC initialization. Am I doing something wrong?
>
> Thanks,
> Dave
>
> <CsoundSynthesizer>
> <CsOptions>
> -m7
> </CsOptions>
> <CsInstruments>
>
> sr = 44100
> ksmps = 32
> nchnls = 2
> 0dbfs = 1
>
> giosc OSCinit 7110
>
> instr 1
> kArr[] init 25
> kSlice[] init 5
> kk = OSClisten(giosc, "/foo", "A", kArr)
> if (kk == 0) then
> goto DONE
> endif
> kSlice = slicearray(kArr, 0, 4)
>
> DONE:
> endin
>
> </CsInstruments>
> <CsScore>
> </CsScore>
> </CsoundSynthesizer>
>
> Csound mailing list [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here
>

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] slicearray problem?

Dave Seidel
Looking forward to the fix, but in the meantime I can confirm that the workaround works both in my example and in the actual program.

On Sat, Apr 7, 2018 at 3:44 PM, John ff <[hidden email]> wrote:
Yes, but there is still a bug to fix.

Sent from Blue
On 7 Apr 2018, at 19:38, Dave Seidel <[hidden email]> wrote:
Thanks John, will try that when I get back home this evening. 

On Sat, Apr 7, 2018, 12:04 PM jpff <[hidden email]> wrote:
More investigation; if you replace the functional form by the old style
kSlice slicearray kArr, 0, 4
it does not crash.
A problem in the xpansion of assignments

==John



On Sat, 7 Apr 2018, Dave Seidel wrote:

> Hi all,
> I am having an issue with slicearry, and have boiled it down to the following
> code. Unless I comment out the call to slicearray, the program terminates with
> "csound command: Segmentation fault", and never even prints the usual message
> about OSC initialization. Am I doing something wrong?
>
> Thanks,
> Dave
>
> <CsoundSynthesizer>
> <CsOptions>
> -m7
> </CsOptions>
> <CsInstruments>
>
> sr = 44100
> ksmps = 32
> nchnls = 2
> 0dbfs = 1
>
> giosc OSCinit 7110
>
> instr 1
> kArr[] init 25
> kSlice[] init 5
> kk = OSClisten(giosc, "/foo", "A", kArr)
> if (kk == 0) then
> goto DONE
> endif
> kSlice = slicearray(kArr, 0, 4)
>
> DONE:
> endin
>
> </CsInstruments>
> <CsScore>
> </CsScore>
> </CsoundSynthesizer>
>
> Csound mailing list [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here
>

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here



--
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] slicearray problem?

Dave Seidel
I will enter a ticket.

On Sat, Apr 7, 2018 at 5:54 PM, Dave Seidel <[hidden email]> wrote:
Looking forward to the fix, but in the meantime I can confirm that the workaround works both in my example and in the actual program.

On Sat, Apr 7, 2018 at 3:44 PM, John ff <[hidden email]> wrote:
Yes, but there is still a bug to fix.

Sent from Blue
On 7 Apr 2018, at 19:38, Dave Seidel <[hidden email]> wrote:
Thanks John, will try that when I get back home this evening. 

On Sat, Apr 7, 2018, 12:04 PM jpff <[hidden email]> wrote:
More investigation; if you replace the functional form by the old style
kSlice slicearray kArr, 0, 4
it does not crash.
A problem in the xpansion of assignments

==John



On Sat, 7 Apr 2018, Dave Seidel wrote:

> Hi all,
> I am having an issue with slicearry, and have boiled it down to the following
> code. Unless I comment out the call to slicearray, the program terminates with
> "csound command: Segmentation fault", and never even prints the usual message
> about OSC initialization. Am I doing something wrong?
>
> Thanks,
> Dave
>
> <CsoundSynthesizer>
> <CsOptions>
> -m7
> </CsOptions>
> <CsInstruments>
>
> sr = 44100
> ksmps = 32
> nchnls = 2
> 0dbfs = 1
>
> giosc OSCinit 7110
>
> instr 1
> kArr[] init 25
> kSlice[] init 5
> kk = OSClisten(giosc, "/foo", "A", kArr)
> if (kk == 0) then
> goto DONE
> endif
> kSlice = slicearray(kArr, 0, 4)
>
> DONE:
> endin
>
> </CsInstruments>
> <CsScore>
> </CsScore>
> </CsoundSynthesizer>
>
> Csound mailing list [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here
>

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here



--



--
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here