Csound Csound-dev Csound-tekno Search About

[Csnd-dev] Segfault with UDP

Date2017-10-26 21:35
FromHlöðver Sigurðsson
Subject[Csnd-dev] Segfault with UDP
Steps to reproduce

1. Start Csound with `csound -odac --port=6006` (useing dev branch compiled today)

2. Useing Nodejs (Im useing v8.0) send udp messages to the csound instance with this script https://pastebin.com/2GSqXKmP notice `csound command: Segmentation fault`

3. With the same javascript script, delete or comment with semicolons line number 59 (where Chorus opcode is called) and notice that there's no segfault and everything works.

4. Uncomment line 59 and allow it to be, but delete line 63 to 76, and notice that again everything works (and seemingly Chorus had nothing to do with the segfault).

I will add that equivalent code works without segfault when running directly from csd file.

Date2017-10-26 21:38
FromHlöðver Sigurðsson
SubjectRe: [Csnd-dev] Segfault with UDP
from gdb, this message is printed

Thread 1 "csound" received signal SIGSEGV, Segmentation fault.
0x00007ffff7899b8f in useropcdset () from /usr/local/lib/libcsound64.so.6.0


On 26 October 2017 at 22:35, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
Steps to reproduce

1. Start Csound with `csound -odac --port=6006` (useing dev branch compiled today)

2. Useing Nodejs (Im useing v8.0) send udp messages to the csound instance with this script https://pastebin.com/2GSqXKmP notice `csound command: Segmentation fault`

3. With the same javascript script, delete or comment with semicolons line number 59 (where Chorus opcode is called) and notice that there's no segfault and everything works.

4. Uncomment line 59 and allow it to be, but delete line 63 to 76, and notice that again everything works (and seemingly Chorus had nothing to do with the segfault).

I will add that equivalent code works without segfault when running directly from csd file.


Date2017-10-26 22:02
FromVictor Lazzarini
SubjectRe: [Csnd-dev] Segfault with UDP
That’s the UDO init code.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 26 Oct 2017, at 21:38, Hlöðver Sigurðsson  wrote:
> 
> from gdb, this message is printed
> 
> Thread 1 "csound" received signal SIGSEGV, Segmentation fault.
> 0x00007ffff7899b8f in useropcdset () from /usr/local/lib/libcsound64.so.6.0
> 
> 
> On 26 October 2017 at 22:35, Hlöðver Sigurðsson  wrote:
> Steps to reproduce
> 
> 1. Start Csound with `csound -odac --port=6006` (useing dev branch compiled today)
> 
> 2. Useing Nodejs (Im useing v8.0) send udp messages to the csound instance with this script https://pastebin.com/2GSqXKmP notice `csound command: Segmentation fault`
> 
> 3. With the same javascript script, delete or comment with semicolons line number 59 (where Chorus opcode is called) and notice that there's no segfault and everything works.
> 
> 4. Uncomment line 59 and allow it to be, but delete line 63 to 76, and notice that again everything works (and seemingly Chorus had nothing to do with the segfault).
> 
> I will add that equivalent code works without segfault when running directly from cs

Date2017-10-26 22:23
FromSteven Yi
SubjectRe: [Csnd-dev] Segfault with UDP
Tested here on Windows with both MinGW and VS builds and both crash in
the same place:

  csound64.dll!useropcdset(CSOUND_ * csound, UOPCODE * p) Line 1255 C
Symbols loaded.
> csound64.dll!insert(CSOUND_ * csound, int insno, event * newevtp) Line 300 C Symbols loaded.
  csound64.dll!process_score_event(CSOUND_ * csound, event * evt, int
rtEvt) Line 777 C Symbols loaded.
  csound64.dll!process_rt_event(CSOUND_ * csound, int sensType) Line
873 C Symbols loaded.
  csound64.dll!sensevents(CSOUND_ * csound) Line 1061 C Symbols loaded.
  csound64.dll!csoundPerform(CSOUND_ * csound) Line 2147 C Symbols loaded.
  csound.exe!main(int argc, char * * argv) Line 327 C Symbols loaded.
  [External Code] Annotated Frame

Haven't found a cause for it yet.

On Thu, Oct 26, 2017 at 5:02 PM, Victor Lazzarini
 wrote:
> That’s the UDO init code.
> ========================
> Prof. Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
>> On 26 Oct 2017, at 21:38, Hlöðver Sigurðsson  wrote:
>>
>> from gdb, this message is printed
>>
>> Thread 1 "csound" received signal SIGSEGV, Segmentation fault.
>> 0x00007ffff7899b8f in useropcdset () from /usr/local/lib/libcsound64.so.6.0
>>
>>
>> On 26 October 2017 at 22:35, Hlöðver Sigurðsson  wrote:
>> Steps to reproduce
>>
>> 1. Start Csound with `csound -odac --port=6006` (useing dev branch compiled today)
>>
>> 2. Useing Nodejs (Im useing v8.0) send udp messages to the csound instance with this script https://pastebin.com/2GSqXKmP notice `csound command: Segmentation fault`
>>
>> 3. With the same javascript script, delete or comment with semicolons line number 59 (where Chorus opcode is called) and notice that there's no segfault and everything works.
>>
>> 4. Uncomment line 59 and allow it to be, but delete line 63 to 76, and notice that again everything works (and seemingly Chorus had nothing to do with the segfault).
>>
>> I will add that equivalent code works without segfault when running directly from csd file.
>>

Date2017-10-26 22:26
FromVictor Lazzarini
SubjectRe: [Csnd-dev] Segfault with UDP
I wonder if the whole code is being sent. UDP has a maximum number of characters (MTU), which this might be exceeding.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 26 Oct 2017, at 21:38, Hlöðver Sigurðsson  wrote:
> 
> from gdb, this message is printed
> 
> Thread 1 "csound" received signal SIGSEGV, Segmentation fault.
> 0x00007ffff7899b8f in useropcdset () from /usr/local/lib/libcsound64.so.6.0
> 
> 
> On 26 October 2017 at 22:35, Hlöðver Sigurðsson  wrote:
> Steps to reproduce
> 
> 1. Start Csound with `csound -odac --port=6006` (useing dev branch compiled today)
> 
> 2. Useing Nodejs (Im useing v8.0) send udp messages to the csound instance with this script https://pastebin.com/2GSqXKmP notice `csound command: Segmentation fault`
> 
> 3. With the same javascript script, delete or comment with semicolons line number 59 (where Chorus opcode is called) and notice that there's no segfault and everything works.
> 
> 4. Uncomment line 59 and allow it to be, but delete line 63 to 76, and notice that again everything works (and seemingly Chorus had nothing to do with the segfault).
> 
> I will add that equivalent code works without segf

Date2017-10-26 22:31
FromHlöðver Sigurðsson
SubjectRe: [Csnd-dev] Segfault with UDP
The MTU limit is I think 64 kilobytes. I exceeded that before and got different error Error: send EMSGSIZE but then from the client side. But the code I was sending then was huge.

On 26 October 2017 at 23:26, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
I wonder if the whole code is being sent. UDP has a maximum number of characters (MTU), which this might be exceeding.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 26 Oct 2017, at 21:38, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
>
> from gdb, this message is printed
>
> Thread 1 "csound" received signal SIGSEGV, Segmentation fault.
> 0x00007ffff7899b8f in useropcdset () from /usr/local/lib/libcsound64.so.6.0
>
>
> On 26 October 2017 at 22:35, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
> Steps to reproduce
>
> 1. Start Csound with `csound -odac --port=6006` (useing dev branch compiled today)
>
> 2. Useing Nodejs (Im useing v8.0) send udp messages to the csound instance with this script https://pastebin.com/2GSqXKmP notice `csound command: Segmentation fault`
>
> 3. With the same javascript script, delete or comment with semicolons line number 59 (where Chorus opcode is called) and notice that there's no segfault and everything works.
>
> 4. Uncomment line 59 and allow it to be, but delete line 63 to 76, and notice that again everything works (and seemingly Chorus had nothing to do with the segfault).
>
> I will add that equivalent code works without segfault when running directly from csd file.
>



Date2017-10-26 22:37
FromVictor Lazzarini
SubjectRe: [Csnd-dev] Segfault with UDP
What is happening is that the message is broken into two pieces and they get compiled separately and so it
doesn’t quite work. There is a problem with large bits of code, which I will try to address.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 26 Oct 2017, at 21:38, Hlöðver Sigurðsson  wrote:
> 
> from gdb, this message is printed
> 
> Thread 1 "csound" received signal SIGSEGV, Segmentation fault.
> 0x00007ffff7899b8f in useropcdset () from /usr/local/lib/libcsound64.so.6.0
> 
> 
> On 26 October 2017 at 22:35, Hlöðver Sigurðsson  wrote:
> Steps to reproduce
> 
> 1. Start Csound with `csound -odac --port=6006` (useing dev branch compiled today)
> 
> 2. Useing Nodejs (Im useing v8.0) send udp messages to the csound instance with this script https://pastebin.com/2GSqXKmP notice `csound command: Segmentation fault`
> 
> 3. With the same javascript script, delete or comment with semicolons line number 59 (where Chorus opcode is called) and notice that there's no segfault and everything works.
> 
> 4. Uncomment line 59 and allow it to be, but delete line 63 to 76, and notice that again everything works (and seemingly Chorus had nothing to do with the segfault).
> 
> I will add that equivalent code works without segfault when running directly fro

Date2017-10-26 22:41
FromSteven Yi
SubjectRe: [Csnd-dev] Segfault with UDP
Attachmentstest.csd  
There's something else I'm seeing that might be a part of this:

When the program crashes, tp is NULL.  instno is 201 (I think that
must be assigned to the Chorus UDO).

If I modify the orc code to make the mixer instrument 100 instead of
10000, I don't get a crash.

If I run the code as a CSD on its own its fine.  (Attached)

On Thu, Oct 26, 2017 at 5:37 PM, Victor Lazzarini
 wrote:
> What is happening is that the message is broken into two pieces and they get compiled separately and so it
> doesn’t quite work. There is a problem with large bits of code, which I will try to address.
> ========================
> Prof. Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
>> On 26 Oct 2017, at 21:38, Hlöðver Sigurðsson  wrote:
>>
>> from gdb, this message is printed
>>
>> Thread 1 "csound" received signal SIGSEGV, Segmentation fault.
>> 0x00007ffff7899b8f in useropcdset () from /usr/local/lib/libcsound64.so.6.0
>>
>>
>> On 26 October 2017 at 22:35, Hlöðver Sigurðsson  wrote:
>> Steps to reproduce
>>
>> 1. Start Csound with `csound -odac --port=6006` (useing dev branch compiled today)
>>
>> 2. Useing Nodejs (Im useing v8.0) send udp messages to the csound instance with this script https://pastebin.com/2GSqXKmP notice `csound command: Segmentation fault`
>>
>> 3. With the same javascript script, delete or comment with semicolons line number 59 (where Chorus opcode is called) and notice that there's no segfault and everything works.
>>
>> 4. Uncomment line 59 and allow it to be, but delete line 63 to 76, and notice that again everything works (and seemingly Chorus had nothing to do with the segfault).
>>
>> I will add that equivalent code works without segfault when running directly from csd file.
>>
>

Date2017-10-26 23:54
FromVictor Lazzarini
SubjectRe: [Csnd-dev] Segfault with UDP
I was having trouble sending large orcs with nc and so I have added support for longer
code or code broken in lines using { and }.
Anyway, I seem to be able to reproduce the segfault with chorus

========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 26 Oct 2017, at 22:41, Steven Yi  wrote:
> 
> There's something else I'm seeing that might be a part of this:
> 
> When the program crashes, tp is NULL.  instno is 201 (I think that
> must be assigned to the Chorus UDO).
> 
> If I modify the orc code to make the mixer instrument 100 instead of
> 10000, I don't get a crash.
> 
> If I run the code as a CSD on its own its fine.  (Attached)
> 
> On Thu, Oct 26, 2017 at 5:37 PM, Victor Lazzarini
>  wrote:
>> What is happening is that the message is broken into two pieces and they get compiled separately and so it
>> doesn’t quite work. There is a problem with large bits of code, which I will try to address.
>> ========================
>> Prof. Victor Lazzarini
>> Dean of Arts, Celtic Studies, and Philosophy,
>> Maynooth University,
>> Maynooth, Co Kildare, Ireland
>> Tel: 00 353 7086936
>> Fax: 00 353 1 7086952
>> 
>>> On 26 Oct 2017, at 21:38, Hlöðver Sigurðsson  wrote:
>>> 
>>> from gdb, this message is printed
>>> 
>>> Thread 1 "csound" received signal SIGSEGV, Segmentation fault.
>>> 0x00007ffff7899b8f in useropcdset () from /usr/local/lib/libcsound64.so.6.0
>>> 
>>> 
>>> On 26 October 2017 at 22:35, Hlöðver Sigurðsson  wrote:
>>> Steps to reproduce
>>> 
>>> 1. Start Csound with `csound -odac --port=6006` (useing dev branch compiled today)
>>> 
>>> 2. Useing Nodejs (Im useing v8.0) send udp messages to the csound instance with this script https://pastebin.com/2GSqXKmP notice `csound command: Segmentation fault`
>>> 
>>> 3. With the same javascript script, delete or comment with semicolons line number 59 (where Chorus opcode is called) and notice that there's no segfault and everything works.
>>> 
>>> 4. Uncomment line 59 and allow it to be, but delete line 63 to 76, and notice that again everything works (and seemingly Chorus had nothing to do with the segfault).
>>> 
>>> I will add that equivalent code works without segfault when runni

Date2017-10-27 00:00
FromVictor Lazzarini
SubjectRe: [Csnd-dev] Segfault with UDP
I get 

   1252	    if (!p->ip) {
   1253	      /* search for already allocated, but not active instance */
   1254	      /* if none was found, allocate a new instance */
-> 1255	      if (!tp->act_instance)
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 26 Oct 2017, at 22:41, Steven Yi  wrote:
> 
> There's something else I'm seeing that might be a part of this:
> 
> When the program crashes, tp is NULL.  instno is 201 (I think that
> must be assigned to the Chorus UDO).
> 
> If I modify the orc code to make the mixer instrument 100 instead of
> 10000, I don't get a crash.
> 
> If I run the code as a CSD on its own its fine.  (Attached)
> 
> On Thu, Oct 26, 2017 at 5:37 PM, Victor Lazzarini
>  wrote:
>> What is happening is that the message is broken into two pieces and they get compiled separately and so it
>> doesn’t quite work. There is a problem with large bits of code, which I will try to address.
>> ========================
>> Prof. Victor Lazzarini
>> Dean of Arts, Celtic Studies, and Philosophy,
>> Maynooth University,
>> Maynooth, Co Kildare, Ireland
>> Tel: 00 353 7086936
>> Fax: 00 353 1 7086952
>> 
>>> On 26 Oct 2017, at 21:38, Hlöðver Sigurðsson  wrote:
>>> 
>>> from gdb, this message is printed
>>> 
>>> Thread 1 "csound" received signal SIGSEGV, Segmentation fault.
>>> 0x00007ffff7899b8f in useropcdset () from /usr/local/lib/libcsound64.so.6.0
>>> 
>>> 
>>> On 26 October 2017 at 22:35, Hlöðver Sigurðsson  wrote:
>>> Steps to reproduce
>>> 
>>> 1. Start Csound with `csound -odac --port=6006` (useing dev branch compiled today)
>>> 
>>> 2. Useing Nodejs (Im useing v8.0) send udp messages to the csound instance with this script https://pastebin.com/2GSqXKmP notice `csound command: Segmentation fault`
>>> 
>>> 3. With the same javascript script, delete or comment with semicolons line number 59 (where Chorus opcode is called) and notice that there's no segfault and everything works.
>>> 
>>> 4. Uncomment line 59 and allow it to be, but delete line 63 to 76, and notice that again everything works (and seemingly Chorus had nothing to do with the segfault).
>>> 
>>> I will add that equivalent code works without segfault when running directly from csd file.
>>> 
>> 
> 

Date2017-10-27 00:02
FromSteven Yi
SubjectRe: [Csnd-dev] Segfault with UDP
Yes, we're on the same page as that's exactly where I had the crash
with NULL tp.

On Thu, Oct 26, 2017 at 7:00 PM, Victor Lazzarini
 wrote:
> I get
>
>    1252     if (!p->ip) {
>    1253       /* search for already allocated, but not active instance */
>    1254       /* if none was found, allocate a new instance */
> -> 1255       if (!tp->act_instance)
> ========================
> Prof. Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
>> On 26 Oct 2017, at 22:41, Steven Yi  wrote:
>>
>> There's something else I'm seeing that might be a part of this:
>>
>> When the program crashes, tp is NULL.  instno is 201 (I think that
>> must be assigned to the Chorus UDO).
>>
>> If I modify the orc code to make the mixer instrument 100 instead of
>> 10000, I don't get a crash.
>>
>> If I run the code as a CSD on its own its fine.  (Attached)
>>
>> On Thu, Oct 26, 2017 at 5:37 PM, Victor Lazzarini
>>  wrote:
>>> What is happening is that the message is broken into two pieces and they get compiled separately and so it
>>> doesn’t quite work. There is a problem with large bits of code, which I will try to address.
>>> ========================
>>> Prof. Victor Lazzarini
>>> Dean of Arts, Celtic Studies, and Philosophy,
>>> Maynooth University,
>>> Maynooth, Co Kildare, Ireland
>>> Tel: 00 353 7086936
>>> Fax: 00 353 1 7086952
>>>
>>>> On 26 Oct 2017, at 21:38, Hlöðver Sigurðsson  wrote:
>>>>
>>>> from gdb, this message is printed
>>>>
>>>> Thread 1 "csound" received signal SIGSEGV, Segmentation fault.
>>>> 0x00007ffff7899b8f in useropcdset () from /usr/local/lib/libcsound64.so.6.0
>>>>
>>>>
>>>> On 26 October 2017 at 22:35, Hlöðver Sigurðsson  wrote:
>>>> Steps to reproduce
>>>>
>>>> 1. Start Csound with `csound -odac --port=6006` (useing dev branch compiled today)
>>>>
>>>> 2. Useing Nodejs (Im useing v8.0) send udp messages to the csound instance with this script https://pastebin.com/2GSqXKmP notice `csound command: Segmentation fault`
>>>>
>>>> 3. With the same javascript script, delete or comment with semicolons line number 59 (where Chorus opcode is called) and notice that there's no segfault and everything works.
>>>>
>>>> 4. Uncomment line 59 and allow it to be, but delete line 63 to 76, and notice that again everything works (and seemingly Chorus had nothing to do with the segfault).
>>>>
>>>> I will add that equivalent code works without segfault when running directly from csd file.
>>>>
>>>
>> 

Date2017-10-27 00:03
FromVictor Lazzarini
SubjectRe: [Csnd-dev] Segfault with UDP
It seems it can’t find an instrument. If reduce instr 10000 to  instr 10 it doesn’t crash anymore.

========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 27 Oct 2017, at 00:02, Steven Yi  wrote:
> 
> Yes, we're on the same page as that's exactly where I had the crash
> with NULL tp.
> 
> On Thu, Oct 26, 2017 at 7:00 PM, Victor Lazzarini
>  wrote:
>> I get
>> 
>>   1252     if (!p->ip) {
>>   1253       /* search for already allocated, but not active instance */
>>   1254       /* if none was found, allocate a new instance */
>> -> 1255       if (!tp->act_instance)
>> ========================
>> Prof. Victor Lazzarini
>> Dean of Arts, Celtic Studies, and Philosophy,
>> Maynooth University,
>> Maynooth, Co Kildare, Ireland
>> Tel: 00 353 7086936
>> Fax: 00 353 1 7086952
>> 
>>> On 26 Oct 2017, at 22:41, Steven Yi  wrote:
>>> 
>>> There's something else I'm seeing that might be a part of this:
>>> 
>>> When the program crashes, tp is NULL.  instno is 201 (I think that
>>> must be assigned to the Chorus UDO).
>>> 
>>> If I modify the orc code to make the mixer instrument 100 instead of
>>> 10000, I don't get a crash.
>>> 
>>> If I run the code as a CSD on its own its fine.  (Attached)
>>> 
>>> On Thu, Oct 26, 2017 at 5:37 PM, Victor Lazzarini
>>>  wrote:
>>>> What is happening is that the message is broken into two pieces and they get compiled separately and so it
>>>> doesn’t quite work. There is a problem with large bits of code, which I will try to address.
>>>> ========================
>>>> Prof. Victor Lazzarini
>>>> Dean of Arts, Celtic Studies, and Philosophy,
>>>> Maynooth University,
>>>> Maynooth, Co Kildare, Ireland
>>>> Tel: 00 353 7086936
>>>> Fax: 00 353 1 7086952
>>>> 
>>>>> On 26 Oct 2017, at 21:38, Hlöðver Sigurðsson  wrote:
>>>>> 
>>>>> from gdb, this message is printed
>>>>> 
>>>>> Thread 1 "csound" received signal SIGSEGV, Segmentation fault.
>>>>> 0x00007ffff7899b8f in useropcdset () from /usr/local/lib/libcsound64.so.6.0
>>>>> 
>>>>> 
>>>>> On 26 October 2017 at 22:35, Hlöðver Sigurðsson  wrote:
>>>>> Steps to reproduce
>>>>> 
>>>>> 1. Start Csound with `csound -odac --port=6006` (useing dev branch compiled today)
>>>>> 
>>>>> 2. Useing Nodejs (Im useing v8.0) send udp messages to the csound instance with this script https://pastebin.com/2GSqXKmP notice `csound command: Segmentation fault`
>>>>> 
>>>>> 3. With the same javascript script, delete or comment with semicolons line number 59 (where Chorus opcode is called) and notice that there's no segfault and everything works.
>>>>> 
>>>>> 4. Uncomment line 59 and allow it to be, but delete line 63 to 76, and notice that again everything works (and seemingly Chorus had nothing to do with the segfault).
>>>>> 
>>>>> I will add that equivalent code works without segfault when running directly from csd file.
>>>>> 
>>>> 
>>> <

Date2017-10-27 00:11
FromVictor Lazzarini
SubjectRe: [Csnd-dev] Segfault with UDP
I’ve added an InitError for that case.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 27 Oct 2017, at 00:03, Victor Lazzarini  wrote:
> 
> It seems it can’t find an instrument. If reduce instr 10000 to  instr 10 it doesn’t crash anymore.
> 
> ========================
> Prof. Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952 
> 
>> On 27 Oct 2017, at 00:02, Steven Yi  wrote:
>> 
>> Yes, we're on the same page as that's exactly where I had the crash
>> with NULL tp.
>> 
>> On Thu, Oct 26, 2017 at 7:00 PM, Victor Lazzarini
>>  wrote:
>>> I get
>>> 
>>>  1252     if (!p->ip) {
>>>  1253       /* search for already allocated, but not active instance */
>>>  1254       /* if none was found, allocate a new instance */
>>> -> 1255       if (!tp->act_instance)
>>> ========================
>>> Prof. Victor Lazzarini
>>> Dean of Arts, Celtic Studies, and Philosophy,
>>> Maynooth University,
>>> Maynooth, Co Kildare, Ireland
>>> Tel: 00 353 7086936
>>> Fax: 00 353 1 7086952
>>> 
>>>> On 26 Oct 2017, at 22:41, Steven Yi  wrote:
>>>> 
>>>> There's something else I'm seeing that might be a part of this:
>>>> 
>>>> When the program crashes, tp is NULL.  instno is 201 (I think that
>>>> must be assigned to the Chorus UDO).
>>>> 
>>>> If I modify the orc code to make the mixer instrument 100 instead of
>>>> 10000, I don't get a crash.
>>>> 
>>>> If I run the code as a CSD on its own its fine.  (Attached)
>>>> 
>>>> On Thu, Oct 26, 2017 at 5:37 PM, Victor Lazzarini
>>>>  wrote:
>>>>> What is happening is that the message is broken into two pieces and they get compiled separately and so it
>>>>> doesn’t quite work. There is a problem with large bits of code, which I will try to address.
>>>>> ========================
>>>>> Prof. Victor Lazzarini
>>>>> Dean of Arts, Celtic Studies, and Philosophy,
>>>>> Maynooth University,
>>>>> Maynooth, Co Kildare, Ireland
>>>>> Tel: 00 353 7086936
>>>>> Fax: 00 353 1 7086952
>>>>> 
>>>>>> On 26 Oct 2017, at 21:38, Hlöðver Sigurðsson  wrote:
>>>>>> 
>>>>>> from gdb, this message is printed
>>>>>> 
>>>>>> Thread 1 "csound" received signal SIGSEGV, Segmentation fault.
>>>>>> 0x00007ffff7899b8f in useropcdset () from /usr/local/lib/libcsound64.so.6.0
>>>>>> 
>>>>>> 
>>>>>> On 26 October 2017 at 22:35, Hlöðver Sigurðsson  wrote:
>>>>>> Steps to reproduce
>>>>>> 
>>>>>> 1. Start Csound with `csound -odac --port=6006` (useing dev branch compiled today)
>>>>>> 
>>>>>> 2. Useing Nodejs (Im useing v8.0) send udp messages to the csound instance with this script https://pastebin.com/2GSqXKmP notice `csound command: Segmentation fault`
>>>>>> 
>>>>>> 3. With the same javascript script, delete or comment with semicolons line number 59 (where Chorus opcode is called) and notice that there's no segfault and everything works.
>>>>>> 
>>>>>> 4. Uncomment line 59 and allow it to be, but delete line 63 to 76, and notice that again everything works (and seemingly Chorus had nothing to do with the segfault).
>>>>>> 
>>>>>> I will add that equivalent code works without segfault when running directly from csd file.
>>>>>> 
>>>>> 

Date2017-10-27 01:38
FromSteven Yi
SubjectRe: [Csnd-dev] Segfault with UDP
But there's still a problem here I think.

If you run the code on its own outside of the context of UDP (see the
test.csd I attached in previous message in this thread) it works just
fine.

I think it's good to protect against trying to deref tp when it's
NULL, but it seems there's still a bug to fix.

On Thu, Oct 26, 2017 at 7:11 PM, Victor Lazzarini
 wrote:
> I’ve added an InitError for that case.
> ========================
> Prof. Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
>> On 27 Oct 2017, at 00:03, Victor Lazzarini  wrote:
>>
>> It seems it can’t find an instrument. If reduce instr 10000 to  instr 10 it doesn’t crash anymore.
>>
>> ========================
>> Prof. Victor Lazzarini
>> Dean of Arts, Celtic Studies, and Philosophy,
>> Maynooth University,
>> Maynooth, Co Kildare, Ireland
>> Tel: 00 353 7086936
>> Fax: 00 353 1 7086952
>>
>>> On 27 Oct 2017, at 00:02, Steven Yi  wrote:
>>>
>>> Yes, we're on the same page as that's exactly where I had the crash
>>> with NULL tp.
>>>
>>> On Thu, Oct 26, 2017 at 7:00 PM, Victor Lazzarini
>>>  wrote:
>>>> I get
>>>>
>>>>  1252     if (!p->ip) {
>>>>  1253       /* search for already allocated, but not active instance */
>>>>  1254       /* if none was found, allocate a new instance */
>>>> -> 1255       if (!tp->act_instance)
>>>> ========================
>>>> Prof. Victor Lazzarini
>>>> Dean of Arts, Celtic Studies, and Philosophy,
>>>> Maynooth University,
>>>> Maynooth, Co Kildare, Ireland
>>>> Tel: 00 353 7086936
>>>> Fax: 00 353 1 7086952
>>>>
>>>>> On 26 Oct 2017, at 22:41, Steven Yi  wrote:
>>>>>
>>>>> There's something else I'm seeing that might be a part of this:
>>>>>
>>>>> When the program crashes, tp is NULL.  instno is 201 (I think that
>>>>> must be assigned to the Chorus UDO).
>>>>>
>>>>> If I modify the orc code to make the mixer instrument 100 instead of
>>>>> 10000, I don't get a crash.
>>>>>
>>>>> If I run the code as a CSD on its own its fine.  (Attached)
>>>>>
>>>>> On Thu, Oct 26, 2017 at 5:37 PM, Victor Lazzarini
>>>>>  wrote:
>>>>>> What is happening is that the message is broken into two pieces and they get compiled separately and so it
>>>>>> doesn’t quite work. There is a problem with large bits of code, which I will try to address.
>>>>>> ========================
>>>>>> Prof. Victor Lazzarini
>>>>>> Dean of Arts, Celtic Studies, and Philosophy,
>>>>>> Maynooth University,
>>>>>> Maynooth, Co Kildare, Ireland
>>>>>> Tel: 00 353 7086936
>>>>>> Fax: 00 353 1 7086952
>>>>>>
>>>>>>> On 26 Oct 2017, at 21:38, Hlöðver Sigurðsson  wrote:
>>>>>>>
>>>>>>> from gdb, this message is printed
>>>>>>>
>>>>>>> Thread 1 "csound" received signal SIGSEGV, Segmentation fault.
>>>>>>> 0x00007ffff7899b8f in useropcdset () from /usr/local/lib/libcsound64.so.6.0
>>>>>>>
>>>>>>>
>>>>>>> On 26 October 2017 at 22:35, Hlöðver Sigurðsson  wrote:
>>>>>>> Steps to reproduce
>>>>>>>
>>>>>>> 1. Start Csound with `csound -odac --port=6006` (useing dev branch compiled today)
>>>>>>>
>>>>>>> 2. Useing Nodejs (Im useing v8.0) send udp messages to the csound instance with this script https://pastebin.com/2GSqXKmP notice `csound command: Segmentation fault`
>>>>>>>
>>>>>>> 3. With the same javascript script, delete or comment with semicolons line number 59 (where Chorus opcode is called) and notice that there's no segfault and everything works.
>>>>>>>
>>>>>>> 4. Uncomment line 59 and allow it to be, but delete line 63 to 76, and notice that again everything works (and seemingly Chorus had nothing to do with the segfault).
>>>>>>>
>>>>>>> I will add that equivalent code works without segfault when running directly from csd file.
>>>>>>>
>>>>>>
>>>>> 
>>>>
>>

Date2017-10-27 06:23
FromVictor Lazzarini
SubjectRe: [Csnd-dev] Segfault with UDP
yes, there is a bug alright.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 27 Oct 2017, at 01:39, Steven Yi <stevenyi@GMAIL.COM> wrote:

But there's still a problem here I think.

If you run the code on its own outside of the context of UDP (see the
test.csd I attached in previous message in this thread) it works just
fine.

I think it's good to protect against trying to deref tp when it's
NULL, but it seems there's still a bug to fix.

On Thu, Oct 26, 2017 at 7:11 PM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
I’ve added an InitError for that case.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 27 Oct 2017, at 00:03, Victor Lazzarini <Victor.Lazzarini@MU.IE> wrote:

It seems it can’t find an instrument. If reduce instr 10000 to  instr 10 it doesn’t crash anymore.

========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 27 Oct 2017, at 00:02, Steven Yi <stevenyi@GMAIL.COM> wrote:

Yes, we're on the same page as that's exactly where I had the crash
with NULL tp.

On Thu, Oct 26, 2017 at 7:00 PM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
I get

1252     if (!p->ip) {
1253       /* search for already allocated, but not active instance */
1254       /* if none was found, allocate a new instance */
-> 1255       if (!tp->act_instance)
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 26 Oct 2017, at 22:41, Steven Yi <stevenyi@gmail.com> wrote:

There's something else I'm seeing that might be a part of this:

When the program crashes, tp is NULL.  instno is 201 (I think that
must be assigned to the Chorus UDO).

If I modify the orc code to make the mixer instrument 100 instead of
10000, I don't get a crash.

If I run the code as a CSD on its own its fine.  (Attached)

On Thu, Oct 26, 2017 at 5:37 PM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
What is happening is that the message is broken into two pieces and they get compiled separately and so it
doesn’t quite work. There is a problem with large bits of code, which I will try to address.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 26 Oct 2017, at 21:38, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:

from gdb, this message is printed

Thread 1 "csound" received signal SIGSEGV, Segmentation fault.
0x00007ffff7899b8f in useropcdset () from /usr/local/lib/libcsound64.so.6.0


On 26 October 2017 at 22:35, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
Steps to reproduce

1. Start Csound with `csound -odac --port=6006` (useing dev branch compiled today)

2. Useing Nodejs (Im useing v8.0) send udp messages to the csound instance with this script https://pastebin.com/2GSqXKmP notice `csound command: Segmentation fault`

3. With the same javascript script, delete or comment with semicolons line number 59 (where Chorus opcode is called) and notice that there's no segfault and everything works.

4. Uncomment line 59 and allow it to be, but delete line 63 to 76, and notice that again everything works (and seemingly Chorus had nothing to do with the segfault).

I will add that equivalent code works without segfault when running directly from csd file.


<test.csd>




Date2017-10-27 09:44
FromSteven Yi
SubjectRe: [Csnd-dev] Segfault with UDP
Perhaps there is an issue with merging when there is a large instrument number introduced? Thinking there is a difference between first compile pass and latter ones. (Sidenote: in cs7, we should revisit named instruments having numbers assigned, as one can easily assign a numbered instrument after a named one that redefines the assigned number)
On Fri, Oct 27, 2017 at 1:23 AM Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
yes, there is a bug alright.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 27 Oct 2017, at 01:39, Steven Yi <stevenyi@GMAIL.COM> wrote:

But there's still a problem here I think.

If you run the code on its own outside of the context of UDP (see the
test.csd I attached in previous message in this thread) it works just
fine.

I think it's good to protect against trying to deref tp when it's
NULL, but it seems there's still a bug to fix.

On Thu, Oct 26, 2017 at 7:11 PM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
I’ve added an InitError for that case.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 27 Oct 2017, at 00:03, Victor Lazzarini <Victor.Lazzarini@MU.IE> wrote:

It seems it can’t find an instrument. If reduce instr 10000 to  instr 10 it doesn’t crash anymore.

========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 27 Oct 2017, at 00:02, Steven Yi <stevenyi@GMAIL.COM> wrote:

Yes, we're on the same page as that's exactly where I had the crash
with NULL tp.

On Thu, Oct 26, 2017 at 7:00 PM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
I get

1252     if (!p->ip) {
1253       /* search for already allocated, but not active instance */
1254       /* if none was found, allocate a new instance */
-> 1255       if (!tp->act_instance)
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 26 Oct 2017, at 22:41, Steven Yi <stevenyi@gmail.com> wrote:

There's something else I'm seeing that might be a part of this:

When the program crashes, tp is NULL.  instno is 201 (I think that
must be assigned to the Chorus UDO).

If I modify the orc code to make the mixer instrument 100 instead of
10000, I don't get a crash.

If I run the code as a CSD on its own its fine.  (Attached)

On Thu, Oct 26, 2017 at 5:37 PM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
What is happening is that the message is broken into two pieces and they get compiled separately and so it
doesn’t quite work. There is a problem with large bits of code, which I will try to address.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 26 Oct 2017, at 21:38, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:

from gdb, this message is printed

Thread 1 "csound" received signal SIGSEGV, Segmentation fault.
0x00007ffff7899b8f in useropcdset () from /usr/local/lib/libcsound64.so.6.0


On 26 October 2017 at 22:35, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
Steps to reproduce

1. Start Csound with `csound -odac --port=6006` (useing dev branch compiled today)

2. Useing Nodejs (Im useing v8.0) send udp messages to the csound instance with this script https://pastebin.com/2GSqXKmP notice `csound command: Segmentation fault`

3. With the same javascript script, delete or comment with semicolons line number 59 (where Chorus opcode is called) and notice that there's no segfault and everything works.

4. Uncomment line 59 and allow it to be, but delete line 63 to 76, and notice that again everything works (and seemingly Chorus had nothing to do with the segfault).

I will add that equivalent code works without segfault when running directly from csd file.


<test.csd>




Date2017-10-27 14:01
FromVictor Lazzarini
SubjectRe: [Csnd-dev] Segfault with UDP
yes, I think it is to do with merging. I have not had a chance to investigate yet.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 27 Oct 2017, at 09:44, Steven Yi  wrote:
> 
> Perhaps there is an issue with merging when there is a large instrument number introduced? Thinking there is a difference between first compile pass and latter ones. (Sidenote: in cs7, we should revisit named instruments having numbers assigned, as one can easily assign a numbered instrument after a named one that redefines the assigned number)
> On Fri, Oct 27, 2017 at 1:23 AM Victor Lazzarini  wrote:
> yes, there is a bug alright.
> 
> Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy
> Maynooth University
> Ireland
> 
> On 27 Oct 2017, at 01:39, Steven Yi  wrote:
> 
>> But there's still a problem here I think.
>> 
>> If you run the code on its own outside of the context of UDP (see the
>> test.csd I attached in previous message in this thread) it works just
>> fine.
>> 
>> I think it's good to protect against trying to deref tp when it's
>> NULL, but it seems there's still a bug to fix.
>> 
>> On Thu, Oct 26, 2017 at 7:11 PM, Victor Lazzarini
>>  wrote:
>>> I’ve added an InitError for that case.
>>> ========================
>>> Prof. Victor Lazzarini
>>> Dean of Arts, Celtic Studies, and Philosophy,
>>> Maynooth University,
>>> Maynooth, Co Kildare, Ireland
>>> Tel: 00 353 7086936
>>> Fax: 00 353 1 7086952
>>> 
>>>> On 27 Oct 2017, at 00:03, Victor Lazzarini  wrote:
>>>> 
>>>> It seems it can’t find an instrument. If reduce instr 10000 to  instr 10 it doesn’t crash anymore.
>>>> 
>>>> ========================
>>>> Prof. Victor Lazzarini
>>>> Dean of Arts, Celtic Studies, and Philosophy,
>>>> Maynooth University,
>>>> Maynooth, Co Kildare, Ireland
>>>> Tel: 00 353 7086936
>>>> Fax: 00 353 1 7086952
>>>> 
>>>>> On 27 Oct 2017, at 00:02, Steven Yi  wrote:
>>>>> 
>>>>> Yes, we're on the same page as that's exactly where I had the crash
>>>>> with NULL tp.
>>>>> 
>>>>> On Thu, Oct 26, 2017 at 7:00 PM, Victor Lazzarini
>>>>>  wrote:
>>>>>> I get
>>>>>> 
>>>>>> 1252     if (!p->ip) {
>>>>>> 1253       /* search for already allocated, but not active instance */
>>>>>> 1254       /* if none was found, allocate a new instance */
>>>>>> -> 1255       if (!tp->act_instance)
>>>>>> ========================
>>>>>> Prof. Victor Lazzarini
>>>>>> Dean of Arts, Celtic Studies, and Philosophy,
>>>>>> Maynooth University,
>>>>>> Maynooth, Co Kildare, Ireland
>>>>>> Tel: 00 353 7086936
>>>>>> Fax: 00 353 1 7086952
>>>>>> 
>>>>>>> On 26 Oct 2017, at 22:41, Steven Yi  wrote:
>>>>>>> 
>>>>>>> There's something else I'm seeing that might be a part of this:
>>>>>>> 
>>>>>>> When the program crashes, tp is NULL.  instno is 201 (I think that
>>>>>>> must be assigned to the Chorus UDO).
>>>>>>> 
>>>>>>> If I modify the orc code to make the mixer instrument 100 instead of
>>>>>>> 10000, I don't get a crash.
>>>>>>> 
>>>>>>> If I run the code as a CSD on its own its fine.  (Attached)
>>>>>>> 
>>>>>>> On Thu, Oct 26, 2017 at 5:37 PM, Victor Lazzarini
>>>>>>>  wrote:
>>>>>>>> What is happening is that the message is broken into two pieces and they get compiled separately and so it
>>>>>>>> doesn’t quite work. There is a problem with large bits of code, which I will try to address.
>>>>>>>> ========================
>>>>>>>> Prof. Victor Lazzarini
>>>>>>>> Dean of Arts, Celtic Studies, and Philosophy,
>>>>>>>> Maynooth University,
>>>>>>>> Maynooth, Co Kildare, Ireland
>>>>>>>> Tel: 00 353 7086936
>>>>>>>> Fax: 00 353 1 7086952
>>>>>>>> 
>>>>>>>>> On 26 Oct 2017, at 21:38, Hlöðver Sigurðsson  wrote:
>>>>>>>>> 
>>>>>>>>> from gdb, this message is printed
>>>>>>>>> 
>>>>>>>>> Thread 1 "csound" received signal SIGSEGV, Segmentation fault.
>>>>>>>>> 0x00007ffff7899b8f in useropcdset () from /usr/local/lib/libcsound64.so.6.0
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> On 26 October 2017 at 22:35, Hlöðver Sigurðsson  wrote:
>>>>>>>>> Steps to reproduce
>>>>>>>>> 
>>>>>>>>> 1. Start Csound with `csound -odac --port=6006` (useing dev branch compiled today)
>>>>>>>>> 
>>>>>>>>> 2. Useing Nodejs (Im useing v8.0) send udp messages to the csound instance with this script https://pastebin.com/2GSqXKmP notice `csound command: Segmentation fault`
>>>>>>>>> 
>>>>>>>>> 3. With the same javascript script, delete or comment with semicolons line number 59 (where Chorus opcode is called) and notice that there's no segfault and everything works.
>>>>>>>>> 
>>>>>>>>> 4. Uncomment line 59 and allow it to be, but delete line 63 to 76, and notice that again everything works (and seemingly Chorus had nothing to do with the segfault).
>>>>>>>>> 
>>>>>>>>> I will add that equivalent code works without segfault when running directly from csd file.
>>>>>>>>> 
>>>>>>>> 
>>>>>>> 

Date2017-10-27 18:32
FromVictor Lazzarini
SubjectRe: [Csnd-dev] Segfault with UDP
I think I got this now. The insertion of opcodes was happening at the wrong time in the
compilation. This only applied to compilations after the first one, so that is why it worked
in normal running. 
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 27 Oct 2017, at 14:01, Victor Lazzarini  wrote:
> 
> yes, I think it is to do with merging. I have not had a chance to investigate yet.
> ========================
> Prof. Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952 
> 
>> On 27 Oct 2017, at 09:44, Steven Yi  wrote:
>> 
>> Perhaps there is an issue with merging when there is a large instrument number introduced? Thinking there is a difference between first compile pass and latter ones. (Sidenote: in cs7, we should revisit named instruments having numbers assigned, as one can easily assign a numbered instrument after a named one that redefines the assigned number)
>> On Fri, Oct 27, 2017 at 1:23 AM Victor Lazzarini  wrote:
>> yes, there is a bug alright.
>> 
>> Victor Lazzarini
>> Dean of Arts, Celtic Studies, and Philosophy
>> Maynooth University
>> Ireland
>> 
>> On 27 Oct 2017, at 01:39, Steven Yi  wrote:
>> 
>>> But there's still a problem here I think.
>>> 
>>> If you run the code on its own outside of the context of UDP (see the
>>> test.csd I attached in previous message in this thread) it works just
>>> fine.
>>> 
>>> I think it's good to protect against trying to deref tp when it's
>>> NULL, but it seems there's still a bug to fix.
>>> 
>>> On Thu, Oct 26, 2017 at 7:11 PM, Victor Lazzarini
>>>  wrote:
>>>> I’ve added an InitError for that case.
>>>> ========================
>>>> Prof. Victor Lazzarini
>>>> Dean of Arts, Celtic Studies, and Philosophy,
>>>> Maynooth University,
>>>> Maynooth, Co Kildare, Ireland
>>>> Tel: 00 353 7086936
>>>> Fax: 00 353 1 7086952
>>>> 
>>>>> On 27 Oct 2017, at 00:03, Victor Lazzarini  wrote:
>>>>> 
>>>>> It seems it can’t find an instrument. If reduce instr 10000 to  instr 10 it doesn’t crash anymore.
>>>>> 
>>>>> ========================
>>>>> Prof. Victor Lazzarini
>>>>> Dean of Arts, Celtic Studies, and Philosophy,
>>>>> Maynooth University,
>>>>> Maynooth, Co Kildare, Ireland
>>>>> Tel: 00 353 7086936
>>>>> Fax: 00 353 1 7086952
>>>>> 
>>>>>> On 27 Oct 2017, at 00:02, Steven Yi  wrote:
>>>>>> 
>>>>>> Yes, we're on the same page as that's exactly where I had the crash
>>>>>> with NULL tp.
>>>>>> 
>>>>>> On Thu, Oct 26, 2017 at 7:00 PM, Victor Lazzarini
>>>>>>  wrote:
>>>>>>> I get
>>>>>>> 
>>>>>>> 1252     if (!p->ip) {
>>>>>>> 1253       /* search for already allocated, but not active instance */
>>>>>>> 1254       /* if none was found, allocate a new instance */
>>>>>>> -> 1255       if (!tp->act_instance)
>>>>>>> ========================
>>>>>>> Prof. Victor Lazzarini
>>>>>>> Dean of Arts, Celtic Studies, and Philosophy,
>>>>>>> Maynooth University,
>>>>>>> Maynooth, Co Kildare, Ireland
>>>>>>> Tel: 00 353 7086936
>>>>>>> Fax: 00 353 1 7086952
>>>>>>> 
>>>>>>>> On 26 Oct 2017, at 22:41, Steven Yi  wrote:
>>>>>>>> 
>>>>>>>> There's something else I'm seeing that might be a part of this:
>>>>>>>> 
>>>>>>>> When the program crashes, tp is NULL.  instno is 201 (I think that
>>>>>>>> must be assigned to the Chorus UDO).
>>>>>>>> 
>>>>>>>> If I modify the orc code to make the mixer instrument 100 instead of
>>>>>>>> 10000, I don't get a crash.
>>>>>>>> 
>>>>>>>> If I run the code as a CSD on its own its fine.  (Attached)
>>>>>>>> 
>>>>>>>> On Thu, Oct 26, 2017 at 5:37 PM, Victor Lazzarini
>>>>>>>>  wrote:
>>>>>>>>> What is happening is that the message is broken into two pieces and they get compiled separately and so it
>>>>>>>>> doesn’t quite work. There is a problem with large bits of code, which I will try to address.
>>>>>>>>> ========================
>>>>>>>>> Prof. Victor Lazzarini
>>>>>>>>> Dean of Arts, Celtic Studies, and Philosophy,
>>>>>>>>> Maynooth University,
>>>>>>>>> Maynooth, Co Kildare, Ireland
>>>>>>>>> Tel: 00 353 7086936
>>>>>>>>> Fax: 00 353 1 7086952
>>>>>>>>> 
>>>>>>>>>> On 26 Oct 2017, at 21:38, Hlöðver Sigurðsson  wrote:
>>>>>>>>>> 
>>>>>>>>>> from gdb, this message is printed
>>>>>>>>>> 
>>>>>>>>>> Thread 1 "csound" received signal SIGSEGV, Segmentation fault.
>>>>>>>>>> 0x00007ffff7899b8f in useropcdset () from /usr/local/lib/libcsound64.so.6.0
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> On 26 October 2017 at 22:35, Hlöðver Sigurðsson  wrote:
>>>>>>>>>> Steps to reproduce
>>>>>>>>>> 
>>>>>>>>>> 1. Start Csound with `csound -odac --port=6006` (useing dev branch compiled today)
>>>>>>>>>> 
>>>>>>>>>> 2. Useing Nodejs (Im useing v8.0) send udp messages to the csound instance with this script https://pastebin.com/2GSqXKmP notice `csound command: Segmentation fault`
>>>>>>>>>> 
>>>>>>>>>> 3. With the same javascript script, delete or comment with semicolons line number 59 (where Chorus opcode is called) and notice that there's no segfault and everything works.
>>>>>>>>>> 
>>>>>>>>>> 4. Uncomment line 59 and allow it to be, but delete line 63 to 76, and notice that again everything works (and seemingly Chorus had nothing to do with the segfault).
>>>>>>>>>> 
>>>>>>>>>> I will add that equivalent code works without segfault when running directly from csd file.
>>>>>>>>>> 
>>>>>>>>> 
>>>>>>>> 
>>>>>

Date2017-10-27 21:04
FromSteven Yi
SubjectRe: [Csnd-dev] Segfault with UDP
Tested here on Windows and it's now working great.  (Though, I had to
add aL *= 0dbfs and aR *= 0dbfs in instr 1 to hear anything ;) ).
Nice find!

On Fri, Oct 27, 2017 at 1:32 PM, Victor Lazzarini
 wrote:
> I think I got this now. The insertion of opcodes was happening at the wrong time in the
> compilation. This only applied to compilations after the first one, so that is why it worked
> in normal running.
> ========================
> Prof. Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
>> On 27 Oct 2017, at 14:01, Victor Lazzarini  wrote:
>>
>> yes, I think it is to do with merging. I have not had a chance to investigate yet.
>> ========================
>> Prof. Victor Lazzarini
>> Dean of Arts, Celtic Studies, and Philosophy,
>> Maynooth University,
>> Maynooth, Co Kildare, Ireland
>> Tel: 00 353 7086936
>> Fax: 00 353 1 7086952
>>
>>> On 27 Oct 2017, at 09:44, Steven Yi  wrote:
>>>
>>> Perhaps there is an issue with merging when there is a large instrument number introduced? Thinking there is a difference between first compile pass and latter ones. (Sidenote: in cs7, we should revisit named instruments having numbers assigned, as one can easily assign a numbered instrument after a named one that redefines the assigned number)
>>> On Fri, Oct 27, 2017 at 1:23 AM Victor Lazzarini  wrote:
>>> yes, there is a bug alright.
>>>
>>> Victor Lazzarini
>>> Dean of Arts, Celtic Studies, and Philosophy
>>> Maynooth University
>>> Ireland
>>>
>>> On 27 Oct 2017, at 01:39, Steven Yi  wrote:
>>>
>>>> But there's still a problem here I think.
>>>>
>>>> If you run the code on its own outside of the context of UDP (see the
>>>> test.csd I attached in previous message in this thread) it works just
>>>> fine.
>>>>
>>>> I think it's good to protect against trying to deref tp when it's
>>>> NULL, but it seems there's still a bug to fix.
>>>>
>>>> On Thu, Oct 26, 2017 at 7:11 PM, Victor Lazzarini
>>>>  wrote:
>>>>> I’ve added an InitError for that case.
>>>>> ========================
>>>>> Prof. Victor Lazzarini
>>>>> Dean of Arts, Celtic Studies, and Philosophy,
>>>>> Maynooth University,
>>>>> Maynooth, Co Kildare, Ireland
>>>>> Tel: 00 353 7086936
>>>>> Fax: 00 353 1 7086952
>>>>>
>>>>>> On 27 Oct 2017, at 00:03, Victor Lazzarini  wrote:
>>>>>>
>>>>>> It seems it can’t find an instrument. If reduce instr 10000 to  instr 10 it doesn’t crash anymore.
>>>>>>
>>>>>> ========================
>>>>>> Prof. Victor Lazzarini
>>>>>> Dean of Arts, Celtic Studies, and Philosophy,
>>>>>> Maynooth University,
>>>>>> Maynooth, Co Kildare, Ireland
>>>>>> Tel: 00 353 7086936
>>>>>> Fax: 00 353 1 7086952
>>>>>>
>>>>>>> On 27 Oct 2017, at 00:02, Steven Yi  wrote:
>>>>>>>
>>>>>>> Yes, we're on the same page as that's exactly where I had the crash
>>>>>>> with NULL tp.
>>>>>>>
>>>>>>> On Thu, Oct 26, 2017 at 7:00 PM, Victor Lazzarini
>>>>>>>  wrote:
>>>>>>>> I get
>>>>>>>>
>>>>>>>> 1252     if (!p->ip) {
>>>>>>>> 1253       /* search for already allocated, but not active instance */
>>>>>>>> 1254       /* if none was found, allocate a new instance */
>>>>>>>> -> 1255       if (!tp->act_instance)
>>>>>>>> ========================
>>>>>>>> Prof. Victor Lazzarini
>>>>>>>> Dean of Arts, Celtic Studies, and Philosophy,
>>>>>>>> Maynooth University,
>>>>>>>> Maynooth, Co Kildare, Ireland
>>>>>>>> Tel: 00 353 7086936
>>>>>>>> Fax: 00 353 1 7086952
>>>>>>>>
>>>>>>>>> On 26 Oct 2017, at 22:41, Steven Yi  wrote:
>>>>>>>>>
>>>>>>>>> There's something else I'm seeing that might be a part of this:
>>>>>>>>>
>>>>>>>>> When the program crashes, tp is NULL.  instno is 201 (I think that
>>>>>>>>> must be assigned to the Chorus UDO).
>>>>>>>>>
>>>>>>>>> If I modify the orc code to make the mixer instrument 100 instead of
>>>>>>>>> 10000, I don't get a crash.
>>>>>>>>>
>>>>>>>>> If I run the code as a CSD on its own its fine.  (Attached)
>>>>>>>>>
>>>>>>>>> On Thu, Oct 26, 2017 at 5:37 PM, Victor Lazzarini
>>>>>>>>>  wrote:
>>>>>>>>>> What is happening is that the message is broken into two pieces and they get compiled separately and so it
>>>>>>>>>> doesn’t quite work. There is a problem with large bits of code, which I will try to address.
>>>>>>>>>> ========================
>>>>>>>>>> Prof. Victor Lazzarini
>>>>>>>>>> Dean of Arts, Celtic Studies, and Philosophy,
>>>>>>>>>> Maynooth University,
>>>>>>>>>> Maynooth, Co Kildare, Ireland
>>>>>>>>>> Tel: 00 353 7086936
>>>>>>>>>> Fax: 00 353 1 7086952
>>>>>>>>>>
>>>>>>>>>>> On 26 Oct 2017, at 21:38, Hlöðver Sigurðsson  wrote:
>>>>>>>>>>>
>>>>>>>>>>> from gdb, this message is printed
>>>>>>>>>>>
>>>>>>>>>>> Thread 1 "csound" received signal SIGSEGV, Segmentation fault.
>>>>>>>>>>> 0x00007ffff7899b8f in useropcdset () from /usr/local/lib/libcsound64.so.6.0
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On 26 October 2017 at 22:35, Hlöðver Sigurðsson  wrote:
>>>>>>>>>>> Steps to reproduce
>>>>>>>>>>>
>>>>>>>>>>> 1. Start Csound with `csound -odac --port=6006` (useing dev branch compiled today)
>>>>>>>>>>>
>>>>>>>>>>> 2. Useing Nodejs (Im useing v8.0) send udp messages to the csound instance with this script https://pastebin.com/2GSqXKmP notice `csound command: Segmentation fault`
>>>>>>>>>>>
>>>>>>>>>>> 3. With the same javascript script, delete or comment with semicolons line number 59 (where Chorus opcode is called) and notice that there's no segfault and everything works.
>>>>>>>>>>>
>>>>>>>>>>> 4. Uncomment line 59 and allow it to be, but delete line 63 to 76, and notice that again everything works (and seemingly Chorus had nothing to do with the segfault).
>>>>>>>>>>>
>>>>>>>>>>> I will add that equivalent code works without segfault when running directly from csd file.
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>> 
>>>>>>>>
>>>>>>
>>>>>
>>

Date2017-10-27 22:02
FromVictor Lazzarini
SubjectRe: [Csnd-dev] Segfault with UDP
Thanks for confirming. The clue was in checking how the first compilation behaved
differently and then I spotted the out-of-order operation.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 27 Oct 2017, at 21:05, Steven Yi <stevenyi@GMAIL.COM> wrote:

Tested here on Windows and it's now working great.  (Though, I had to
add aL *= 0dbfs and aR *= 0dbfs in instr 1 to hear anything ;) ).
Nice find!

On Fri, Oct 27, 2017 at 1:32 PM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
I think I got this now. The insertion of opcodes was happening at the wrong time in the
compilation. This only applied to compilations after the first one, so that is why it worked
in normal running.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 27 Oct 2017, at 14:01, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:

yes, I think it is to do with merging. I have not had a chance to investigate yet.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 27 Oct 2017, at 09:44, Steven Yi <stevenyi@gmail.com> wrote:

Perhaps there is an issue with merging when there is a large instrument number introduced? Thinking there is a difference between first compile pass and latter ones. (Sidenote: in cs7, we should revisit named instruments having numbers assigned, as one can easily assign a numbered instrument after a named one that redefines the assigned number)
On Fri, Oct 27, 2017 at 1:23 AM Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
yes, there is a bug alright.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 27 Oct 2017, at 01:39, Steven Yi <stevenyi@GMAIL.COM> wrote:

But there's still a problem here I think.

If you run the code on its own outside of the context of UDP (see the
test.csd I attached in previous message in this thread) it works just
fine.

I think it's good to protect against trying to deref tp when it's
NULL, but it seems there's still a bug to fix.

On Thu, Oct 26, 2017 at 7:11 PM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
I’ve added an InitError for that case.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 27 Oct 2017, at 00:03, Victor Lazzarini <Victor.Lazzarini@MU.IE> wrote:

It seems it can’t find an instrument. If reduce instr 10000 to  instr 10 it doesn’t crash anymore.

========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 27 Oct 2017, at 00:02, Steven Yi <stevenyi@GMAIL.COM> wrote:

Yes, we're on the same page as that's exactly where I had the crash
with NULL tp.

On Thu, Oct 26, 2017 at 7:00 PM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
I get

1252     if (!p->ip) {
1253       /* search for already allocated, but not active instance */
1254       /* if none was found, allocate a new instance */
-> 1255       if (!tp->act_instance)
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 26 Oct 2017, at 22:41, Steven Yi <stevenyi@gmail.com> wrote:

There's something else I'm seeing that might be a part of this:

When the program crashes, tp is NULL.  instno is 201 (I think that
must be assigned to the Chorus UDO).

If I modify the orc code to make the mixer instrument 100 instead of
10000, I don't get a crash.

If I run the code as a CSD on its own its fine.  (Attached)

On Thu, Oct 26, 2017 at 5:37 PM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
What is happening is that the message is broken into two pieces and they get compiled separately and so it
doesn’t quite work. There is a problem with large bits of code, which I will try to address.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 26 Oct 2017, at 21:38, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:

from gdb, this message is printed

Thread 1 "csound" received signal SIGSEGV, Segmentation fault.
0x00007ffff7899b8f in useropcdset () from /usr/local/lib/libcsound64.so.6.0


On 26 October 2017 at 22:35, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
Steps to reproduce

1. Start Csound with `csound -odac --port=6006` (useing dev branch compiled today)

2. Useing Nodejs (Im useing v8.0) send udp messages to the csound instance with this script https://pastebin.com/2GSqXKmP notice `csound command: Segmentation fault`

3. With the same javascript script, delete or comment with semicolons line number 59 (where Chorus opcode is called) and notice that there's no segfault and everything works.

4. Uncomment line 59 and allow it to be, but delete line 63 to 76, and notice that again everything works (and seemingly Chorus had nothing to do with the segfault).

I will add that equivalent code works without segfault when running directly from csd file.


<test.csd>






Date2017-10-28 11:33
FromHlöðver Sigurðsson
SubjectRe: [Csnd-dev] Segfault with UDP
confirmed here too, no segfault anymore, works perfectly!

Thanks for fixing this so quickly

On 27 October 2017 at 23:02, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
Thanks for confirming. The clue was in checking how the first compilation behaved
differently and then I spotted the out-of-order operation.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 27 Oct 2017, at 21:05, Steven Yi <stevenyi@GMAIL.COM> wrote:

Tested here on Windows and it's now working great.  (Though, I had to
add aL *= 0dbfs and aR *= 0dbfs in instr 1 to hear anything ;) ).
Nice find!

On Fri, Oct 27, 2017 at 1:32 PM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
I think I got this now. The insertion of opcodes was happening at the wrong time in the
compilation. This only applied to compilations after the first one, so that is why it worked
in normal running.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 27 Oct 2017, at 14:01, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:

yes, I think it is to do with merging. I have not had a chance to investigate yet.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 27 Oct 2017, at 09:44, Steven Yi <stevenyi@gmail.com> wrote:

Perhaps there is an issue with merging when there is a large instrument number introduced? Thinking there is a difference between first compile pass and latter ones. (Sidenote: in cs7, we should revisit named instruments having numbers assigned, as one can easily assign a numbered instrument after a named one that redefines the assigned number)
On Fri, Oct 27, 2017 at 1:23 AM Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
yes, there is a bug alright.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 27 Oct 2017, at 01:39, Steven Yi <stevenyi@GMAIL.COM> wrote:

But there's still a problem here I think.

If you run the code on its own outside of the context of UDP (see the
test.csd I attached in previous message in this thread) it works just
fine.

I think it's good to protect against trying to deref tp when it's
NULL, but it seems there's still a bug to fix.

On Thu, Oct 26, 2017 at 7:11 PM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
I’ve added an InitError for that case.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 27 Oct 2017, at 00:03, Victor Lazzarini <Victor.Lazzarini@MU.IE> wrote:

It seems it can’t find an instrument. If reduce instr 10000 to  instr 10 it doesn’t crash anymore.

========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 27 Oct 2017, at 00:02, Steven Yi <stevenyi@GMAIL.COM> wrote:

Yes, we're on the same page as that's exactly where I had the crash
with NULL tp.

On Thu, Oct 26, 2017 at 7:00 PM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
I get

1252     if (!p->ip) {
1253       /* search for already allocated, but not active instance */
1254       /* if none was found, allocate a new instance */
-> 1255       if (!tp->act_instance)
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 26 Oct 2017, at 22:41, Steven Yi <stevenyi@gmail.com> wrote:

There's something else I'm seeing that might be a part of this:

When the program crashes, tp is NULL.  instno is 201 (I think that
must be assigned to the Chorus UDO).

If I modify the orc code to make the mixer instrument 100 instead of
10000, I don't get a crash.

If I run the code as a CSD on its own its fine.  (Attached)

On Thu, Oct 26, 2017 at 5:37 PM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
What is happening is that the message is broken into two pieces and they get compiled separately and so it
doesn’t quite work. There is a problem with large bits of code, which I will try to address.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 26 Oct 2017, at 21:38, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:

from gdb, this message is printed

Thread 1 "csound" received signal SIGSEGV, Segmentation fault.
0x00007ffff7899b8f in useropcdset () from /usr/local/lib/libcsound64.so.6.0


On 26 October 2017 at 22:35, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
Steps to reproduce

1. Start Csound with `csound -odac --port=6006` (useing dev branch compiled today)

2. Useing Nodejs (Im useing v8.0) send udp messages to the csound instance with this script https://pastebin.com/2GSqXKmP notice `csound command: Segmentation fault`

3. With the same javascript script, delete or comment with semicolons line number 59 (where Chorus opcode is called) and notice that there's no segfault and everything works.

4. Uncomment line 59 and allow it to be, but delete line 63 to 76, and notice that again everything works (and seemingly Chorus had nothing to do with the segfault).

I will add that equivalent code works without segfault when running directly from csd file.


<test.csd>







Date2017-10-28 13:39
FromHlöðver Sigurðsson
SubjectRe: [Csnd-dev] Segfault with UDP
I'm still getting segfaults, now with tables, I'm trying to create a reproduceable example, but what I'm getting is this


INIT ERROR in instr 27 (opcode Flanger_stereo): Invalid ftable no. 0.000000
amod oscili.a kdepth krate giParabola 0
INIT ERROR in instr 27 (opcode Flanger_stereo): Invalid ftable no. 0.000000
amod oscili.a kdepth krate giSine 0
INIT ERROR in instr 27 (opcode Flanger_stereo): Invalid ftable no. 0.000000
amod oscili.a kdepth krate giTriangle 0

csound command: Segmentation fault


On 28 October 2017 at 12:33, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
confirmed here too, no segfault anymore, works perfectly!

Thanks for fixing this so quickly

On 27 October 2017 at 23:02, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
Thanks for confirming. The clue was in checking how the first compilation behaved
differently and then I spotted the out-of-order operation.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 27 Oct 2017, at 21:05, Steven Yi <stevenyi@GMAIL.COM> wrote:

Tested here on Windows and it's now working great.  (Though, I had to
add aL *= 0dbfs and aR *= 0dbfs in instr 1 to hear anything ;) ).
Nice find!

On Fri, Oct 27, 2017 at 1:32 PM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
I think I got this now. The insertion of opcodes was happening at the wrong time in the
compilation. This only applied to compilations after the first one, so that is why it worked
in normal running.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 27 Oct 2017, at 14:01, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:

yes, I think it is to do with merging. I have not had a chance to investigate yet.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 27 Oct 2017, at 09:44, Steven Yi <stevenyi@gmail.com> wrote:

Perhaps there is an issue with merging when there is a large instrument number introduced? Thinking there is a difference between first compile pass and latter ones. (Sidenote: in cs7, we should revisit named instruments having numbers assigned, as one can easily assign a numbered instrument after a named one that redefines the assigned number)
On Fri, Oct 27, 2017 at 1:23 AM Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
yes, there is a bug alright.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 27 Oct 2017, at 01:39, Steven Yi <stevenyi@GMAIL.COM> wrote:

But there's still a problem here I think.

If you run the code on its own outside of the context of UDP (see the
test.csd I attached in previous message in this thread) it works just
fine.

I think it's good to protect against trying to deref tp when it's
NULL, but it seems there's still a bug to fix.

On Thu, Oct 26, 2017 at 7:11 PM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
I’ve added an InitError for that case.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 27 Oct 2017, at 00:03, Victor Lazzarini <Victor.Lazzarini@MU.IE> wrote:

It seems it can’t find an instrument. If reduce instr 10000 to  instr 10 it doesn’t crash anymore.

========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 27 Oct 2017, at 00:02, Steven Yi <stevenyi@GMAIL.COM> wrote:

Yes, we're on the same page as that's exactly where I had the crash
with NULL tp.

On Thu, Oct 26, 2017 at 7:00 PM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
I get

1252     if (!p->ip) {
1253       /* search for already allocated, but not active instance */
1254       /* if none was found, allocate a new instance */
-> 1255       if (!tp->act_instance)
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 26 Oct 2017, at 22:41, Steven Yi <stevenyi@gmail.com> wrote:

There's something else I'm seeing that might be a part of this:

When the program crashes, tp is NULL.  instno is 201 (I think that
must be assigned to the Chorus UDO).

If I modify the orc code to make the mixer instrument 100 instead of
10000, I don't get a crash.

If I run the code as a CSD on its own its fine.  (Attached)

On Thu, Oct 26, 2017 at 5:37 PM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
What is happening is that the message is broken into two pieces and they get compiled separately and so it
doesn’t quite work. There is a problem with large bits of code, which I will try to address.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 26 Oct 2017, at 21:38, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:

from gdb, this message is printed

Thread 1 "csound" received signal SIGSEGV, Segmentation fault.
0x00007ffff7899b8f in useropcdset () from /usr/local/lib/libcsound64.so.6.0


On 26 October 2017 at 22:35, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
Steps to reproduce

1. Start Csound with `csound -odac --port=6006` (useing dev branch compiled today)

2. Useing Nodejs (Im useing v8.0) send udp messages to the csound instance with this script https://pastebin.com/2GSqXKmP notice `csound command: Segmentation fault`

3. With the same javascript script, delete or comment with semicolons line number 59 (where Chorus opcode is called) and notice that there's no segfault and everything works.

4. Uncomment line 59 and allow it to be, but delete line 63 to 76, and notice that again everything works (and seemingly Chorus had nothing to do with the segfault).

I will add that equivalent code works without segfault when running directly from csd file.


<test.csd>








Date2017-10-28 14:01
FromHlöðver Sigurðsson
SubjectRe: [Csnd-dev] Segfault with UDP
Also this pops up randomly

INIT ERROR in instr 27 (opcode Chorus): Min and max the same
aChoL ntrpol.a aChoL aCho1 iwidth 0 1
INIT ERROR in instr 27 (opcode Chorus): Min and max the same
aChoR ntrpol.a aChoR aCho2 iwidth 0 1
INIT ERROR in instr 27 (opcode Chorus): Min and max the same
aoutL ntrpol.a #a29 #a30 iwet 0 1
INIT ERROR in instr 27 (opcode Chorus): Min and max the same
aoutR ntrpol.a #a31 #a32 iwet 0 1

csound command: Segmentation fault

maybe due to iwidth and iwet are the same value here?

  aChoL ntrpol aChoL,aCho1,iwidth
  aChoR ntrpol aChoR,aCho2,iwidth
  aoutL ntrpol ainL*0.6, aChoL*0.6, iwet
  aoutR ntrpol ainR*0.6, aChoR*0.6, iwet

Just thinking out loud, will post reproduceable example when I'm able to make one.

On 28 October 2017 at 14:39, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
I'm still getting segfaults, now with tables, I'm trying to create a reproduceable example, but what I'm getting is this


INIT ERROR in instr 27 (opcode Flanger_stereo): Invalid ftable no. 0.000000
amod oscili.a kdepth krate giParabola 0
INIT ERROR in instr 27 (opcode Flanger_stereo): Invalid ftable no. 0.000000
amod oscili.a kdepth krate giSine 0
INIT ERROR in instr 27 (opcode Flanger_stereo): Invalid ftable no. 0.000000
amod oscili.a kdepth krate giTriangle 0

csound command: Segmentation fault


On 28 October 2017 at 12:33, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
confirmed here too, no segfault anymore, works perfectly!

Thanks for fixing this so quickly

On 27 October 2017 at 23:02, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
Thanks for confirming. The clue was in checking how the first compilation behaved
differently and then I spotted the out-of-order operation.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 27 Oct 2017, at 21:05, Steven Yi <stevenyi@GMAIL.COM> wrote:

Tested here on Windows and it's now working great.  (Though, I had to
add aL *= 0dbfs and aR *= 0dbfs in instr 1 to hear anything ;) ).
Nice find!

On Fri, Oct 27, 2017 at 1:32 PM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
I think I got this now. The insertion of opcodes was happening at the wrong time in the
compilation. This only applied to compilations after the first one, so that is why it worked
in normal running.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 27 Oct 2017, at 14:01, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:

yes, I think it is to do with merging. I have not had a chance to investigate yet.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 27 Oct 2017, at 09:44, Steven Yi <stevenyi@gmail.com> wrote:

Perhaps there is an issue with merging when there is a large instrument number introduced? Thinking there is a difference between first compile pass and latter ones. (Sidenote: in cs7, we should revisit named instruments having numbers assigned, as one can easily assign a numbered instrument after a named one that redefines the assigned number)
On Fri, Oct 27, 2017 at 1:23 AM Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
yes, there is a bug alright.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 27 Oct 2017, at 01:39, Steven Yi <stevenyi@GMAIL.COM> wrote:

But there's still a problem here I think.

If you run the code on its own outside of the context of UDP (see the
test.csd I attached in previous message in this thread) it works just
fine.

I think it's good to protect against trying to deref tp when it's
NULL, but it seems there's still a bug to fix.

On Thu, Oct 26, 2017 at 7:11 PM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
I’ve added an InitError for that case.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 27 Oct 2017, at 00:03, Victor Lazzarini <Victor.Lazzarini@MU.IE> wrote:

It seems it can’t find an instrument. If reduce instr 10000 to  instr 10 it doesn’t crash anymore.

========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 27 Oct 2017, at 00:02, Steven Yi <stevenyi@GMAIL.COM> wrote:

Yes, we're on the same page as that's exactly where I had the crash
with NULL tp.

On Thu, Oct 26, 2017 at 7:00 PM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
I get

1252     if (!p->ip) {
1253       /* search for already allocated, but not active instance */
1254       /* if none was found, allocate a new instance */
-> 1255       if (!tp->act_instance)
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 26 Oct 2017, at 22:41, Steven Yi <stevenyi@gmail.com> wrote:

There's something else I'm seeing that might be a part of this:

When the program crashes, tp is NULL.  instno is 201 (I think that
must be assigned to the Chorus UDO).

If I modify the orc code to make the mixer instrument 100 instead of
10000, I don't get a crash.

If I run the code as a CSD on its own its fine.  (Attached)

On Thu, Oct 26, 2017 at 5:37 PM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
What is happening is that the message is broken into two pieces and they get compiled separately and so it
doesn’t quite work. There is a problem with large bits of code, which I will try to address.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 26 Oct 2017, at 21:38, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:

from gdb, this message is printed

Thread 1 "csound" received signal SIGSEGV, Segmentation fault.
0x00007ffff7899b8f in useropcdset () from /usr/local/lib/libcsound64.so.6.0


On 26 October 2017 at 22:35, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
Steps to reproduce

1. Start Csound with `csound -odac --port=6006` (useing dev branch compiled today)

2. Useing Nodejs (Im useing v8.0) send udp messages to the csound instance with this script https://pastebin.com/2GSqXKmP notice `csound command: Segmentation fault`

3. With the same javascript script, delete or comment with semicolons line number 59 (where Chorus opcode is called) and notice that there's no segfault and everything works.

4. Uncomment line 59 and allow it to be, but delete line 63 to 76, and notice that again everything works (and seemingly Chorus had nothing to do with the segfault).

I will add that equivalent code works without segfault when running directly from csd file.


<test.csd>









Date2017-10-28 15:10
FromHlöðver Sigurðsson
SubjectRe: [Csnd-dev] Segfault with UDP
With the Chorus instrument I'm getting

Thread 1 "csound" received signal SIGSEGV, Segmentation fault.
0x00007ffff789a37d in useropcdset ()

But flanger it's:

new alloc for instr 27:
INIT ERROR in instr 27 (opcode Flanger_stereo): Invalid ftable no. 0.000000
amod oscili.a kdepth krate giParabola 0
INIT ERROR in instr 27 (opcode Flanger_stereo): Invalid ftable no. 0.000000
amod oscili.a kdepth krate giSine 0
INIT ERROR in instr 27 (opcode Flanger_stereo): Invalid ftable no. 0.000000
amod oscili.a kdepth krate giTriangle 0

Thread 1 "csound" received signal SIGSEGV, Segmentation fault.
0x00007ffff78a10b4 in mfree () from /usr/local/lib/libcsound64.so.6.0

Still unable to reproduce it, could be from these ftgen statements (there are almost 300 samples)

gi_ ftgen 1000,0,0,1,"/home/hlolli/.samples/stl-texture/014.wav",0,0,0
gi_ ftgen 1001,0,0,1,"/home/hlolli/.samples/stl-texture/stl_texture_1.wav",0,0,0
gi_ ftgen 1002,0,0,1,"/home/hlolli/.samples/stl-texture/stl_texture_10.wav",0,0,0
gi_ ftgen 1003,0,0,1,"/home/hlolli/.samples/stl-texture/stl_texture_11.wav",0,0,0
gi_ ftgen 1004,0,0,1,"/home/hlolli/.samples/stl-texture/stl_texture_12.wav",0,0,0



On 28 October 2017 at 15:01, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
Also this pops up randomly

INIT ERROR in instr 27 (opcode Chorus): Min and max the same
aChoL ntrpol.a aChoL aCho1 iwidth 0 1
INIT ERROR in instr 27 (opcode Chorus): Min and max the same
aChoR ntrpol.a aChoR aCho2 iwidth 0 1
INIT ERROR in instr 27 (opcode Chorus): Min and max the same
aoutL ntrpol.a #a29 #a30 iwet 0 1
INIT ERROR in instr 27 (opcode Chorus): Min and max the same
aoutR ntrpol.a #a31 #a32 iwet 0 1

csound command: Segmentation fault

maybe due to iwidth and iwet are the same value here?

  aChoL ntrpol aChoL,aCho1,iwidth
  aChoR ntrpol aChoR,aCho2,iwidth
  aoutL ntrpol ainL*0.6, aChoL*0.6, iwet
  aoutR ntrpol ainR*0.6, aChoR*0.6, iwet

Just thinking out loud, will post reproduceable example when I'm able to make one.

On 28 October 2017 at 14:39, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
I'm still getting segfaults, now with tables, I'm trying to create a reproduceable example, but what I'm getting is this


INIT ERROR in instr 27 (opcode Flanger_stereo): Invalid ftable no. 0.000000
amod oscili.a kdepth krate giParabola 0
INIT ERROR in instr 27 (opcode Flanger_stereo): Invalid ftable no. 0.000000
amod oscili.a kdepth krate giSine 0
INIT ERROR in instr 27 (opcode Flanger_stereo): Invalid ftable no. 0.000000
amod oscili.a kdepth krate giTriangle 0

csound command: Segmentation fault


On 28 October 2017 at 12:33, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
confirmed here too, no segfault anymore, works perfectly!

Thanks for fixing this so quickly

On 27 October 2017 at 23:02, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
Thanks for confirming. The clue was in checking how the first compilation behaved
differently and then I spotted the out-of-order operation.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 27 Oct 2017, at 21:05, Steven Yi <stevenyi@GMAIL.COM> wrote:

Tested here on Windows and it's now working great.  (Though, I had to
add aL *= 0dbfs and aR *= 0dbfs in instr 1 to hear anything ;) ).
Nice find!

On Fri, Oct 27, 2017 at 1:32 PM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
I think I got this now. The insertion of opcodes was happening at the wrong time in the
compilation. This only applied to compilations after the first one, so that is why it worked
in normal running.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 27 Oct 2017, at 14:01, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:

yes, I think it is to do with merging. I have not had a chance to investigate yet.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 27 Oct 2017, at 09:44, Steven Yi <stevenyi@gmail.com> wrote:

Perhaps there is an issue with merging when there is a large instrument number introduced? Thinking there is a difference between first compile pass and latter ones. (Sidenote: in cs7, we should revisit named instruments having numbers assigned, as one can easily assign a numbered instrument after a named one that redefines the assigned number)
On Fri, Oct 27, 2017 at 1:23 AM Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
yes, there is a bug alright.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 27 Oct 2017, at 01:39, Steven Yi <stevenyi@GMAIL.COM> wrote:

But there's still a problem here I think.

If you run the code on its own outside of the context of UDP (see the
test.csd I attached in previous message in this thread) it works just
fine.

I think it's good to protect against trying to deref tp when it's
NULL, but it seems there's still a bug to fix.

On Thu, Oct 26, 2017 at 7:11 PM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
I’ve added an InitError for that case.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 27 Oct 2017, at 00:03, Victor Lazzarini <Victor.Lazzarini@MU.IE> wrote:

It seems it can’t find an instrument. If reduce instr 10000 to  instr 10 it doesn’t crash anymore.

========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 27 Oct 2017, at 00:02, Steven Yi <stevenyi@GMAIL.COM> wrote:

Yes, we're on the same page as that's exactly where I had the crash
with NULL tp.

On Thu, Oct 26, 2017 at 7:00 PM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
I get

1252     if (!p->ip) {
1253       /* search for already allocated, but not active instance */
1254       /* if none was found, allocate a new instance */
-> 1255       if (!tp->act_instance)
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 26 Oct 2017, at 22:41, Steven Yi <stevenyi@gmail.com> wrote:

There's something else I'm seeing that might be a part of this:

When the program crashes, tp is NULL.  instno is 201 (I think that
must be assigned to the Chorus UDO).

If I modify the orc code to make the mixer instrument 100 instead of
10000, I don't get a crash.

If I run the code as a CSD on its own its fine.  (Attached)

On Thu, Oct 26, 2017 at 5:37 PM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
What is happening is that the message is broken into two pieces and they get compiled separately and so it
doesn’t quite work. There is a problem with large bits of code, which I will try to address.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 26 Oct 2017, at 21:38, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:

from gdb, this message is printed

Thread 1 "csound" received signal SIGSEGV, Segmentation fault.
0x00007ffff7899b8f in useropcdset () from /usr/local/lib/libcsound64.so.6.0


On 26 October 2017 at 22:35, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
Steps to reproduce

1. Start Csound with `csound -odac --port=6006` (useing dev branch compiled today)

2. Useing Nodejs (Im useing v8.0) send udp messages to the csound instance with this script https://pastebin.com/2GSqXKmP notice `csound command: Segmentation fault`

3. With the same javascript script, delete or comment with semicolons line number 59 (where Chorus opcode is called) and notice that there's no segfault and everything works.

4. Uncomment line 59 and allow it to be, but delete line 63 to 76, and notice that again everything works (and seemingly Chorus had nothing to do with the segfault).

I will add that equivalent code works without segfault when running directly from csd file.


<test.csd>










Date2017-10-28 16:30
FromVictor Lazzarini
SubjectRe: [Csnd-dev] Segfault with UDP
 best send us the code 

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 28 Oct 2017, at 14:01, Hlöðver Sigurðsson <hlolli@GMAIL.COM> wrote:

Also this pops up randomly

INIT ERROR in instr 27 (opcode Chorus): Min and max the same
aChoL ntrpol.a aChoL aCho1 iwidth 0 1
INIT ERROR in instr 27 (opcode Chorus): Min and max the same
aChoR ntrpol.a aChoR aCho2 iwidth 0 1
INIT ERROR in instr 27 (opcode Chorus): Min and max the same
aoutL ntrpol.a #a29 #a30 iwet 0 1
INIT ERROR in instr 27 (opcode Chorus): Min and max the same
aoutR ntrpol.a #a31 #a32 iwet 0 1

csound command: Segmentation fault

maybe due to iwidth and iwet are the same value here?

  aChoL ntrpol aChoL,aCho1,iwidth
  aChoR ntrpol aChoR,aCho2,iwidth
  aoutL ntrpol ainL*0.6, aChoL*0.6, iwet
  aoutR ntrpol ainR*0.6, aChoR*0.6, iwet

Just thinking out loud, will post reproduceable example when I'm able to make one.

On 28 October 2017 at 14:39, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
I'm still getting segfaults, now with tables, I'm trying to create a reproduceable example, but what I'm getting is this


INIT ERROR in instr 27 (opcode Flanger_stereo): Invalid ftable no. 0.000000
amod oscili.a kdepth krate giParabola 0
INIT ERROR in instr 27 (opcode Flanger_stereo): Invalid ftable no. 0.000000
amod oscili.a kdepth krate giSine 0
INIT ERROR in instr 27 (opcode Flanger_stereo): Invalid ftable no. 0.000000
amod oscili.a kdepth krate giTriangle 0

csound command: Segmentation fault


On 28 October 2017 at 12:33, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
confirmed here too, no segfault anymore, works perfectly!

Thanks for fixing this so quickly

On 27 October 2017 at 23:02, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
Thanks for confirming. The clue was in checking how the first compilation behaved
differently and then I spotted the out-of-order operation.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 27 Oct 2017, at 21:05, Steven Yi <stevenyi@GMAIL.COM> wrote:

Tested here on Windows and it's now working great.  (Though, I had to
add aL *= 0dbfs and aR *= 0dbfs in instr 1 to hear anything ;) ).
Nice find!

On Fri, Oct 27, 2017 at 1:32 PM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
I think I got this now. The insertion of opcodes was happening at the wrong time in the
compilation. This only applied to compilations after the first one, so that is why it worked
in normal running.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 27 Oct 2017, at 14:01, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:

yes, I think it is to do with merging. I have not had a chance to investigate yet.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 27 Oct 2017, at 09:44, Steven Yi <stevenyi@gmail.com> wrote:

Perhaps there is an issue with merging when there is a large instrument number introduced? Thinking there is a difference between first compile pass and latter ones. (Sidenote: in cs7, we should revisit named instruments having numbers assigned, as one can easily assign a numbered instrument after a named one that redefines the assigned number)
On Fri, Oct 27, 2017 at 1:23 AM Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
yes, there is a bug alright.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 27 Oct 2017, at 01:39, Steven Yi <stevenyi@GMAIL.COM> wrote:

But there's still a problem here I think.

If you run the code on its own outside of the context of UDP (see the
test.csd I attached in previous message in this thread) it works just
fine.

I think it's good to protect against trying to deref tp when it's
NULL, but it seems there's still a bug to fix.

On Thu, Oct 26, 2017 at 7:11 PM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
I’ve added an InitError for that case.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 27 Oct 2017, at 00:03, Victor Lazzarini <Victor.Lazzarini@MU.IE> wrote:

It seems it can’t find an instrument. If reduce instr 10000 to  instr 10 it doesn’t crash anymore.

========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 27 Oct 2017, at 00:02, Steven Yi <stevenyi@GMAIL.COM> wrote:

Yes, we're on the same page as that's exactly where I had the crash
with NULL tp.

On Thu, Oct 26, 2017 at 7:00 PM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
I get

1252     if (!p->ip) {
1253       /* search for already allocated, but not active instance */
1254       /* if none was found, allocate a new instance */
-> 1255       if (!tp->act_instance)
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 26 Oct 2017, at 22:41, Steven Yi <stevenyi@gmail.com> wrote:

There's something else I'm seeing that might be a part of this:

When the program crashes, tp is NULL.  instno is 201 (I think that
must be assigned to the Chorus UDO).

If I modify the orc code to make the mixer instrument 100 instead of
10000, I don't get a crash.

If I run the code as a CSD on its own its fine.  (Attached)

On Thu, Oct 26, 2017 at 5:37 PM, Victor Lazzarini
<Victor.Lazzarini@mu.ie> wrote:
What is happening is that the message is broken into two pieces and they get compiled separately and so it
doesn’t quite work. There is a problem with large bits of code, which I will try to address.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 26 Oct 2017, at 21:38, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:

from gdb, this message is printed

Thread 1 "csound" received signal SIGSEGV, Segmentation fault.
0x00007ffff7899b8f in useropcdset () from /usr/local/lib/libcsound64.so.6.0


On 26 October 2017 at 22:35, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
Steps to reproduce

1. Start Csound with `csound -odac --port=6006` (useing dev branch compiled today)

2. Useing Nodejs (Im useing v8.0) send udp messages to the csound instance with this script https://pastebin.com/2GSqXKmP notice `csound command: Segmentation fault`

3. With the same javascript script, delete or comment with semicolons line number 59 (where Chorus opcode is called) and notice that there's no segfault and everything works.

4. Uncomment line 59 and allow it to be, but delete line 63 to 76, and notice that again everything works (and seemingly Chorus had nothing to do with the segfault).

I will add that equivalent code works without segfault when running directly from csd file.


<test.csd>









Date2017-10-28 20:19
Fromjpff
SubjectRe: [Csnd-dev] Segfault with UDP

On Sat, 28 Oct 2017, Hlöðver Sigurðsson wrote:

> With the Chorus instrument I'm getting
> 
> Thread 1 "csound" received signal SIGSEGV, Segmentation fault.
> 0x00007ffff789a37d in useropcdset ()
> 
> But flanger it's:
> 
> new alloc for instr 27:
> INIT ERROR in instr 27 (opcode Flanger_stereo): Invalid ftable no. 0.000000
> amod oscili.a kdepth krate giParabola 0
> INIT ERROR in instr 27 (opcode Flanger_stereo): Invalid ftable no. 0.000000
> amod oscili.a kdepth krate giSine 0
> INIT ERROR in instr 27 (opcode Flanger_stereo): Invalid ftable no. 0.000000
> amod oscili.a kdepth krate giTriangle 0

The obvious explanation is that giParabola and similar have had their values 
zapped to zero, or you assigned something like that.  Are these set in 
instr0?  If so do you get this problem if they are set in a declared 
instrument?

resetting values to zero would also explain the max/mi issue

Date2017-10-29 12:29
FromHlöðver Sigurðsson
SubjectRe: [Csnd-dev] Segfault with UDP
Ok good news, I declare these problems solved. I made a mistake, which is when I thought I was setting timeout between large blocks of orchestra code, then what was really happening, the thousands of lines of orchestra code was being fired at the same time, and some tables were being defined later on, it was basically a large cocktail of synchronous events to an async client. It seems very stable when I add delay between every orchestra code block on startup.

On 28 October 2017 at 21:19, jpff <jpff@codemist.co.uk> wrote:


On Sat, 28 Oct 2017, Hlöðver Sigurðsson wrote:

With the Chorus instrument I'm getting

Thread 1 "csound" received signal SIGSEGV, Segmentation fault.
0x00007ffff789a37d in useropcdset ()

But flanger it's:

new alloc for instr 27:
INIT ERROR in instr 27 (opcode Flanger_stereo): Invalid ftable no. 0.000000
amod oscili.a kdepth krate giParabola 0
INIT ERROR in instr 27 (opcode Flanger_stereo): Invalid ftable no. 0.000000
amod oscili.a kdepth krate giSine 0
INIT ERROR in instr 27 (opcode Flanger_stereo): Invalid ftable no. 0.000000
amod oscili.a kdepth krate giTriangle 0

The obvious explanation is that giParabola and similar have had their values zapped to zero, or you assigned something like that.  Are these set in instr0?  If so do you get this problem if they are set in a declared instrument?

resetting values to zero would also explain the max/mi issue