[Cs-dev] segfault with FLTK opcodes on 5.16
Date | 2012-02-26 09:53 |
From | Victor Lazzarini |
Subject | [Cs-dev] segfault with FLTK opcodes on 5.16 |
Attachments | moog.csd None None |
This must have crept in on 5.16. I can't run the attached CSD anymore because of the FLTK code. Dr Victor Lazzarini Senior Lecturer Dept. of Music NUI Maynooth Ireland tel.: +353 1 708 3545 Victor dot Lazzarini AT nuim dot ie |
Date | 2012-02-26 09:59 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] segfault with FLTK opcodes on 5.16 |
Any FLTK-based will crash if we have the -d flag. It appears we made a mess of that one and let a release go with a major bug. Victor On 26 Feb 2012, at 09:53, Victor Lazzarini wrote: > > This must have crept in on 5.16. I can't run the attached CSD anymore because of the FLTK code. > > |
Date | 2012-02-26 10:29 |
From | Steven Yi |
Subject | Re: [Cs-dev] segfault with FLTK opcodes on 5.16 |
Hmm, sounds like it might be caused by changes I had done to fix issues with running python examples with TCL that had that strange interaction with FLTK. I'll take a look at it shortly. On Sun, Feb 26, 2012 at 9:59 AM, Victor Lazzarini |
Date | 2012-02-26 10:34 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] segfault with FLTK opcodes on 5.16 |
Thanks. On 26 Feb 2012, at 10:29, Steven Yi wrote: > Hmm, sounds like it might be caused by changes I had done to fix > issues with running python examples with TCL that had that strange > interaction with FLTK. I'll take a look at it shortly. > > On Sun, Feb 26, 2012 at 9:59 AM, Victor Lazzarini > |
Date | 2012-02-26 11:59 |
From | Steven Yi |
Subject | Re: [Cs-dev] segfault with FLTK opcodes on 5.16 |
Okay, after spending some time on this I just reverted what I had done. It means we're back to where we were. The problem though is that the logic in InOut/winFLTK.c is faulty. It bad logic is: if (!(csound->oparms->graphsoff || csound->oparms->postscript)) widget_init(csound); It assumes if you turn of graphics or have postscript enabled that it's alright to not initialize widgets. Reverting the code I did in argdecode.c returns us back to where we were. However, that too causes problems. If you run Csound from python and use TK, at least here on OSX it will cause a segfault. There's some interaction between the FLTK code and TK's internal code. To run with python and TK, you have to use "-g" to turn off graphs in your CSD or python code. However, if you use "-g" and try to run a Csound FLTK orchestra, you get a segfault. This code is essentially bad, IMO. Really, we shouldn't initialize widgets unless you really need to, and we shouldn't depend on if graphs are set or not, as it is the case that if your orchestra has no ftables, nothing gets displayed anyways. Plus, if you're not using FLTK at all, you're still paying a penalty to have widgets initialize just by having that opcode lib. The solution I think is that everywhere that uses FLTK, whether in displays or widget code, to check if FLTK has been initialized, and if not, intiialize it. A flag could be used here, though it'd have to be protected for multi-threading. I pushed the reverted code up to git. We should probably tag and re-release. The python situation is not that common, and there's a workaround by using -g. Sound like a plan? Thanks and apologies for the bug! steven On Sun, Feb 26, 2012 at 10:34 AM, Victor Lazzarini |
Date | 2012-02-26 20:30 |
From | Tito Latini |
Subject | Re: [Cs-dev] segfault with FLTK opcodes on 5.16 |
Attachments | None |
Date | 2012-02-27 08:48 |
From | Tito Latini |
Subject | Re: [Cs-dev] segfault with FLTK opcodes on 5.16 |
Attachments | None None csound5_fltk_display.patch None None |
Date | 2012-02-27 15:21 |
From | Steven Yi |
Subject | Re: [Cs-dev] segfault with FLTK opcodes on 5.16 |
Hi Tito, I tried the patch and it seems to work with FLTK with -d and -g, but python+tk fails now with any flag combination. There error I get is due to fl_wait Tcl_ServiceModeHook: Notifier not initialized Program received signal SIGABRT, Aborted. [Switching to process 12308 thread 0x9203] 0x00007fff9a038ce2 in __pthread_kill () (gdb) bt #0 0x00007fff9a038ce2 in __pthread_kill () #1 0x00007fff95fee7d2 in pthread_kill () #2 0x00007fff95fdfa7a in abort () #3 0x0000000101bbaf61 in Tcl_PanicVA () #4 0x0000000101bbafe3 in Tcl_Panic () #5 0x0000000101be8bdc in Tcl_ServiceModeHook () #6 0x0000000101bb80ed in Tcl_SetServiceMode () #7 0x0000000101cf7fca in Tk_MacOSXSetupTkNotifier () #8 0x00000001064b577f in fl_wait () #9 0x00000001064b581b in fl_mac_flush_and_wait () #10 0x0000000103f7e673 in CsoundYield_FLTK () Essentially, if that yield callback gets set, it kills python+tk. It's an odd problem. I don't have the full scope of the issue in my head, but on the one hand, we don't need the callback if there is no FLTK used, and yet, the logic currently just goes and sets it with the assumption it could be used at some point. Hence the mention about lazy initialization I mentioned. I'm thinking that may be the solution, but I'm still open to other analyses. On Mon, Feb 27, 2012 at 8:48 AM, Tito Latini |
Date | 2012-02-27 16:11 |
From | Tito Latini |
Subject | Re: [Cs-dev] segfault with FLTK opcodes on 5.16 |
Attachments | None |
Date | 2012-02-27 16:21 |
From | Steven Yi |
Subject | Re: [Cs-dev] segfault with FLTK opcodes on 5.16 |
No, I was using Brian Carty's MultiBin program, available in Csound Journal issue 16: http://www.csounds.com/journal/issue16/multibin.html That example works with the older csound because I used -d -g. It's what I was using for testing. On Mon, Feb 27, 2012 at 4:11 PM, Tito Latini |
Date | 2012-02-27 16:24 |
From | Tito Latini |
Subject | Re: [Cs-dev] segfault with FLTK opcodes on 5.16 |
Attachments | None |
Date | 2012-02-27 16:56 |
From | Tito Latini |
Subject | Re: [Cs-dev] segfault with FLTK opcodes on 5.16 |
Attachments | None |
Date | 2012-02-27 17:05 |
From | Steven Yi |
Subject | Re: [Cs-dev] segfault with FLTK opcodes on 5.16 |
Yeah, I think it is only OSX, and Brian was unaware of any problems with his project and was working on Windows and Linux I believe. On Mon, Feb 27, 2012 at 4:56 PM, Tito Latini |
Date | 2012-02-27 17:14 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] segfault with FLTK opcodes on 5.16 |
Possibly also only problematic with the latest FLTK that does not use Carbon, as the thing run fine with an older Carbon-based fltk lib in OSX 10.5. On 27 Feb 2012, at 17:05, Steven Yi wrote: > Yeah, I think it is only OSX, and Brian was unaware of any problems > with his project and was working on Windows and Linux I believe. > > On Mon, Feb 27, 2012 at 4:56 PM, Tito Latini |
Date | 2012-02-27 17:19 |
From | Tito Latini |
Subject | Re: [Cs-dev] segfault with FLTK opcodes on 5.16 |
Attachments | None |