memoryio / memoryio-macosx

Life logging app for macosx. Takes a picture with built in isight whenever you wake computer from sleep
8 stars 4 forks source link

Application prevents system from sleeping; long pause on quick wakeup #10

Closed zgiles closed 11 years ago

zgiles commented 11 years ago

One thing I often do is close my laptop, then just remember I forgot to do something. Usually, it will pause a few second more than normal (since it's still Going to sleep) and then act normal. With memoryIO, If I close it and open it again within ~10 seconds of closing it, it will give me a black screen with a cursor for about 20 sec, then go to sleep, after which I can wake it up normally.

The app acts normal, no CPU load crash (like in past). It takes a pic and everything, but I think that since there is this total pause of about 30 sec, which is nearly the timeout, that somehow the sleep functions aren't being caught correctly. That or maybe a wakeup request before a sleep request is complete makes some race condition.

Jacob commented that the syscall handler probably got broke along the way

jacobrosenthal commented 11 years ago

Ugh! Yeah I broke the sleep allow. Basically Mac apps tell you they're about to shutdown so you can cleanup. You need to respond within 30 seconds saying OK. My response doesn't appear to be being heard :( hence the mandatory 30 second freeze.

jacobrosenthal commented 11 years ago

Actually.. I CAN'T confirm this. Spend hours trying to debug and realized that I had an rsync script that was sleeping 30 seconds and that was MY delay. Can you clean restart and turn off all services and confirm a clean wakeup over a few cycles then add memoryio back in and see if indeed its pausing your sleep?

zgiles commented 11 years ago

What do you mean by turn off all services? Just normal restart with nothing special open for example?

jacobrosenthal commented 11 years ago

mainly all other applications are off and such. Also watch your ps ax for anything you dont recognized. Thats how I found my errant script that was screwing me

On Thu, Oct 17, 2013 at 2:36 PM, zgiles notifications@github.com wrote:

What do you mean by turn off all services? Just normal restart with nothing special open for example?

— Reply to this email directly or view it on GitHubhttps://github.com/memoryio/memoryio-macosx/issues/10#issuecomment-26555303 .

jacobrosenthal commented 11 years ago

Sigh. Blaines getting it too, wonder why Im not now

On Thu, Oct 17, 2013 at 3:01 PM, Jacob Rosenthal jakerosenthal@gmail.comwrote:

mainly all other applications are off and such. Also watch your ps ax for anything you dont recognized. Thats how I found my errant script that was screwing me

On Thu, Oct 17, 2013 at 2:36 PM, zgiles notifications@github.com wrote:

What do you mean by turn off all services? Just normal restart with nothing special open for example?

— Reply to this email directly or view it on GitHubhttps://github.com/memoryio/memoryio-macosx/issues/10#issuecomment-26555303 .

zgiles commented 11 years ago

Yep, mine still does it after a refresh over here. Must be soemthing that both Blaine and I have that you don't. What could it be? Growl? I'm on OS 10.8.4. What is Blaine on? What are you on?

Is there a way I can compile with Xcode, ignore entitlements etc and run it in debug mode over a reboot to see if it's blocking on something? Would that be feasible for my level of setup and understanding?

zgiles commented 11 years ago

It was chrome, not memoryio. False alarm.

jacobrosenthal commented 11 years ago

To research for yourself:

applications->utility->console and click insert marker. Then put your computer to sleep, wake up, and check the logs for PM notification timeout:

10/20/13 1:37:13.000 PM kernel[0]: PM notification timeout (pid 3750, Google Chrome He) 10/20/13 1:37:13.000 PM kernel[0]: PM notification timeout (pid 3751, Google Chrome He) 10/20/13 1:37:13.000 PM kernel[0]: PM