MacSoftware update causes my application to hang

  • Hi All,

      I have a problem with my application, mac software update causes my application to hang. it basically suspends my app. and when the update ends my app goes into a non responsive state.

      Can some one tell me reason for this.

      I wanted to put a check in my app that if the software update is running then stop my app for sometime then again check whether software update is running..
      Now please tell me how to go about this.

      Thanks,
      Bala




    ---------------------------------
    All new Yahoo! Mail "The new Interface is stunning in its simplicity and ease of use." - PC Magazine
  • On 08 Dec 06, at 11:42, Balaram Barange wrote:
    > I have a problem with my application, mac software update causes my
    > application to hang. it basically suspends my app. and when the
    > update ends my app goes into a non responsive state.
    >
    > Can some one tell me reason for this.

    There is something very wrong with your program. Without knowing
    anything at all about your program, all we can tell you is that a
    properly written program won't be affected.

    > I wanted to put a check in my app that if the software update is
    > running then stop my app for sometime then again check whether
    > software update is running..
    >
    > Now please tell me how to go about this.

    Fix the underlying problem, and you won't have to do that.

    Failing that, tell us what your program is doing, and we might be
    able to give some more useful advice.
  • On 2006-12-08 19:42, Balaram Barange said:

    > Hi All,
    >
    > I have a problem with my application, mac software update causes my
    > application to hang. it basically suspends my app. and when the update
    > ends my app goes into a non responsive state.

    Weird.  Have you tried running Thread Viewer or Shark to see what is
    happening?

    --
    ____________________________________________________________
    Sean McBride, B. Eng                <sean...>
    Rogue Research                        www.rogue-research.com
    Mac Software Developer              Montréal, Québec, Canada
  • On Dec 8, 2006, at 1:42 PM, Balaram Barange wrote:

    > I have a problem with my application, mac software update causes
    > my application to hang. it basically suspends my app. and when the
    > update ends my app goes into a non responsive state.
    >
    > Can some one tell me reason for this.
    >
    > I wanted to put a check in my app that if the software update is
    > running then stop my app for sometime then again check whether
    > software update is running..

    I believe this is not a constructive approach. Every Macintosh
    application that I am aware of will run concurrently with Software
    Update. This suggests a bug in your application, which you should
    fix, and not a problem with SU that you must work around.

    You can learn much about the state of a hung application from common
    development tools.

    - The debugger in Xcode 2.4 allows you to attach to a running process.
    - Better still, run a debug version of the application, trigger the
    bug, and if necessary pause the application.

    - Use the Sampler application (/Developer/Applications/Performance
    Tools/Sampler) during the hang to produce a statistical stack dump.
    - Use the sampling facility in /Applications/Utilities/Activity
    Monitor (click your application, then the Inspect button, and the
    Sample button in the inspector window) to do the same thing.
    - Use the "sample" command-line tool to do the same thing. You must
    supply process name/number, how many seconds to run, and the
    interval, in milliseconds, between taking samples. I find "sample
    MyApp 10 10" to be good almost always.

    With these, an examination of the resulting stack dump may tell you
    where your application has gone off the rails.

    - Use Shark to get even more detailed information about the
    application before, during, and after the hang. You can use the call-
    stack history for clues about what you application was doing around
    that time.

    - Use the /Applications/Utilities/Console application to examine the
    system and console logs to see if any messages about your application
    were written.

    Sean McBride also recommends Thread Viewer.

    — F
  • On Dec 8, 2006, at 2:42 PM, Balaram Barange wrote:
    > I wanted to put a check in my app that if the software update is
    > running then stop my app for sometime then again check whether
    > software update is running..
    > Now please tell me how to go about this.

      Though others have given you useful advice, I'm particularly
    interested in this paragraph. How exactly are you achieving this
    pause? You aren't by any chance doing a "count to x" loop to force
    the app to be unresponsive are you? If so, you should know this is
    *not* the way to 'pause' in a Cocoa application.

      The best bet here is to post the code responsible for this pause
    and to explain exactly what you're trying to accomplish.
    Particularly, why your app should care what Software Update is doing
    in the first place.

    --
    I.S.
  • On 2006-12-08 17:18, I. Savant said:

    > On Dec 8, 2006, at 2:42 PM, Balaram Barange wrote:
    >> I wanted to put a check in my app that if the software update is
    >> running then stop my app for sometime then again check whether
    >> software update is running..
    >> Now please tell me how to go about this.
    >
    > Though others have given you useful advice, I'm particularly
    > interested in this paragraph. How exactly are you achieving this
    > pause? You aren't by any chance doing a "count to x" loop to force
    > the app to be unresponsive are you? If so, you should know this is
    > *not* the way to 'pause' in a Cocoa application.

    I don't think Balaram has that 'pause' in there now.  I believe he wants
    to add the pause as a workaround/fix for the actual problem.  Of course,
    as others have said, its better to find and fix the actual problem, not
    the symptom.

    --
    ____________________________________________________________
    Sean McBride, B. Eng                <sean...>
    Rogue Research                        www.rogue-research.com
    Mac Software Developer              Montréal, Québec, Canada
  • Hi Andrew,

    Thanks a lot, for the reply!

    My application is sync application which sync a
    calendar server with ical using the sync services.
    What I have analyzed that my application hangs when it
    reads data from http stream (with the server)and the
    software update is running.

    Thanks,
    Bala

    --- Andrew Farmer <andfarm...> wrote:

    > On 08 Dec 06, at 11:42, Balaram Barange wrote:
    >> I have a problem with my application, mac software
    > update causes my
    >> application to hang. it basically suspends my app.
    > and when the
    >> update ends my app goes into a non responsive
    > state.
    >>
    >> Can some one tell me reason for this.
    >
    > There is something very wrong with your program.
    > Without knowing
    > anything at all about your program, all we can tell
    > you is that a
    > properly written program won't be affected.
    >
    >> I wanted to put a check in my app that if the
    > software update is
    >> running then stop my app for sometime then again
    > check whether
    >> software update is running..
    >>
    >> Now please tell me how to go about this.
    >
    > Fix the underlying problem, and you won't have to do
    > that.
    >
    > Failing that, tell us what your program is doing,
    > and we might be
    > able to give some more useful advice.
    >


    ___________________________________________________________
    Does your mail provider give you FREE antivirus protection?
    Get Yahoo! Mail http://uk.mail.yahoo.com
  • On 9 dec 2006, at 13.19, Balaram Barange wrote:

    > My application is sync application which sync a
    > calendar server with ical using the sync services.
    > What I have analyzed that my application hangs when it
    > reads data from http stream (with the server)and the
    > software update is running.

    Two things:

    1) You should use threads / asynchronous API:s when performing
    network I/O in a GUI application. NSURLConnection / NSURLDownload are
    good candidates for this. My suggestion would be that you spend your
    time on investigating switching to a better API for your downloading
    needs. I haven't used Synch Services, so I don't know what type of
    restrictions it imposes on your design though.

    2) I seriously doubt that Software Update could cause a HTTP download
    in your application to hang and never return. If you have a very slow
    connection, perhaps it could timeout? If you're not using an API that
    provides you with proper control and error handling, that's perhaps
    something that might be difficult to detect.

    As always, if you think you've found a bug, reproduce it in a small
    sample project, and submit it with a bug report to Apple.

    j o a r
  • Hi All,
      Thanks for the reply.

      I have examined my process using the Thread Viewer.It gave me some insight to the problem,  what I have found out is that my application hangs when I tried to check the server reachability using the method. SCNetworkRechabilityByName.

      The following was the stack trace.
      mach_msg_trap
      _lookup_all_secure
      _lookup_all
      gailooupd
      getaddrinfo:
      __SCNetworkRechabilityGetFlags:
      SCNetworkRechabilityGetFlags:
      SCNetworkRechabilityByName:
      MyserverReachabilitycheckmethod:
      myHTTPRequestProcessMethod:
      ......
    And its hangin here no changes in the stact trace after this.
      it hangs here now if a quit the software update, so after 4-5 minute my application resumes.

      so my conclusion says when it try to look for SCNetworkRechabilityGetFlags in SCNetworkRechabilityByName method. it hangs here if the software update is running.
      I have no clues why?

      Thanks
      Bala
    j o a r <joar...> wrote:

    On 9 dec 2006, at 13.19, Balaram Barange wrote:

    > My application is sync application which sync a
    > calendar server with ical using the sync services.
    > What I have analyzed that my application hangs when it
    > reads data from http stream (with the server)and the
    > software update is running.

    Two things:

    1) You should use threads / asynchronous API:s when performing
    network I/O in a GUI application. NSURLConnection / NSURLDownload are
    good candidates for this. My suggestion would be that you spend your
    time on investigating switching to a better API for your downloading
    needs. I haven't used Synch Services, so I don't know what type of
    restrictions it imposes on your design though.

    2) I seriously doubt that Software Update could cause a HTTP download
    in your application to hang and never return. If you have a very slow
    connection, perhaps it could timeout? If you're not using an API that
    provides you with proper control and error handling, that's perhaps
    something that might be difficult to detect.

    As always, if you think you've found a bug, reproduce it in a small
    sample project, and submit it with a bug report to Apple.

    j o a r

    Send instant messages to your online friends http://uk.messenger.yahoo.com
  • Maybe post the code of "MyserverReachabilitycheckmethod."

    On Dec 10, 2006, at 9:30 PM, Balaram Barange wrote:

    > Hi All,
    > Thanks for the reply.
    >
    > I have examined my process using the Thread Viewer.It gave me
    > some insight to the problem,  what I have found out is that my
    > application hangs when I tried to check the server reachability
    > using the method. SCNetworkRechabilityByName.
    >
    > The following was the stack trace.
    > mach_msg_trap
    > _lookup_all_secure
    > _lookup_all
    > gailooupd
    > getaddrinfo:
    > __SCNetworkRechabilityGetFlags:
    > SCNetworkRechabilityGetFlags:
    > SCNetworkRechabilityByName:
    > MyserverReachabilitycheckmethod:
    > myHTTPRequestProcessMethod:
    > ......
    > And its hangin here no changes in the stact trace after this.
    > it hangs here now if a quit the software update, so after 4-5
    > minute my application resumes.
    >
    > so my conclusion says when it try to look for
    > SCNetworkRechabilityGetFlags in SCNetworkRechabilityByName method.
    > it hangs here if the software update is running.
    > I have no clues why?
    >
    > Thanks
    > Bala
    > j o a r <joar...> wrote:
    >
    > On 9 dec 2006, at 13.19, Balaram Barange wrote:
    >
    >> My application is sync application which sync a
    >> calendar server with ical using the sync services.
    >> What I have analyzed that my application hangs when it
    >> reads data from http stream (with the server)and the
    >> software update is running.
    >
    > Two things:
    >
    > 1) You should use threads / asynchronous API:s when performing
    > network I/O in a GUI application. NSURLConnection / NSURLDownload are
    > good candidates for this. My suggestion would be that you spend your
    > time on investigating switching to a better API for your downloading
    > needs. I haven't used Synch Services, so I don't know what type of
    > restrictions it imposes on your design though.
    >
    > 2) I seriously doubt that Software Update could cause a HTTP download
    > in your application to hang and never return. If you have a very slow
    > connection, perhaps it could timeout? If you're not using an API that
    > provides you with proper control and error handling, that's perhaps
    > something that might be difficult to detect.
    >
    > As always, if you think you've found a bug, reproduce it in a small
    > sample project, and submit it with a bug report to Apple.
    >
    > j o a r
    >
    >
    >
    >
    > Send instant messages to your online friends http://
    > uk.messenger.yahoo.com
previous month december 2006 next month
MTWTFSS
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Go to today