/srv/irclogs.ubuntu.com/2014/02/27/#ubuntu-mir.txt

=== duflu_ is now known as duflu
alf_fginther: no worries, I hope you feel better07:11
dandraderalf_, ping08:47
alf_dandrader: hi08:47
dandraderalf_, hi. I manually built&"make install" mir, but when running an application now I get "libmirplatformgraphics.so: cannot open shared object file: No such file or directory". I guess it's because of "debian: Provide platform packages managed with dpkg alternatives."08:49
dandraderalf_, so, what's the simplest/correct way of handling this?08:49
dandraderie., what script or command should a manually run after "make install"?08:50
alf_dandrader: simplest workaround is: cd to install libdir (e.g. /usr/lib/{arch}) and ln -s mir/platformgraphics/mesa/libmirplatformgraphics.so08:56
alf_dandrader: and ln -s mir/clientplatform/mesa/libmirclientplatform.s08:56
alf_dandrader: where s/mesa/android/ if you want the android version08:57
dandraderalf_, I wonder if "make install" should already do such things...08:58
alf_dandrader: I should fix it so that things work after a make install08:58
alf_dandrader: yes08:58
dandraderalf_, should I file a bug to track this?08:59
alf_dandrader: the problem is that this conflicts with how debian alternatives work, but I guess we can just not install the links in the debian packages08:59
alf_dandrader: @bug, sure09:00
dandraderI'm not really familiar with debian alternatives09:00
alf_dandrader: a potential issue is if you mix "make install" and using packages, then the debian alternatives won't really work because make install will place direct soft links to the .so09:03
alf_dandrader: but I guess, whoever plays with fire will get burned :)09:04
alf_duflu: alan_g: anpok: https://bugs.launchpad.net/mir/+bug/1194384 , is our goal to provide a way to serialize the events for apps that don't need full multithreading flexibility? I don't remember if discussions about this (if any), led to a conclusion.09:27
ubot5Ubuntu bug 1194384 in Mir "Mir client callbacks are not thread-safe" [Critical,Triaged]09:27
duflualf_: The goal is to ensure all callbacks occur in one thread. The same thread as main()09:28
alan_galf_: IIRC in London RAOF had some ideas about this. I know duflu had a prototype for putting everything onto a client thread09:29
dufluI did a proof of concept which works. But it adds a little latency (additional context switch)09:29
dufluThat actually increases motion event throughput a lot, but it feels slightly laggy09:29
dufluLike most toolkits, you provide an API call from the client into the client library. And that's then a jumping off point to call the callbacks. People often use a "Mainloop" object for that09:31
dufluI think I did it similarly, but more generally. In a way where we could change the mechanics underneath over time09:31
alf_duflu: alan_g: Do we still need to allow for multiple threads (i.e., the current situation)? I am not sure what our requirements from the toolkit side are.09:33
duflualf_: I'm not sure what you mean09:33
duflualf_: Oh. I see. Supporting single plus multiple would be a requirement. But once you have the former, the latter is simple09:34
=== dandrader is now known as dandrader|afk
alf_duflu: you mean dispatching to multiple threads from the main thread?09:34
alf_duflu: but in an application/toolkit-controlled fashion09:35
duflualf_: Regardless the public API should not suggest the existence of threads or ever call back the client in some different thread. You can hide threads underneath still09:35
duflualf_: Shall I revive the prototype? It was designed to provide an interface to fix on so we can improve the underlying efficiency later09:36
dufluI think the greatest benefit of the prototype was that I designed it so no existing clients needed modification. It's an optional add-on to enforce single threaded-ness09:40
alf_duflu: I am trying to figure out what our goals our... so, as I see it, ideally we would like to get rid of the various set_callback functions and callback arguments, and just dispatch everything through the mainloop/event_queue?09:41
duflualf_: If starting from scratch then yes. But right now we'd like to maintain transparent compatibility with existing clients too09:42
* duflu copies and pastes09:43
duflualf_: The goal is to ensure all callbacks occur in one thread. The same thread as main()09:43
alf_duflu: From what I see the goal is for the callbacks to occur in one thread, any thread the app/toolkit wants?09:44
duflualf_: Yes, that too. But that can be accomodated with the more stringent goal of a single-threaded client should only ever see callbacks in its main() thread09:45
dufluOf course, the client can control which thread that is09:45
duflualf_: So long as the basic requirement is met and the API is pretty, I'm happy to ignore my prototype work09:46
alf_alan_g: duflu: anpok: ok, so the plan is to think a bit more about it, come up with some ideas and a rough plan, and send an email to mir-devel for further discussion09:57
alan_galf_: ok09:57
=== psivaa-afk is now known as psivaa
duflualf_: Cleaned up: https://code.launchpad.net/~vanvugt/mir/event-queue/+merge/20856310:12
alf_duflu: great, thanks10:12
dufluI never got as far as writing tests. Still was in the process of redesigning constantly to make everything feel nicer for clients10:12
dufluI designed it from the demo clients, outward :)10:13
=== dandrader|afk is now known as dandrader
anpokowe possible way would be to have no threads created at all but provide an interface to get all client file descriptors to do the wait in a different main loop library (like boost::asio :)) and let the mir client read events when necessary from the fds..10:57
anpokbut there are some odd cases like blocking calls10:57
anpokinput requires one fd per surface?10:58
anpokstill mir client has to be entirely thread safe10:58
anpokas in allow processing events from multiple threads10:59
=== shuduo_ is now known as shuduo
greyback_Any Mir person able to help this guy: https://lists.launchpad.net/ubuntu-phone/msg06616.html12:00
=== dandrader is now known as dandrader|afk
=== alan_g is now known as alan_g|lunch
=== dandrader|afk is now known as dandrader
=== pete-woods is now known as pete-woods-lunch
=== alan_g|lunch is now known as alan_g
anpokgreyback_: I can confirm that this happens.. not sure how to solve it13:47
greyback_anpok: ok, thanks for looking. Would be nice if someone could help, what he's trying sounds reasonable13:49
alan_ggreyback_: it sounds reasonable, but I don't think anyone's looked into supporting that stack. (I know that RAOF had to make mesa changes when he got XMir working on the desktop.)13:51
=== dandrader is now known as dandrader|afk
kgunnmterry: i'm curious...with nested mir & u-s-c...would it make sense for u-s-c to "remove" the tmp socket if it hits this error15:34
kgunnhttps://bugs.launchpad.net/mir/+bug/128508415:34
ubot5Ubuntu bug 1285084 in Mir "Exceptions are raised in a compositing thread and not handled" [Undecided,New]15:34
kgunnu-s-c is root right ?15:35
* mterry looks15:35
mterrykgunn, yes15:35
=== pete-woods-lunch is now known as pete-woods
kgunnmterry: i would think that if there's already an old socket there...its a mistake(e.g. its old) if u-s-c is just starting up15:36
mterrykgunn, you mean it would make sense for USC to remove /tmp/mir_socket after it crashes?15:36
kgunnmterry: sure15:36
kgunnmterry: or even if it finds one on startup right ?15:36
=== alan_g is now known as alan_g|tea
kgunntrying to think of why it would ever encounter an already existing mir socket ?15:37
mterrykgunn, in general I would think that's true (that Mir would automatically remove old sockets when it starts).  But mir-team I thought was of the other opinion15:37
mterryEven for user sessions and such15:37
kgunnalan_g|tea: alf_ ^15:37
kgunnmterry: maybe not mir itself...but u-s-c would have "knowlege" enough to say "hey, i'm the king daddy mir server starter...if i find an old socket, i should delete it"15:39
kgunn?15:39
mterrykgunn, sure, but user Mir sessions are king daddy Mir servers in the user session.  And are explicitly given a Mir socket path to use.  Seems like they should be able to expect to own it15:40
mterryMaybe only assume Mir owns it if we are given the path (which is always the case right now)15:40
alf_kgunn: iirc, the upstart scripts remove stale sockets before starting usc or unity8 (at least that was the case at some point)15:40
mterryalf_, USC isn't managed by upstart right now15:40
mterryI guess lightdm could do it manually15:40
mterryBut would be easier if Mir just did this itself15:41
alf_kgunn: mterry: mir does it best to remove sockets when it fails, but can't catch all kind of crashes15:41
mterryalf_, I get that.  But I'm talking about on startup, removing the socket15:42
kgunnalf_: mterry ...we do need to come up with something CI/release team chasing us....as its wreaking havoc on them15:42
mterryoh really15:42
alf_mterry: kgunn: the reason it doesn't do this on startup is that this would allow "stealing" a socket from another mir instance15:43
mterryalf_, who are we stopping from doing that?  couldn't the user just rm the file themselves?15:44
kgunnyeah...but aren't sockets tied only to that user (in terms of permissions)15:44
alf_mterry: kgunn: it's not about security, it's about expected behavior, e.g., running two mir instance in a row shouldn't cause the first one to fail because the second steals the socket15:45
mterryalf_, but in both cases you are explicitly specifying the mir socket path.  I think behavior in that case is up for debate15:46
mterryEither the first or the second fails15:46
kgunnright15:46
* kgunn agrees with mterry15:46
kgunnwhich is exactly where we are at15:46
kgunnsecond one fails cause no one deleted the prior socket15:47
kgunnand from a "theoretical" use case perspective...i don't disagree with alf_ but practically, in our configs when do we have a 2nd usc mir showing up?15:48
alf_kgunn: mterry: I disagree, expected behavior is for the second to report an error, not for the first one to fail because we pull the socket beneath its feet. And actually the second probably won't fail at all, it's just that the socket will have no representation on the filesystem.15:48
kgunnalf_: so it should create a seperate specific socket?15:49
alf_kgunn: mterry: since everything is done through upstart, the logic to handle the stale socket was put there15:49
mterryalf_, but with upstart, you get the behavior that starting a second instance kills the first anyway15:49
mterrySo I'm not sure why that is an unexpected outcome15:49
=== alan_g|tea is now known as alan_g
mterryI mean, I guess you have to be a bit more explicit.15:49
mterrySaying restart instead of start15:50
kgunnmterry: e.g. upstart is just gonna delete that socket any way ?15:50
mterrykgunn, I thought our upstart script did that?15:50
* mterry checks15:50
alf_kgunn: mterry: correction: "And actually the second probably won't fail at all" =>  And actually the *first* probably won't fail at all15:50
alan_gI thought the intention for USC was not to put an endpoint on the filesystem15:50
alan_gIn which case all this is moot15:50
mterrykgunn, nope, it doesn't15:50
mterrymy bad15:50
mterryalan_g, that was a goal15:51
alan_gWhat's stopping it?15:51
alf_alan_g: even if we forget USC, the debate stands about the unity8 socket15:51
* alan_g doesn't like software that silently "fixes" things15:52
kgunnso as a recap, we really have no mechanism to prevent stale/orphaned sockets...not in upstart, not in usc, not in mir15:52
mterryalan_g, no one ever completed the branches robert_ancell started to use the socket-less communication work between lightdm/USC/Mir15:52
mterryalan_g, I actually thought you had that on your TODO somewhere15:53
mterrykgunn, I think autopilot cleans them up  :)15:53
kgunnmterry: lol...well obviously not15:53
* alan_g can see it (far down the list)15:53
mterry:)15:53
alan_gmterry: I had a look, but the lightdm code wasn't clear to me15:54
kgunnmterry: AP meaning...some poor bastard manually adb shell's in and rm's it15:54
mterryalan_g, in future, I might be able to help decipher it15:54
alan_gAnyway, unless something SIGKILLS mir it should clean up the socket15:55
mterrykgunn, in unity8's launch_unity() AP method, it cleans its session socket15:55
kgunnalan_g: sorry...no being a smart alec "it" == ?15:55
mterrykgunn, but that's only for the session and only for unity8 tests15:55
mterrykgunn, I think 'it' == mir15:56
kgunnmterry: right, i'm guessing this is all because nested/usc got turned on15:56
alan_gkgunn: mir cleans up the socket on most signals and on normal exit15:56
kgunnta15:56
alan_gMir can't do it on SIGKILL15:56
kgunnright, which is exactly how unity8 AP works i think15:57
kgunnas mir is part of the unity8 process15:57
* alan_g what's wrong with SIGTERM?15:57
alan_g*wonders15:58
mterrykgunn, so AP is exercising the system much more than usual, and with less stable code.  Maybe it should just clean all the sockets all the time in case it hits crashes16:01
mterryI guess it would have to tell if it's still running.   And USC doesn't cleanly restart itself if it crashes...16:02
mterry Just restart system after every test  ;)16:03
kgunnom26er: ping16:27
om26erkgunn, hi16:27
kgunnom26er: hiya16:27
kgunnso you can see we've had a lengthy discussion above about16:27
kgunnhttps://bugs.launchpad.net/ubuntu/+source/unity8/+bug/128521516:27
ubot5Ubuntu bug 1285215 in mir (Ubuntu) "Unity fails to start sometimes in CI resulting in screen unlock failure [what(): bind: Address already in use]" [Medium,Triaged]16:27
kgunncurious...do you know how the AP test16:27
kgunnframework works ?16:28
kgunne.g. does it SIGKILL unity8 ?16:28
kgunnseems mir should clean up the socket if "treated politely"...potentially with SIGTERM16:28
om26erkgunn, this is the script thats run http://bazaar.launchpad.net/~ubuntu-test-case-dev/ubuntu-test-cases/touch/view/head:/utils/target/unlock_screen.py16:28
om26erwe set an upstart override to load the testability driver, stop unity8, turn on the screen and start it again16:29
om26erkgunn, we use initctl stop unity816:29
om26erdr appointment, back in 3016:33
kgunnom26er: ack16:33
kgunnalan_g: mterry ....so guessing this implies, it is just post-crash case...16:34
kgunnso mterry guessing you're suggestion might need to be the one...force clean from AP setup16:34
mterrykgunn, but also if we're talking USC (are we?), might need to restart lightdm16:36
kgunnyes, i think we are16:38
kgunnwell...judging from some chat in ubuntu-ci-eng that they needed to be root to delete the stale socket16:39
mterrykgunn, was the stale socket in /tmp/mir_socket or /run/user/.../mir_socket ?16:40
mterrykgunn, because that bug title at least indicates just a user sesion issue16:40
=== d-snp_ is now known as d-snp
mterryRegardless, a problem with USC can be fixed by restarting lightdm (once my fix for bug 1285234 lands)16:41
ubot5bug 1285234 in lightdm (Ubuntu) "lightdm on touch leaves a unity-system-compositor process around" [Undecided,Incomplete] https://launchpad.net/bugs/128523416:41
kgunnmterry: btw, you might want to review this one...16:48
kgunnhttps://code.launchpad.net/~albaguirre/unity-system-compositor/add-power-off-delay-option16:48
kgunn:)16:48
kgunni know it will bring you joy16:49
mterrykgunn, interesting.  I thought we just needed to clear some buffers in Mir for this16:50
kgunnmterry: well...it was actually to do with the powerd chain of events16:50
kgunnunity8 getting notified after usc16:50
mterryThis seems hacky, like what if system load is high or some such16:50
kgunnright...16:51
kgunnmterry: so we're not claiming this to be the final solution16:51
mterryYar16:51
kgunni've asked AlbertA to dive in and untangle the whole powerd thing16:51
* mterry tests this branch16:52
AlbertAmterry: yeah it's a kludge for now16:52
mterryWill need a corresponding ubuntu-touch-session change to pass args16:52
AlbertAmterry: I don't think flushing buffers in mir is enough either16:52
AlbertAmterrty: as we should allow shutdown animations to occur16:52
AlbertAmterry: the option can be configured with unity-system-compositor.conf as well16:53
mterryAlbertA, someone mentioned turn-on delays/animations too, since the greeter needs a moment to get the right time16:54
AlbertAmterry: umm that would be a little bit more involved16:57
=== alan_g is now known as alan_g|EOD
kgunnmterry: so i been thinking...why couldn't mir check to see if there's another mir process running, if not...he deletes the socket20:03
kgunnam i missing something20:03
kgunn?20:03
kgunn....sorry, picking up from our conversation with alf_earlier20:03
mterrykgunn, well, in theory many Mirs can be running at the same time.  As long as they don't have the same socket specified20:03
kgunnmterry: right, but in our config...that's never gonna happen right ?20:05
kgunnwe're gonna have one root, and one session20:05
kgunn...again, am i being stupid ?20:05
mterrykgunn, I guess?  But that's going a step further than we need.  We can just say "delete the socket you're configured for before opening it for yourself" which is what I was suggesting earlier.  No reason to query for other Mirs20:06
mterryHeh, didn't mean "I guess you are being stupid"  :)20:07
kgunnmterry: :)20:09
kgunnmterry: so i'm lost...isn't '  just say "delete the socket you're configured for before opening it for yourself" ' what alf_ argued against ?20:10
mterrykgunn, yes20:10
kgunnhmmm20:10
mterrykgunn, but that's also what you are suggesting20:10
mterrykgunn, oh20:10
kgunnyes i know...guess i'm saying not convinced20:11
mterrykgunn, maybe not.  I see what you are saying now20:11
mterrykgunn, you want to gracefully exit if there is another Mir20:11
kgunnhey, i just joined a hangout i gotta pay attn :)20:11
kgunnback in a moment20:11
mterrykgunn, we could just call "fuser $MIR_SOCKET" and if no one else is using it, delete it20:11
kgunnooo... mterry i'd never heard of fuser, just learned from google...i likie20:18
kgunnalf_: ^20:18
Saviqmterry, btw, fuser is not installed on the phone :/20:53
mterrySaviq, hrm.  I suppose it could be installed or the system call it does could be called directly (unless it does a bunch of direct ext calls...  ::shudder::)20:56
=== seb128_ is now known as seb128
=== GridCube_ is now known as GridCube

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!