=== chihchun_afk is now known as chihchun === chihchun is now known as chihchun_afk [07:41] good morning [07:53] good morgning [07:54] morning* [09:38] hello! 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:39] or rather, how can I know what lib? [10:14] zzarr, http://askubuntu.com/questions/534415/cannot-mix-incompatible-qt-library [10:14] thanks popey :-) [10:16] popey, what is Genymotion? [10:16] android emulator i think [10:16] used by people who make android apps/games for testing on the desktop [10:17] never mind, "target.path = /usr/lib" was missing in the .pro file [10:17] yay [10:17] okey, thanks === tsdgeos_ is now known as tsdgeos [10:34] popey, http://podcast.ubuntu-uk.org/ error 500 [10:34] thanks [10:49] popey: found this - http://stackoverflow.com/questions/3662856/how-to-reimplement-or-wrap-a-syscall-function-in-linux - which might help us intercept open() calls [10:51] mcphail, interesting [10:52] the wrapper could just prepend the confined path [10:56] hello again! [10:56] I get this error "Cannot find a running Bluez. Please check the Bluez installation." but there's a bluetoothd up and running [10:56] bluez version 5.36 [10:57] Qt version 5.5.1 === _salem is now known as salem_ [11:48] mcphail, popey: why do you want to intercept open calls? [11:48] Imagine you have a linux program / game which writes files in places that (on Ubuntu phone) it can't shouldn't [11:49] Rather than heavily patch the upstream app, just intercept those calls and point them in a different place [11:49] e.g. calls to open ~/.config/foo-dir should go to ~/.config/foo.developer/foo-dir [11:50] right, and you want to wrap them at compile-time? [11:51] i was thinking more LD_PRELOAD=wrapper foo-app [11:51] so you don't touch foo-app, just wrap it [11:51] that should be fairly easy [11:55] bartbes, for you maybe :) [12:10] popey: have an example: http://hastebin.com/upewegilan.c [12:10] it's not the neatest, but it works [12:11] oooh [12:11] did you write that? [12:12] <3 [12:15] I think, as long as you conditionally read the mode flag, you could unconditionally pass it, but that probably depends on your abi [12:16] though iirc the arm and amd64 calling conventions don't differ there [12:25] Only 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 translated [12:27] why not? [12:27] lua calls open, too [12:27] and I imagine so does python [12:28] bartbes: but the wrapper won't wrap those calls, will it? [12:28] oh, because they're from a shared library? [12:28] yes [12:28] unless the lib is recompiled... [12:29] there is another way [12:29] let's see.. === JMulholland_ is now known as JMulholland [12:44] actually, it seems it doesn't catch lua because it uses fopen instead of open [12:44] and fopen and open are both in libc [12:46] indeed, adding a simple wrapper for fopen makes it work for lua's io.open, too [12:48] bartbes: 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't [12:48] as for python, it looks like it may be executing the syscall directly, instead of using libc [12:48] another reason to hate python more [12:48] ptrace is an option [12:50] This is good stuff. We might be able to implement a "poor man's container" here [12:54] So 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 head [12:55] freopen(), i suppose [13:10] stuff like stat could be interesting === salem_ is now known as _salem [13:20] yes - running zgrep "const char *" *.gz in /usr/share/man/man2 suggests my optimism might be misplaced [13:40] hmm, I've got an LD_PRELOAD running with ptrace [13:45] it's a bit too effective, I'm currently redirecting opens to /dev :P === rickspencer3_ is now known as rickspencer3 [13:59] mcphail: if you LD_PRELOAD this it also works with python: http://hastebin.com/gufoyupafu.c [14:00] and if you set sharedMemSize to PATH_MAX it should probably work everywhere [14:04] bartbes: 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 University [14:05] the worst bit is extracting the original filename [14:10] presumably stat() and friends make the SYS_open syscall as well, so this will catch everything? [14:13] or maybe not... [14:13] no, stat is a different syscall [14:13] yes, just spotted that [14:13] but fopen does trigger the SYS_open syscall [14:13] yep. Should be enough for most things. Might need sys_create as well? [14:14] creat might actually be open with O_CREAT [14:14] nvm, there's also a SYS_creat [14:15] see /usr/include/bits/syscall.h [14:16] yep. browsing that just now. Looks as if this could work, doesn't it? It would greatly simplify repackaging .debs as .clicks === chihchun_afk is now known as chihchun === chihchun is now known as chihchun_afk [14:48] from the looks of it all those syscalls have a filename as their first argument, so it's just a matter of adding a few ors [14:58] Yes, prob several of the syscalls with "const char *" parameters will have to be looked at, and some of them with (non-const) "char *" [14:59] Does this have a big impact on performance, do you think? [15:00] I'm not sure, it will have a negative impact, how much, I don't know [15:03] it could definitely help with the initial port, but it's definitely more efficient to patch the application [15:04] the normal LD_PRELOAD method is probably faster, if only because it relies less on the scheduler and is more targeted [15:05] bartbes: yes. Most apps will have very few open()s though, so it might not hurt too much to catch the syscalls your second way [15:06] the magic is going to be working out which paths to rewrite and which paths to pss unchanged [15:11] bartbes: 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:24] Hi there! Can anybody give me a tipp on how to prevent rotation of the screen with QML? [15:24] I tried MainView.automaticOrientation but it did not change anything for me [15:25] it did not change the behaviour if I set it to true or false, to be more specific [15:26] farad: you set this in the manifest.json [15:27] ah, thank you! [15:27] * mcphail can't remember the syntax just now [15:29] mcphail: here you go: https://bitbucket.org/snippets/bartbes/K8EKk (2-clause BSD licensed) [15:30] bartbes: you are a gentleman and a scholar [15:36] Sorry, but I cannot find any information about Manifest files in the online api-documentation. Could you please point me to something? [15:36] you can set it in the desktop file [15:37] oops. sorry for the misinformation [15:37] X-Ubuntu-Supported-Orientations=portrait (or landscape) [17:49] popey: 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] bzoltan_: zbenjamin ^^ any help you can give? [17:55] I'm on wily, fwiw === pat_ is now known as Guest3393 [18:12] mhall119: 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] in any case, it did work for me launching from the terminal rather than the ide, but that's not much of a solution [18:32] bartbes: by "hosts toolkit" do you mean a chroot? [18:33] no, just the normal host qt [18:38] how is that different from the desktop one? [18:39] QTDIR=/usr/lib/i386-linux-gnu/qt5 for me [19:00] for me an extra entry appeared [19:00] with like a fancy name === rickspencer3_ is now known as rickspencer3 === salem_ is now known as _salem === _salem is now known as salem_ === salem_ is now known as _salem [23:11] ahayzen: yo, any news about the issue you had? [23:12] faenil, ah yes, sorry haven't tried it yet. Been busy with landings :-) [23:13] I see, np := [23:13] :) [23:13] I'm just curious to know ;) [23:13] i'll try todo it tomorrow :-) [23:13] cool :) [23:13] gnight o/ [23:14] night o/ === JanC_ is now known as JanC [23:49] popey: might have hit a fatal flaw in our plans [23:50] popey: don't know how to deal with open()s to /proc/.... [23:50] presumably they are limited by confinement? [23:51] http://paste.ubuntu.com/14491850/