locked
RIL + C#.NET + Windows Mobile 6.0: The application crashes RRS feed

  • Question

  • Hi All,

     

    Background:

    • I am developing an application for WinMobile 6.0
    • The device that I am currently use is HTC TyTN II
    • I use the "[DllImport("ril.dll")]" functionality in order to get some phone info
    • There is a thread that runs all the time in the background and samples few parameters in RIL
    • I use such RIL functions as "RIL_GetSignalQuality", "RIL_GetLineStatus", "RIL_GetCellTowerInfo"...

    The problem:

    • Sometimes the application crashes without even throwing an exception.
    • Looks like memory leak...
    • The application may, sometimes, work for 15-20 minutes and then crash. And sometimes it can crash right in the beginning (after 2-3 samples).

    What I've already done in order to try to fix the problem:

    • I have minimized the application to only one parameter (one of the functions above) that is sampled once in 2 seconds - the application still crashes.
    • Once I remove the call to the RIL function (this is the ONLY thing I remove) - the application works properly (without crashes).
    • I have tried to remove all the code from "rilResultCallback" function (the one that is called by RIL once the result is ready) - didn't help.
    • Trigger that helps to throw the application is moving it to the background by pressing the "Call" (green) button on the device - the application crashes without it as well.
    • Similar application on C++ works fine on this device.
    • I have tried to initialize the RIL in application start and finalize in the application end. And I have tried to initialize each time right before requesting the information, wait to the answer and the finalize.
    • Tried to wait for the answer (previous bullet) by just calling "Thread.Sleep(500);" and by

      "waitHandle.WaitOne(5000, false);".

     

    I can post some code samples on demand...

     

    Please HELP!

     

    Cross-posted.

    Monday, December 1, 2008 9:28 AM

Answers

  • Hi,

     

    To rule out the RIL code you are using it might be worth taking a look at Dale Lane's blog entry, he includes the RIL code he has used, I have also used it and did not see any problems. If this still causes an issue then you would have to start replacing other factors in the equation :-

     

    http://dalelane.co.uk/blog/?p=241

     

    Hope this helps.

     

    Paul Diston

     

    Monday, December 1, 2008 10:51 AM

All replies

  • Hi,

     

    To rule out the RIL code you are using it might be worth taking a look at Dale Lane's blog entry, he includes the RIL code he has used, I have also used it and did not see any problems. If this still causes an issue then you would have to start replacing other factors in the equation :-

     

    http://dalelane.co.uk/blog/?p=241

     

    Hope this helps.

     

    Paul Diston

     

    Monday, December 1, 2008 10:51 AM
  • Hi Mastema/Paul,

    I am also experiencing the same behavior of random app crash after RIL_GetCelltowerInfo invocation in my windows mobile code. My environment is .NET 3.5 Windows Mobile 6.0 SDK and the phone is HTC 8525.

    Paul, I am using the same code as given in your link.

    Mastema, did you find out any solution for this in C#?

    regards
    srividhya
    Friday, March 13, 2009 11:15 PM
  • Hi SV123,

    did you or somebody else found a solution to this problem. I'm experiencing the same problems.

    I try to initialize RIL once on application start and deinit on ending, but then i get no updates on

    RIL_GetCellTowerInfo


    Anybody?

    Cheers..

    Sunday, April 19, 2009 11:13 PM
  • I was experiencing exactly the same issue as you. To help others who may stumble onto this issue, please see http://www.dzhang.com/blog/2009/12/15/watson-crash-in-ril_getcelltowerinfo
    Tuesday, January 12, 2010 5:01 AM