/srv/irclogs.ubuntu.com/2016/01/13/#ubuntu-app-devel.txt

=== chihchun_afk is now known as chihchun
=== chihchun is now known as chihchun_afk
dholbachgood morning07:41
zzarrgood morgning07:53
zzarrmorning*07:54
zzarrhello! I get this error trying to start an application on a armhf arm device, what's wrong? "Cannot mix incompatible Qt library (version 0x50401) with this library (version 0x50501)"09:38
zzarror rather, how can I know what lib?09:39
popeyzzarr, http://askubuntu.com/questions/534415/cannot-mix-incompatible-qt-library10:14
zzarrthanks popey :-)10:14
zzarrpopey, what is Genymotion?10:16
popeyandroid emulator i think10:16
popeyused by people who make android apps/games for testing on the desktop10:16
zzarrnever mind, "target.path = /usr/lib" was missing in the .pro file10:17
popeyyay10:17
zzarrokey, thanks10:17
=== tsdgeos_ is now known as tsdgeos
kivipopey, http://podcast.ubuntu-uk.org/ error 50010:34
popeythanks10:34
mcphailpopey: found this - http://stackoverflow.com/questions/3662856/how-to-reimplement-or-wrap-a-syscall-function-in-linux - which might help us intercept open() calls10:49
popeymcphail, interesting10:51
mcphailthe wrapper could just prepend the confined path10:52
zzarrhello again!10:56
zzarrI get this error "Cannot find a running Bluez. Please check the Bluez installation." but there's a bluetoothd up and running10:56
zzarrbluez version 5.3610:56
zzarrQt version 5.5.110:57
=== _salem is now known as salem_
bartbesmcphail, popey: why do you want to intercept open calls?11:48
popeyImagine you have a linux program / game which writes files in places that (on Ubuntu phone) it can't shouldn't11:48
popeyRather than heavily patch the upstream app, just intercept those calls and point them in a different place11:49
popeye.g. calls to open ~/.config/foo-dir should go to ~/.config/foo.developer/foo-dir11:49
bartbesright, and you want to wrap them at compile-time?11:50
popeyi was thinking more LD_PRELOAD=wrapper foo-app11:51
popeyso you don't touch foo-app, just wrap it11:51
bartbesthat should be fairly easy11:51
popeybartbes, for you maybe :)11:55
bartbespopey: have an example: http://hastebin.com/upewegilan.c12:10
bartbesit's not the neatest, but it works12:10
popeyoooh12:11
popeydid you write that?12:11
popey<312:12
bartbesI think, as long as you conditionally read the mode flag, you could unconditionally pass it, but that probably depends on your abi12:15
bartbesthough iirc the arm and amd64 calling conventions don't differ there12:16
mcphailOnly problem with this is it is not going to catch any file access from anything which isn't compiled. If python or lua is embedded with hardcoded paths, it isn't going to be translated12:25
bartbeswhy not?12:27
bartbeslua calls open, too12:27
bartbesand I imagine so does python12:27
mcphailbartbes: but the wrapper won't wrap those calls, will it?12:28
bartbesoh, because they're from a shared library?12:28
mcphailyes12:28
mcphailunless the lib is recompiled...12:28
bartbesthere is another way12:29
bartbeslet's see..12:29
=== JMulholland_ is now known as JMulholland
bartbesactually, it seems it doesn't catch lua because it uses fopen instead of open12:44
bartbesand fopen and open are both in libc12:44
bartbesindeed, adding a simple wrapper for fopen makes it work for lua's io.open, too12:46
mcphailbartbes: nice. I think your dynamic linking and running with LD_PRELOAD is better than the static linking I'd posted above, and can see why this would work whereas my approach wouldn't12:48
bartbesas for python, it looks like it may be executing the syscall directly, instead of using libc12:48
mcphailanother reason to hate python more12:48
bartbesptrace is an option12:48
mcphailThis is good stuff. We might be able to implement a "poor man's container" here12:50
mcphailSo we need to wrap open() and fopen() - anything else you can think of? fdopen() won't need wrapped. Can't think of other libc functions to wrap off the top of my head12:54
mcphailfreopen(), i suppose12:55
bartbesstuff like stat could be interesting13:10
=== salem_ is now known as _salem
mcphailyes - running zgrep "const char *" *.gz in /usr/share/man/man2 suggests my optimism might be misplaced13:20
bartbeshmm, I've got an LD_PRELOAD running with ptrace13:40
bartbesit's a bit too effective, I'm currently redirecting opens to /dev :P13:45
=== rickspencer3_ is now known as rickspencer3
bartbesmcphail: if you LD_PRELOAD this it also works with python: http://hastebin.com/gufoyupafu.c13:59
bartbesand if you set sharedMemSize to PATH_MAX it should probably work everywhere14:00
mcphailbartbes: that looks extremely clever. It is going to take a while for me to pick through that to fully understand it, but that is as cunning as a fox who's just been appointed Professor of Cunning at Oxford University14:04
bartbesthe worst bit is extracting the original filename14:05
mcphailpresumably stat() and friends make the SYS_open syscall as well, so this will catch everything?14:10
mcphailor maybe not...14:13
bartbesno, stat is a different syscall14:13
mcphailyes, just spotted that14:13
bartbesbut fopen does trigger the SYS_open syscall14:13
mcphailyep. Should be enough for most things. Might need sys_create as well?14:13
bartbescreat might actually be open with O_CREAT14:14
bartbesnvm, there's also a SYS_creat14:14
bartbessee /usr/include/bits/syscall.h14:15
mcphailyep. browsing that just now. Looks as if this could work, doesn't it? It would greatly simplify repackaging .debs as .clicks14:16
=== chihchun_afk is now known as chihchun
=== chihchun is now known as chihchun_afk
bartbesfrom the looks of it all those syscalls have a filename as their first argument, so it's just a matter of adding a few ors14:48
mcphailYes, prob several of the syscalls with "const char *" parameters will have to be looked at, and some of them with (non-const) "char *"14:58
mcphailDoes this have a big impact on performance, do you think?14:59
bartbesI'm not sure, it will have a negative impact, how much, I don't know15:00
bartbesit could definitely help with the initial port, but it's definitely more efficient to patch the application15:03
bartbesthe normal LD_PRELOAD method is probably faster, if only because it relies less on the scheduler and is more targeted15:04
mcphailbartbes: yes. Most apps will have very few open()s though, so it might not hurt too much to catch the syscalls your second way15:05
mcphailthe magic is going to be working out which paths to rewrite and which paths to pss unchanged15:06
mcphailbartbes: if it is OK with you, I'll experiment with your LD_PRELOAD approach to reimplement open(), fopen(), stat() etc and see if it turns out to be useful. Would you be kind enough to post a version with a free licence?15:11
faradHi there! Can anybody give me a tipp on how to prevent rotation of the screen with QML?15:24
faradI tried MainView.automaticOrientation but it did not change anything for me15:24
faradit did not change the behaviour if I set it to true or false, to be more specific15:25
mcphailfarad: you set this in the manifest.json15:26
faradah, thank you!15:27
* mcphail can't remember the syntax just now15:27
bartbesmcphail: here you go: https://bitbucket.org/snippets/bartbes/K8EKk (2-clause BSD licensed)15:29
mcphailbartbes: you are a gentleman and a scholar15:30
faradSorry, but I cannot find any information about Manifest files in the online api-documentation. Could you please point me to something?15:36
popeyyou can set it in the desktop file15:36
mcphailoops. sorry for the misinformation15:37
popeyX-Ubuntu-Supported-Orientations=portrait  (or landscape)15:37
mhall119popey: when trying to run ubuntu-docviewer-app on qtcreator I get: This application failed to start because it could not find or load the Qt platform plugin "xcb".17:49
mhall119bzoltan_: zbenjamin ^^ any help you can give?17:49
mhall119I'm on wily, fwiw17:55
=== pat_ is now known as Guest3393
bartbesmhall119: I have had that too, and I partially followed a discussion about this earlier, make sure you've selected your hosts toolkit, not the new desktop one, and perhaps run cmake again?18:12
bartbesin any case, it did work for me launching from the terminal rather than the ide, but that's not much of a solution18:12
mhall119bartbes: by "hosts toolkit" do you mean a chroot?18:32
bartbesno, just the normal host qt18:33
mhall119how is that different from the desktop one?18:38
mhall119QTDIR=/usr/lib/i386-linux-gnu/qt5 for me18:39
bartbesfor me an extra entry appeared19:00
bartbeswith like a fancy name19:00
=== rickspencer3_ is now known as rickspencer3
=== salem_ is now known as _salem
=== _salem is now known as salem_
=== salem_ is now known as _salem
faenilahayzen: yo, any news about the issue you had?23:11
ahayzenfaenil, ah yes, sorry haven't tried it yet. Been busy with landings :-)23:12
faenilI see, np :=23:13
faenil:)23:13
faenilI'm just curious to know ;)23:13
ahayzeni'll try todo it tomorrow :-)23:13
faenilcool :)23:13
faenilgnight o/23:13
ahayzennight o/23:14
=== JanC_ is now known as JanC
mcphailpopey: might have hit a fatal flaw in our plans23:49
mcphailpopey: don't know how to deal with open()s to /proc/....23:50
mcphailpresumably they are limited by confinement?23:50
mcphailhttp://paste.ubuntu.com/14491850/23:51

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