System hangs

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • System hangs

    Hi

    I am running emWin and from time to rime i have the system to Hang Please see the attached file with screen shoots of the stack when its hang. It hang on TEXT_CreateEx function.
    How can i found where the problem exist.
    It happens when i have long run cycle and every two minutes the system creates a graph window it will delete the previous one and creates a new instance. I am suing function to detects the memoryleaks and it looks fine from the memeory leaks point of view no leaks at all.

    Please can you tell me how can i solved the problem where we cannot supply a big order units and this fault may kill the entire product.
    The attached files are in order of same stack all the bitmap within the doc file are screen shot of the stack hope it will help to help me investigate the problem ASAP

    Regards
    Arie
    Files

  • Hi Andrian

    I do take care of it ? so if this is not the case what can be the case ?
    it hangs on the "green line" in the attached file ?" what it does in the actual source code in emWin ? I assumed that if we failed to creates a control then the return value will be NULL ? we are not returning from that line
    It just hang there ? if i run it will stay on that line ?

    See HangScreen1&2 files for how it looks like when it hangs. the screen is never get redrawn or corrupted ? see that the start of the screen was cleared ?

    See source code that is activating :
    When we need to swap screens we are calling the functions
    Shenpaz_HideCurrentDialogue
    then the function to draw a new screen. in our case we entering the function
    HideGraphWindow() all the time
    :



    Sequence
    of calling function :

    1.
    Shenpaz_HideCurrentDialogue()
    (in the end of that function we set the background to black and Clear the screen)

    2.
    HideGraphWindow()

    3.
    GUI_SetBkColor(GUI_BLACK);

    4. GUI_Clear();
    5.
    Shenpaz_Create_Screen_GRAPH() (building the dialog window and its widgets (source code not included) -
    the parent of the graph window is the desktop)

    6.
    GUI_Exec();


    May be that the sequence of calling is not correct - we may call GUI_Exec() also between sequence line above 4 and 5
    But the important is what the hanging line of code telling us????
    It not always hang and it is the reason why we are not sending product out to customer and we have nearly 100 unit waiting to be shifted to customer



    void HideGraphWindow()
    {
    for (int i = 0; i < GRAPH_ELM_COUNT; i++)
    {
    if (G_widgets.hItem != NULL)
    {
    WM_DeleteWindow(G_widgets[i].hItem) ;
    memset(&G_widgets[i], 0, sizeof(S_Shenpaz_WidgetData));
    //G_widgets[i].hItem = NULL ;
    }
    }
    }



    Bool Shenpaz_HideCurrentDialogue(void)
    {
    if (SF_FRAMEWIN_NONE & G_screenWidgets[0].specialFlags)
    {
    // Graph screen need to remove the Widget
    HideGraphWindow() ;
    }
    else
    {
    WM_HideWindow(G_currentDialogue.pWin);
    GUI_EndDialog(G_currentDialogue.pWin,0);
    GUI_EndDialog(G_currentDialogue.pWin,1);
    WM_DeleteWindow(G_currentDialogue.pWin);
    }
    GUI_SetBkColor(GUI_BLACK);
    GUI_Clear();
    return TRUE;
    }
  • Hello,

    The problem can also be caused by trying to delete windows which were not successfully created. Please note that I am not able to take a deep look into your code. I can just try to point you to the right direction.

    Please also note that this is not a support forum. If you need to receive fast and detailed support via e-mail, you will have to sign a support and update agreement with SEGGER. Please feel free to contact info@segger.com in order to request more information on how to do so.

    Best regards,
    Adrian
  • Hi Adrian

    I understood your point of support but, As a professional programmer i wouldn't asked you a question before i have checked my code and I am familiar with windows programming very well
    So the point of using windows members and deleting them or using them without creating them in advanced is known to me very much, What i have asked is a simple question that point to the line of code where emWin were stuck on and want to understand what the symptom that we got to this line.

    Thanks anyway for your trying help me, but i am in the same situation where i was with the first question.
    We may stop the project and cancel all what we have done so far with emWin and our new product, as i told you we have lots of order but this bug stop the shipment and may cause to company close its gate.

    Any way thanks again for your trying help
    Arie
  • Hi Adrian
    Small issue, if we assumed to fail you should return an Error and never stuck the system as in our case, just return NULL or any status that we will carry from that step onward. But it stuck in emWin code in one line because of something and it may emWin problem and you should notify me on that if its known to you

    Regards
    Arie
  • Hello Arie,

    Please note that our code is very well tested. This also means that our demos are able to run for a very long time without problems (e.g. GUIDemo which can be downloaded from segger.com). If we create a new sample application and it crashes after a while, the problem in most cases is objects (as Windows, or Memory Devices) being created, but not deleted and then created again. Running out of memory then is just a matter of time. In fact it is never a bug in emWin. This is why I ask you to have a second look at your code.

    Actually all of the functions in emWin, which have the ability to return an error, should do so. If you feel that there is a function which might return without success, but does not return an error, please feel free to tell me which one it is and send me a small application which enables me to reproduce exactly the problem you experience.

    Best regards,
    Adrian
  • Hi Adrian

    Please i am still waiting for an answer from you, it past too long since my last replay on your last message.

    I have sent you the sample code where the problem is in my first mail on that issue.
    You can see the line where the application is hang - it will tell you more then to me why its happens and what cause it to happen

    My code is very big and i have no small application that can duplicates it - but believe me it happens.

    Please look on my first mail and the attached bitmaps that will point to the exact position in emWin code where it hangs

    Regards
    Arie

    The post was edited 1 time, last by alevy ().