← Back to team overview

ubuntu-phone team mailing list archive

Re: Application crash on utopic but not trusty

 

Am 08.07.2014 18:19, schrieb Ted Gould:
> On Tue, 2014-07-08 at 17:34 +0200, Michał Sawicz wrote:
>> On 08.07.2014 17:25, Robert Schroll wrote:
>> > How does one do that?  Every time I try to launch an application from an
>> > ssh session, I get
>> > 
>> >> QUbuntu: Could not create application instance
>> >> Aborted (core dumped)
>> > 
>> > Obviously, there's some special sauce that I'm missing.
>>
>> A temporary workaround for that (until we get proper support for gdb
>> runs) is passing:
>>
>> --desktop_file_hint=/path/to/your/file.desktop
>>
>> The reason for that is we need a strong relationship between the app's
>> data and the process. Normally it's upstart providing us with that
>> relationship, but as you want to run outside of upstart, the above is a
>> temporary (unsupported) workaround.
>
> The supported way is to use QtCreator, which I think that Benjamin got
> working (cc'd to check). It sets up a custom click that can be used
> for debugging and connects back to GDB on the host. Then you're
> running the app under confinement in the same manner as it normally
> runs, just with a gdb connection.
>
> Ted
>
Yes we got that working,

you don't need QtCreator for that, but the
qtcreator-plugin-ubuntu-common package if
you want to use our scripts.

To make a click debuggable we do the following steps:
1) compile the app in debug mode
2) add the debug policy to the apparmor file
3) inject the qtc_device_debughelper script into the desktop files exec
line that sets up debugging: qtc_device_debughelper.py <command>
    (it needs to be packaged inside the click package)
4) use the qtc_device_applaunch.py to start the application.
5) connect with gdb to the device

However it should be possible to do it more easily for a simple backtrace:
1) compile the app in debug mode
2) add the debug policy to the apparmor file
3) replace the Exec line in the debug file with gdbserver :port <command>
4) use gdb ON the phone to connect to gdbserver and get a backtrace

The only difference is that the QtC solution can start a click package
with or without debugging
enabled.


Benjamin




References