Csound Csound-dev Csound-tekno Search About

[Cs-dev] Segfault with lua

Date2013-06-10 18:59
FromFrancois PINOT
Subject[Cs-dev] Segfault with lua
AttachmentsNone  None  
Hello devs,

just built from git. I tried the three Lua csd from the examples/opcode_demos directory: luamoog.csd and lua_scoregen.csd run fine; but luaopcode.csd gives a segfault.

Regards

Francois

Date2013-06-10 19:35
FromVictor Lazzarini
SubjectRe: [Cs-dev] Segfault with lua
Are you on x86_64? I think the luajit has issues on 64bit. It does segfault here on OSX (and if I remember well, in Ubuntu).

Victor
On 10 Jun 2013, at 18:59, Francois PINOT wrote:

> Hello devs,
> 
> just built from git. I tried the three Lua csd from the examples/opcode_demos directory: luamoog.csd and lua_scoregen.csd run fine; but luaopcode.csd gives a segfault.
> 
> Regards
> 
> Francois
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Windows:
> 
> Build for Windows Store.
> 
> http://p.sf.net/sfu/windows-dev2dev_______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2013-06-10 20:02
FromFrancois PINOT
SubjectRe: [Cs-dev] Segfault with lua
AttachmentsNone  None  
I'm on x86_64. But it used to work recently. So I don't think that the problem comes from Luajit. It seems it has something to do with recent string changes...



2013/6/10 Victor Lazzarini <Victor.Lazzarini@nuim.ie>
Are you on x86_64? I think the luajit has issues on 64bit. It does segfault here on OSX (and if I remember well, in Ubuntu).

Victor
On 10 Jun 2013, at 18:59, Francois PINOT wrote:

> Hello devs,
>
> just built from git. I tried the three Lua csd from the examples/opcode_demos directory: luamoog.csd and lua_scoregen.csd run fine; but luaopcode.csd gives a segfault.
>
> Regards
>
> Francois
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Windows:
>
> Build for Windows Store.
>
> http://p.sf.net/sfu/windows-dev2dev_______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel


Date2013-06-10 20:10
FromVictor Lazzarini
SubjectRe: [Cs-dev] Segfault with lua
AttachmentsNone  None  
Well, I can't test it, but by looking at it, the opcodes seem to be using the new string code.
On 10 Jun 2013, at 20:02, Francois PINOT wrote:

I'm on x86_64. But it used to work recently. So I don't think that the problem comes from Luajit. It seems it has something to do with recent string changes...



2013/6/10 Victor Lazzarini <Victor.Lazzarini@nuim.ie>
Are you on x86_64? I think the luajit has issues on 64bit. It does segfault here on OSX (and if I remember well, in Ubuntu).

Victor
On 10 Jun 2013, at 18:59, Francois PINOT wrote:

> Hello devs,
>
> just built from git. I tried the three Lua csd from the examples/opcode_demos directory: luamoog.csd and lua_scoregen.csd run fine; but luaopcode.csd gives a segfault.
>
> Regards
>
> Francois
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Windows:
>
> Build for Windows Store.
>
> http://p.sf.net/sfu/windows-dev2dev_______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




Date2013-06-10 20:23
FromVictor Lazzarini
SubjectRe: [Cs-dev] Segfault with lua
AttachmentsNone  None  
I think you're right, because the lua code in the CSD does not seem to handle the new string variables, maybe it needs to be updated.
I think the actual C++ code for the opcodes is probably OK.

On 10 Jun 2013, at 20:10, Victor Lazzarini wrote:

Well, I can't test it, but by looking at it, the opcodes seem to be using the new string code.
On 10 Jun 2013, at 20:02, Francois PINOT wrote:

I'm on x86_64. But it used to work recently. So I don't think that the problem comes from Luajit. It seems it has something to do with recent string changes...



2013/6/10 Victor Lazzarini <Victor.Lazzarini@nuim.ie>
Are you on x86_64? I think the luajit has issues on 64bit. It does segfault here on OSX (and if I remember well, in Ubuntu).

Victor
On 10 Jun 2013, at 18:59, Francois PINOT wrote:

> Hello devs,
>
> just built from git. I tried the three Lua csd from the examples/opcode_demos directory: luamoog.csd and lua_scoregen.csd run fine; but luaopcode.csd gives a segfault.
>
> Regards
>
> Francois
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Windows:
>
> Build for Windows Store.
>
> http://p.sf.net/sfu/windows-dev2dev_______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie



------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




Date2013-06-11 02:36
FromMichael Gogins
SubjectRe: [Cs-dev] Segfault with lua
AttachmentsNone  None  

I had to change the Lua opcodes in Csound 6 to get them to work on Android.

I replaced OpenMP critical sections with pthreads mutexes, and I changed the string handling to use STRINGDATs.

Are you using the latest sources?

Hope this helps,
Mike


Date2013-06-11 08:28
FromVictor Lazzarini
SubjectRe: [Cs-dev] Segfault with lua
AttachmentsNone  None  
I was wondering whether the lua code needed to be changed to deal with STRINGDAT.
I see this in the CSD, for example

print(string.format('stringin: %s', ffi.string(arguments.stringin)))

arguments.stringin would, in the old string code be a string, but now it's a STRINGDAT.

I don't know whether this has already been modified, or whether it needs to be modified at
all.

Victor
On 11 Jun 2013, at 02:36, Michael Gogins wrote:

I had to change the Lua opcodes in Csound 6 to get them to work on Android.

I replaced OpenMP critical sections with pthreads mutexes, and I changed the string handling to use STRINGDATs.

Are you using the latest sources?

Hope this helps,
Mike

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




Date2013-06-11 09:06
Fromfrancesco
SubjectRe: [Cs-dev] Segfault with lua
Here on Ubuntu 12.04, 32 bit, csound_ffi.csd example is working.
With Csound6 build yesterday.

Ciao,
francesco.

PS: I have problem with audio ( unknown rtaudio module: 'jack', using dummy
module
rtaudio: dummy module enabled) same using alsa. But only with this example.





--
View this message in context: http://csound.1045644.n5.nabble.com/Segfault-with-lua-tp5724352p5724368.html
Sent from the Csound - Dev mailing list archive at Nabble.com.

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2013-06-11 10:16
FromMichael Gogins
SubjectRe: [Cs-dev] Segfault with lua
AttachmentsNone  None  
I can confirm that the luaopcode.csd does not work after I changed the LuaCsound.cpp code to use STRINGDATs.

Victor, are you saying that the "char *stringin" in the Lua code needs to be "STRINGDAT *stringin"?

That would require the STRINGDAT struct to be defined in the Lua cdef also.

I will make these changes if that is the case.

Regards,
Mike



Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Tue, Jun 11, 2013 at 3:28 AM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
I was wondering whether the lua code needed to be changed to deal with STRINGDAT.
I see this in the CSD, for example

print(string.format('stringin: %s', ffi.string(arguments.stringin)))

arguments.stringin would, in the old string code be a string, but now it's a STRINGDAT.

I don't know whether this has already been modified, or whether it needs to be modified at
all.

Victor
On 11 Jun 2013, at 02:36, Michael Gogins wrote:

I had to change the Lua opcodes in Csound 6 to get them to work on Android.

I replaced OpenMP critical sections with pthreads mutexes, and I changed the string handling to use STRINGDATs.

Are you using the latest sources?

Hope this helps,
Mike

------------------------------------------------------------------------------

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
Victor dot Lazzarini AT nuim dot ie




------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel



Date2013-06-11 10:44
FromVictor Lazzarini
SubjectRe: [Cs-dev] Segfault with lua
AttachmentsNone  None  
yes, that is what I meant. In that case

stringin->data is the string
stringin->size is the size of the data mem.


Victor
On 11 Jun 2013, at 10:16, Michael Gogins wrote:

I can confirm that the luaopcode.csd does not work after I changed the LuaCsound.cpp code to use STRINGDATs.

Victor, are you saying that the "char *stringin" in the Lua code needs to be "STRINGDAT *stringin"?

That would require the STRINGDAT struct to be defined in the Lua cdef also.

I will make these changes if that is the case.

Regards,
Mike



Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Tue, Jun 11, 2013 at 3:28 AM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
I was wondering whether the lua code needed to be changed to deal with STRINGDAT.
I see this in the CSD, for example

print(string.format('stringin: %s', ffi.string(arguments.stringin)))

arguments.stringin would, in the old string code be a string, but now it's a STRINGDAT.

I don't know whether this has already been modified, or whether it needs to be modified at
all.

Victor
On 11 Jun 2013, at 02:36, Michael Gogins wrote:

I had to change the Lua opcodes in Csound 6 to get them to work on Android.

I replaced OpenMP critical sections with pthreads mutexes, and I changed the string handling to use STRINGDATs.

Are you using the latest sources?

Hope this helps,
Mike

------------------------------------------------------------------------------

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
Victor dot Lazzarini AT nuim dot ie




------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




Date2013-06-11 11:52
FromMichael Gogins
SubjectRe: [Cs-dev] Segfault with lua
AttachmentsNone  None  
This is now fixed in git.

Regards,
Mike

Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Tue, Jun 11, 2013 at 5:44 AM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
yes, that is what I meant. In that case

stringin->data is the string
stringin->size is the size of the data mem.


Victor

On 11 Jun 2013, at 10:16, Michael Gogins wrote:

I can confirm that the luaopcode.csd does not work after I changed the LuaCsound.cpp code to use STRINGDATs.

Victor, are you saying that the "char *stringin" in the Lua code needs to be "STRINGDAT *stringin"?

That would require the STRINGDAT struct to be defined in the Lua cdef also.

I will make these changes if that is the case.

Regards,
Mike



Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Tue, Jun 11, 2013 at 3:28 AM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
I was wondering whether the lua code needed to be changed to deal with STRINGDAT.
I see this in the CSD, for example

print(string.format('stringin: %s', ffi.string(arguments.stringin)))

arguments.stringin would, in the old string code be a string, but now it's a STRINGDAT.

I don't know whether this has already been modified, or whether it needs to be modified at
all.

Victor
On 11 Jun 2013, at 02:36, Michael Gogins wrote:

I had to change the Lua opcodes in Csound 6 to get them to work on Android.

I replaced OpenMP critical sections with pthreads mutexes, and I changed the string handling to use STRINGDATs.

Are you using the latest sources?

Hope this helps,
Mike

------------------------------------------------------------------------------

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
Victor dot Lazzarini AT nuim dot ie




------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
Victor dot Lazzarini AT nuim dot ie




------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel



Date2013-06-12 09:28
FromFrancois PINOT
SubjectRe: [Cs-dev] Segfault with lua
AttachmentsNone  None  
I wasn't home for the last two days. Just tried it. I had to change csound64.dll to csound64 (line 7) to get it working on my system (Ubuntu 12.04 x86-64).

Many thanks Victor and Michael

Regards

Francois


2013/6/11 Michael Gogins <michael.gogins@gmail.com>
This is now fixed in git.

Regards,
Mike

Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Tue, Jun 11, 2013 at 5:44 AM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
yes, that is what I meant. In that case

stringin->data is the string
stringin->size is the size of the data mem.


Victor

On 11 Jun 2013, at 10:16, Michael Gogins wrote:

I can confirm that the luaopcode.csd does not work after I changed the LuaCsound.cpp code to use STRINGDATs.

Victor, are you saying that the "char *stringin" in the Lua code needs to be "STRINGDAT *stringin"?

That would require the STRINGDAT struct to be defined in the Lua cdef also.

I will make these changes if that is the case.

Regards,
Mike



Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Tue, Jun 11, 2013 at 3:28 AM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
I was wondering whether the lua code needed to be changed to deal with STRINGDAT.
I see this in the CSD, for example

print(string.format('stringin: %s', ffi.string(arguments.stringin)))

arguments.stringin would, in the old string code be a string, but now it's a STRINGDAT.

I don't know whether this has already been modified, or whether it needs to be modified at
all.

Victor
On 11 Jun 2013, at 02:36, Michael Gogins wrote:

I had to change the Lua opcodes in Csound 6 to get them to work on Android.

I replaced OpenMP critical sections with pthreads mutexes, and I changed the string handling to use STRINGDATs.

Are you using the latest sources?

Hope this helps,
Mike

------------------------------------------------------------------------------

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
Victor dot Lazzarini AT nuim dot ie




------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
Victor dot Lazzarini AT nuim dot ie




------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel



------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel