SimpleIDE Hang on Mac OSX 10.9

I was running through some of the Simple Multicore examples using SimpleIDE 1.0.2(RC2) for Mac against a Propeller Activity Board but SimpleIDE kept hanging when building the "Try This – Add Another Function, Run it in Another Cog " example. There was an error in my code, but it should not have caused a hang. I had to Force Quit the application to kill it.
I'm running Mac OS X 10.9.5

// This is the error that was seen in the Mac OS console:
Nov 21 22:08:09 jonnymos-mbp loginwindow[65]: *** WARNING: -[NSImage compositeToPoint:operation:] is deprecated in MacOSX 10.8 and later. Please use -[NSImage drawAtPoint:fromRect:operation:fraction:] instead.
Nov 21 22:08:09 jonnymos-mbp loginwindow[65]: *** WARNING: -[NSImage compositeToPoint:fromRect:operation:] is deprecated in MacOSX 10.8 and later. Please use -[NSImage drawAtPoint:fromRect:operation:fraction:] instead.
Nov 21 22:08:11 jonnymos-mbp com.apple.launchd.peruser.501[153] (com.Parallax.SimpleIDE.83808[511]): Exited: Terminated: 15
Nov 21 22:09:44 jonnymos-mbp com.apple.IconServicesAgent[201]: main Failed to composit image for binding VariantBinding [0x387] flags: 0x8 binding: FileInfoBinding [0x157] - extension: pages, UTI: com.apple.iwork.pages.pages, fileType: ????.
Nov 21 22:09:44 jonnymos-mbp quicklookd[605]: Warning: Cache image returned by the server has size range covering all valid image sizes. Binding: VariantBinding [0x203] flags: 0x8 binding: FileInfoBinding [0x103] - extension: pages, UTI: com.apple.iwork.pages.pages, fileType: ???? request size:32 scale: 1
Nov 21 22:09:46 jonnymos-mbp Console[165]: setPresentationOptions called with NSApplicationPresentationFullScreen when there is no visible fullscreen window; this call will be ignored.
Nov 21 22:11:01 jonnymos-mbp com.apple.launchd.peruser.501[153] (com.Parallax.SimpleIDE.83808[592]): Exited: Terminated: 15

Comments

  • JinM,

    The "Exited: Terminated: 15" log message is very generic and does not give enough information to debug the problem on its own. You'll need to supply more information here in order for forum folks to help.

    I ran the scenario from the URL learn.parallax.com/tutorials/language/propeller-c/multicore-approaches/simple-multicore on my Mac OS X system, without issue. I followed the tutorial, opening the "Cog Run Example" project, building the code and running it on an Propeller Activity Board. Then, I followed the "Try This – Add Another Function, Run it in Another Cog" by adding just the additional code into the project since it was already open (Hey, I'm lazy and didn't type the whole new code example & just added to what was in the editor). Running this code worked, blinking both LEDs at different rates.

    Is that the same course of action that got you to the hang? Or was it the next section where the tutorial states "Your turn"?
    Giving the exact steps that you've taken in the posting will help to debug the problem.

    dgately
    Livermore, CA (50 miles SE of San Francisco)
  • dgately,

    I appreciate the response.
    I had created 2 functions, "blink_led1" to blink LED 26 and "blink_led2" to blink LED 27 where I copied the function declaration and definition from blink_led1 but forgot to change the declaration of the second function to blink_led2, so there were two declares for blink_led1 but a definition for both blink_led1 and blink_led2. When I build this, I do get an error regarding blink_led2 being undeclared, but then SimpleIDE proceeds to build the project anyways which is where it hangs and I have to issue a Force Quit on the SimpleIDE process.

    This is the code that causes the hang:

    Cheers,

    Jon

    ///////
    /*
    Blank Simple Project.c
    http://learn.parallax.com/propeller-c-tutorials
    */
    #include "simpletools.h" // Include simple tools


    #define LED26 26
    #define LED27 27
    #define BUTTON_P4 4
    #define BUTTON_P3 3
    #define DELAY_T1 300
    #define DELAY_T2 500
    #define LED0 0

    int *cog1;
    int *cog2;

    void blink_led1();
    void blink_led1(); // Incorrect function declaration

    int main() // Main function
    {
    // Add startup code here.

    /*
    while(1)
    {
    // Add main loop code here.
    print("Running one cog\n");
    cog_run(blink_led1, 128);
    print("Started blink led2\n");
    cog_run(blink_led2, 128);
    print("Started blink_led1\n");
    }
    */
    cog1 = cog_run(blink_led1, 128); // Run blink in other cog
    //pause(3000);
    cog2 = cog_run(blink_led2, 128); // Wait while other cog blinks LED
    //cog_end(cog);
    pause(3000);
    cog1 = cog_run(blink_led1, 128);
    pause(3000);
    }

    void blink_led1()
    {
    //while(1)
    for(int n = 1; n <= 15; n++)
    {
    high(LED26);
    pause(DELAY_T1);
    low(LED26);
    pause(DELAY_T1);
    }
    cog_end(cog1);
    }

    void blink_led2()
    {
    //while(1)
    for(int n = 1; n <= 25; n++)
    {
    high(LED27);
    pause(DELAY_T2);
    low(LED27);
    pause(DELAY_T2);
    }
    cog_end(cog2);
    }
  • dgatelydgately Posts: 1,105
    edited 2016-11-25 - 17:12:29
    JonM,

    First, you can keep the formatting of your sources on this forum by using the 'C' (code, control-O) wrapper available in the forum editor (take a look at the header that contains B, I, U, S, C ... (C is the code wrapper)

    I copied your code into a new project in SimpleIDE 1.0.2(RC2) & tried to build it. The 1st issue came up that simpletools.h requires 32-bit Doubles. I fixed that issue by checking the Compiler TAB's 32bit Double checkbox. On rebuild, I get the expected error(s):
    Project Directory: /Users/.../Desktop/testProject/
    
    SimpleIDE Version 1.0.2
    /Users/.../Documents/SimpleIDE/Learn/Simple Libraries/
    /Users/.../Documents/SimpleIDE/ Updated on: 2016-11-04
    
    propeller-elf-gcc -v GCC 4.6.1 (propellergcc-alpha_v1_9_0_propellergcc-alpha_v1_9_1-5-g5fc1abd)
    propeller-elf-gcc -I . -L . -I /Users/.../Documents/SimpleIDE/Learn/Simple Libraries/Utility/libsimpletools -L /Users/.../Documents/SimpleIDE/Learn/Simple Libraries/Utility/libsimpletools/lmm/ -I /Users/.../Documents/SimpleIDE/Learn/Simple Libraries/TextDevices/libsimpletext -L /Users/.../Documents/SimpleIDE/Learn/Simple Libraries/TextDevices/libsimpletext/lmm/ -I /Users/.../Documents/SimpleIDE/Learn/Simple Libraries/Protocol/libsimplei2c -L /Users/.../Documents/SimpleIDE/Learn/Simple Libraries/Protocol/libsimplei2c/lmm/ -o lmm/test.elf -Os -mlmm -m32bit-doubles -fno-exceptions test.c -lsimpletools -lsimpletext -lsimplei2c -lsimpletools -lsimpletext -lsimpletools
    test.c: In function 'main':
    test.c:39:18: error: 'blink_led2' undeclared (first use in this function)
    test.c:39:18: note: each undeclared identifier is reported only once for each function it appears in
    test.c: In function 'blink_led1':
    test.c:49:3: error: 'for' loop initial declarations are only allowed in C99 mode
    test.c:49:3: note: use option -std=c99 or -std=gnu99 to compile your code
    test.c: In function 'blink_led2':
    test.c:64:3: error: 'for' loop initial declarations are only allowed in C99 mode
    Done. Build Failed!
    
    Click error or warning messages above to debug.
    

    Note: your code also requires the "-std=c99" compiler option, once the above errors are resolved. But, with a fix to the declaration of blink_led2, it builds without issue on my MacBook Pro running Sierra 10.12.1...
    Project Directory: /Users/.../Desktop/testProject/
    
    SimpleIDE Version 1.0.2
    /Users/.../Documents/SimpleIDE/Learn/Simple Libraries/
    /Users/.../Documents/SimpleIDE/ Updated on: 2016-11-04
    
    propeller-elf-gcc -v GCC 4.6.1 (propellergcc-alpha_v1_9_0_propellergcc-alpha_v1_9_1-5-g5fc1abd)
    propeller-elf-gcc -I . -L . -I /Users/.../Documents/SimpleIDE/Learn/Simple Libraries/Utility/libsimpletools -L /Users/.../Documents/SimpleIDE/Learn/Simple Libraries/Utility/libsimpletools/lmm/ -I /Users/.../Documents/SimpleIDE/Learn/Simple Libraries/TextDevices/libsimpletext -L /Users/.../Documents/SimpleIDE/Learn/Simple Libraries/TextDevices/libsimpletext/lmm/ -I /Users/.../Documents/SimpleIDE/Learn/Simple Libraries/Protocol/libsimplei2c -L /Users/.../Documents/SimpleIDE/Learn/Simple Libraries/Protocol/libsimplei2c/lmm/ -o lmm/test.elf -Os -mlmm -m32bit-doubles -fno-exceptions -std=c99 test.c -lsimpletools -lsimpletext -lsimplei2c -lsimpletools -lsimpletext -lsimpletools
    propeller-load -s lmm/test.elf
    propeller-elf-objdump -h lmm/test.elf
    Done. Build Succeeded!
    

    SimpleIDE will allow you to compress the entire project with ZIP, which you should be able to attach to a posting for further testing. Just choose the ZIP option from the Project menu and attach the file in this thread.

    dgately

    Livermore, CA (50 miles SE of San Francisco)
  • dgately,

    The SimpleIDE complier is already set with 32bit Double checked and Other Compiler Options with "-std=c99", and without the missing declaration for blink_led2 it compiles and loads without issue. Sounds like your compiler was not set that way.

    The code is based on the "Stopping Cores" example from the "Mulitcore Approaches" Learn tutorial with my modifications, so the for loop format is listed that way in the online example.

    Thanks for looking at this, but since I understand what lead to the hang issue, I can get around that.
    I'll keep the code posting options in mind for next time.

    Cheers,

    Jon
  • I copied your original posted code and pasted it into SimpleIDE to test.

    First run I received an error for blink_led2 not being declared, once I fixed the original void declaration that you noticed was wrong, I clicked the test build button and it compiles fine.

    Have you restarted your Mac lately? Sometimes the FTDI drivers will freeze the USB ports and that could be causing an issue.

    Not sure if it helps any, but check to see that your USB is supplying power to your board, if not, then its a driver issue and a restart should fix it.

    Tim
  • I am running SimpleIDE 1.0.2 RC2 and OS X 10.11.5.

    My experience is that if your compilation would throw an error, there is about a 1 in 4 chance that SimpleIDE will hang and have to be killed from the command line.

    The small popup window that indicates compilation in progress (Building Propeller Application, with 5 small circles below) doesn't get dismissed. If you click the close button (the small red button in the top left corner of the popup window), the popup window is closed, but the application is still non-responsive (as if that window were still active and had focus?).

    As I said, this happens (intermittently and unpredictably, but fairly often) on an error, and as far as I can tell there is no pattern of type of compilation error that causes the hang.

    I have a workaround. I use a makefile and compile the program on the command line until the errors are taken care of, and then use SimpleIDE to link and program the propeller. This makefile doesn't handle cogc files and all the symbol relocation that needs to take place. SimpleIDE is good for that.

    Sridhar
    PATH=/Applications/SimpleIDE.app/Contents/propeller-gcc/bin:$PATH
    PROPLIB=$(HOME)/Documents/SimpleIDE/Learn/Simple\ Libraries
    LDFLAGS=-L $(PROPLIB)/Text\ Devices/libfdserial/lmm/ \
    	-L $(PROPLIB)/Text\ Devices/libsimpletext/lmm/ \
    	-lsimpletext -lfdserial -lsimpletext
    CFLAGS=-I. -L. -I $(PROPLIB)/Text\ Devices/libfdserial\
    	-I $(PROPLIB)/Text\ Devices/libsimpletext\
    	-L $(PROPLIB)/Text\ Devices/libfdserial/lmm/ \
    	-L $(PROPLIB)/Text\ Devices/libsimpletext/lmm/ \
      -lsimpletext -lfdserial -lsimpletext \
    	-Os -mlmm -m32bit-doubles -Dprintf=__simple_printf -std=c99 -fno-exceptions
    CC=/opt/parallax/bin/propeller-elf-gcc
    
    OBJECTS=gp.o i2c.o ubx.o util.o oled.o adc.o
    
    gp.elf: $(OBJECTS)
    	$(CC) $(CFLAGS) $(OBJECTS) -o gp.elf
    
    gp.o: gp.h
    i2c.o: gp.h i2c.h
    ubx.o: gp.h ubx.h
    util.o: gp.h util.h
    adc.o: gp.h adc.h
    
    .PHONY: clean
    clean:
    	rm gp.elf $(OBJECTS)
    

    email: sak [at] essc.psu.edu
  • Yeah, I found even after a system reboot or shutdown, if I build the project enough times it eventually hangs. This happens after the pop-up window appears and then I click OK. The SimpleIDE goes into hang mode and has to be killed.

    I ran "sudo dtruss -n SimpleIDE" and this is what is seen repeatedly when the hang appears:

    1340/0x1316a: gettimeofday(0x7FFF5FBF5CB0, 0x0, 0x0) = 1480273551 0
    1340/0x131a0: __semwait_signal(0xB03, 0x0, 0x1) = -1 Err#60
    1340/0x131a0: select(0x9, 0x10402A598, 0x10402A828, 0x10402AAB8, 0x103D8BBF0) = 0 0
    1340/0x131a0: __semwait_signal(0xB03, 0x0, 0x1) = -1 Err#60
    1340/0x131a0: select(0x9, 0x10402A598, 0x10402A828, 0x10402AAB8, 0x103D8BBF0) = 0 0
    1340/0x131a0: __semwait_signal(0xB03, 0x0, 0x1) = -1 Err#60
    1340/0x131a0: select(0x9, 0x10402A598, 0x10402A828, 0x10402AAB8, 0x103D8BBF0) = 0 0
    1340/0x131a0: __semwait_signal(0xB03, 0x0, 0x1) = -1 Err#60
    1340/0x131a0: select(0x9, 0x10402A598, 0x10402A828, 0x10402AAB8, 0x103D8BBF0) = 0 0
    1340/0x131a0: __semwait_signal(0xB03, 0x0, 0x1) = -1 Err#60
    1340/0x131a0: select(0x9, 0x10402A598, 0x10402A828, 0x10402AAB8, 0x103D8BBF0) = 0 0
    1340/0x1316a: gettimeofday(0x7FFF5FBF5CB0, 0x0, 0x0) = 1480273552 0
    1340/0x131a0: __semwait_signal(0xB03, 0x0, 0x1) = -1 Err#60
    1340/0x131a0: select(0x9, 0x10402A598, 0x10402A828, 0x10402AAB8, 0x103D8BBF0) = 0 0
    1340/0x131a0: __semwait_signal(0xB03, 0x0, 0x1) = -1 Err#60
    1340/0x131a0: select(0x9, 0x10402A598, 0x10402A828, 0x10402AAB8, 0x103D8BBF0) = 0 0
    1340/0x1316a: gettimeofday(0x7FFF5FBF5CB0, 0x0, 0x0) = 1480273553 0
    1340/0x1316a: gettimeofday(0x7FFF5FBF5DE0, 0x0, 0x7FFF5FBF5EC0) = 1480273553 0
    1340/0x1316a: gettimeofday(0x7FFF5FBF6520, 0x0, 0x6000002E6710) = 1480273553 0
    1340/0x1316a: gettimeofday(0x7FFF5FBF5480, 0x0, 0x652) = 1480273553 0
    1340/0x1316a: gettimeofday(0x7FFF5FBF6CA0, 0x0, 0x0) = 1480273553 0
    1340/0x1316a: gettimeofday(0x7FFF5FBF5C00, 0x0, 0x652) = 1480273553 0
    1340/0x1316a: gettimeofday(0x7FFF5FBF6CD0, 0x0, 0x10E) = 1480273553 0
    1340/0x1316a: gettimeofday(0x7FFF5FBF6CB0, 0x0, 0xA1A1A1A1) = 1480273553 0
  • We have a new version that fixes this problem, I believe. I'll alert Jeff, our software manager. - Ken
  • Jeff MartinJeff Martin Posts: 602
    edited 2016-12-02 - 15:14:00
    Hi JonM,

    Please try this version linked below. It's not ready for an official release yet, but it may fix the problem you're having. Please let us know in this thread if it does or doesn't fix the problem.

    We intend to release an official version (or two) that contains more updates this month.

    https://dl.dropboxusercontent.com/u/53606275/SimpleIDE/SimpleIDE-1-0-51-MacOS.pkg



    Jeff Martin
    Parallax Inc.
    (916) 624-8333 x3002
    jmartin@parallax.com
    http://www.parallax.com
  • Very cool Ken and Jeff.

    However, I am still seeing the hang if I build the project multiple times in a row.
    I'm still seeing the following error:
    258/0xaa1: select(0x9, 0x7FA66C951598, 0x7FA66C951828, 0x7FA66C951AB8, 0x1132A8BB0) = 0 0
    258/0xaa1: __semwait_signal(0xB03, 0x0, 0x1) = -1 Err#60
    258/0xaa1: select(0x9, 0x7FA66C951598, 0x7FA66C951828, 0x7FA66C951AB8, 0x1132A8BB0) = 0 0
    258/0xaa1: select(0x9, 0x7FA66C951598, 0x7FA66C951828, 0x7FA66C951AB8, 0x1132A8BB0) = 0 0
    258/0xaa1: __semwait_signal(0xB03, 0x0, 0x1) = -1 Err#60
    258/0x8d5: gettimeofday(0x7FFF549432E0, 0x0, 0x0) = 1480707700 0
    258/0x8d5: gettimeofday(0x7FFF54942240, 0x0, 0xEB) = 1480707700 0
    258/0x8d5: gettimeofday(0x7FFF54943AD0, 0x0, 0x1) = 1480707700 0
    258/0x8d5: gettimeofday(0x7FFF54942A30, 0x0, 0xEB) = 1480707700 0
    258/0x941: kevent64(0x3, 0x111944CC8, 0x1) = 1 0
    258/0xaa1: __semwait_signal(0xB03, 0x0, 0x1) = -1 Err#60
    258/0xaa1: select(0x9, 0x7FA66C951598, 0x7FA66C951828, 0x7FA66C951AB8, 0x1132A8BB0) = 0 0
    258/0xaa1: __semwait_signal(0xB03, 0x0, 0x1) = -1 Err#60
    258/0xaa1: select(0x9, 0x7FA66C951598, 0x7FA66C951828, 0x7FA66C951AB8, 0x1132A8BB0) = 0 0
    258/0x8ec: kevent64(0x3, 0x0, 0x0) = 1 0
    258/0x8ec: gettimeofday(0x10C9B5540, 0x0, 0x11E1A300) = 1480707702 0
    258/0x8ec: kevent64(0x3, 0x10C9B54F8, 0x1) = 1 0
    258/0xaa1: __semwait_signal(0xB03, 0x0, 0x1) = -1 Err#60
    258/0xaa1: select(0x9, 0x7FA66C951598, 0x7FA66C951828, 0x7FA66C951AB8, 0x1132A8BB0) = 0 0
    258/0xaa1: __semwait_signal(0xB03, 0x0, 0x1) = -1 Err#60
    258/0xaa1: select(0x9, 0x7FA66C951598, 0x7FA66C951828, 0x7FA66C951AB8, 0x1132A8BB0) = 0 0

    Also, during the install of the update SimpleIDE, a Backup of the SimpleIDE folder was created with a .zip file of the workspace, but I am unable to unzip this to get to my previous files. I've attached a screen shot of the error.


  • Update: I'm unable to reproduce this problem on macOS 10.12.1 Sierra. I don't have 10.9, but will try on 10.10.
    Jeff Martin
    Parallax Inc.
    (916) 624-8333 x3002
    jmartin@parallax.com
    http://www.parallax.com
  • I was able to see this problem on OS X 10.10. It does indeed happen at unpredictable times. Hard to test and capture.
    Jeff Martin
    Parallax Inc.
    (916) 624-8333 x3002
    jmartin@parallax.com
    http://www.parallax.com
Sign In or Register to comment.