[SailfishDevel] app crashed when using Canvas in Dialog page

2014-08-13 Thread Samuli Silvius
Hi,

I have Canvas in Silica Dialog page but app crashes when leaving dialog
page both with accept or cancel swipe. It does not crash always just quite
often.

the code:

Canvas {

id: imageCanvas

visible: isImageUrl

width: imgLoader.sourceSize.width

height: imgLoader.sourceSize.height

renderStrategy: Canvas.Immediate

onPaint: {

var ctx = getContext(2d)

ctx.drawImage(imgLoader, 0, 0)

}

}

Image {

id: imgLoader

visible: false

source: isImageUrl ? url : 

}


The idea is to save image to the gallery in onAccepted if user has selected
that option as Canvas has save method which can be used to save image to a
file.

And it works fine, but causing app to crash sometimes when leaving Dialog
page with cancel swipe. SDK outputs a long crash dump.

-Samuli
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] app crashed when using Canvas in Dialog page

2014-08-13 Thread Andrey Kozhevnikov

try to get backtrace and check what exactly is the reason of crash.

14.08.2014 00:49, Samuli Silvius пишет:

Hi,

I have Canvas in Silica Dialog page but app crashes when leaving 
dialog page both with accept or cancel swipe. It does not crash always 
just quite often.


the code:
 Canvas  {
 id:  imageCanvas
 visible:  isImageUrl
 width:  imgLoader.sourceSize.width
 height:  imgLoader.sourceSize.height
 renderStrategy:  Canvas.Immediate
 onPaint:  {
 var  ctx  =  getContext(2d)
 ctx.drawImage(imgLoader,  0,  0)
 }
 }
 Image  {
 id:  imgLoader
 visible:  false
 source:  isImageUrl  ?  url  :  
 }
The idea is to save image to the gallery in onAccepted if user has 
selected that option as Canvas has save method which can be used to 
save image to a file.


And it works fine, but causing app to crash sometimes when leaving 
Dialog page with cancel swipe. SDK outputs a long crash dump.


-Samuli


___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org


___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] app crashed when using Canvas in Dialog page

2014-08-13 Thread Samuli Silvius
Hi,

Sdk produces this dump, cannot really figure out the reason? Or what
backtrace you mean?

-Samuli


2014-08-13 21:50 GMT+03:00 Andrey Kozhevnikov coderusin...@gmail.com:

  try to get backtrace and check what exactly is the reason of crash.

 14.08.2014 00:49, Samuli Silvius пишет:

 Hi,

  I have Canvas in Silica Dialog page but app crashes when leaving dialog
 page both with accept or cancel swipe. It does not crash always just quite
 often.

  the code:

 Canvas {

 id: imageCanvas

 visible: isImageUrl

 width: imgLoader.sourceSize.width

 height: imgLoader.sourceSize.height

 renderStrategy: Canvas.Immediate

 onPaint: {

 var ctx = getContext(2d)

 ctx.drawImage(imgLoader, 0, 0)

 }

 }

 Image {

 id: imgLoader

 visible: false

 source: isImageUrl ? url : 

 }

  The idea is to save image to the gallery in onAccepted if user has
 selected that option as Canvas has save method which can be used to save
 image to a file.

  And it works fine, but causing app to crash sometimes when leaving
 Dialog page with cancel swipe. SDK outputs a long crash dump.

  -Samuli


 ___
 SailfishOS.org Devel mailing list
 To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org



 ___
 SailfishOS.org Devel mailing list
 To unsubscribe, please send a mail to
 devel-unsubscr...@lists.sailfishos.org

*** glibc detected *** /usr/bin/harbour-jolla2gether: free(): invalid pointer: 
0x71e540a0 ***
=== Backtrace: =
/lib/libc.so.6(+0x79aa9)[0x6e4e0aa9]
/usr/lib/libstdc++.so.6(_ZdlPv+0x1f)[0x6e6efdef]
/usr/lib/libQt5Qml.so.5(_ZN15QQmlContextData7destroyEv+0x224)[0x6f1c2f44]
/usr/lib/libQt5Qml.so.5(_ZN11QQmlPrivate30qdeclarativeelement_destructorEP7QObject+0x34)[0x6f19eda4]
/usr/lib/libQt5Quick.so.5(+0x13cead)[0x6f51bead]
/usr/lib/libQt5Core.so.5(_Z21qDeleteInEventHandlerP7QObject+0x13)[0x6e982d43]
/usr/lib/libQt5Core.so.5(_ZN7QObject5eventEP6QEvent+0x258)[0x6e983808]
/usr/lib/libQt5Quick.so.5(_ZN10QQuickItem5eventEP6QEvent+0x4a)[0x6f4edd2a]
/usr/lib/libQt5Core.so.5(_ZN23QCoreApplicationPrivate13notify_helperEP7QObjectP6QEvent+0x60)[0x6e957a70]
/usr/lib/libQt5Core.so.5(_ZN16QCoreApplication6notifyEP7QObjectP6QEvent+0x64)[0x6e957ae4]
/usr/lib/libQt5Gui.so.5(_ZN15QGuiApplication6notifyEP7QObjectP6QEvent+0x3e)[0x6ec3fbde]
/usr/lib/libQt5Core.so.5(_ZN16QCoreApplication14notifyInternalEP7QObjectP6QEvent+0x7d)[0x6e9577cd]
/usr/lib/libQt5Core.so.5(_ZN23QCoreApplicationPrivate16sendPostedEventsEP7QObjectiP11QThreadData+0x1ef)[0x6e95a4bf]
/usr/lib/libQt5Core.so.5(_ZN16QCoreApplication16sendPostedEventsEP7QObjecti+0x2d)[0x6e95aacd]
/usr/lib/libQt5Core.so.5(+0x25c2ef)[0x6e9aa2ef]
/usr/lib/libglib-2.0.so.0(g_main_context_dispatch+0x23c)[0x6d9eb65c]
/usr/lib/libglib-2.0.so.0(+0x4e8f8)[0x6d9eb8f8]
/usr/lib/libglib-2.0.so.0(g_main_context_iteration+0x85)[0x6d9eba45]
/usr/lib/libQt5Core.so.5(_ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE+0x6e)[0x6e9aa7ce]
/usr/lib/qt5/plugins/platforms/libqwayland-egl.so(+0x35007)[0x6c659007]
/usr/lib/libQt5Core.so.5(_ZN10QEventLoop13processEventsE6QFlagsINS_17ProcessEventsFlagEE+0x24)[0x6e955d84]
/usr/lib/libQt5Core.so.5(_ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE+0xcc)[0x6e95618c]
/usr/lib/libQt5Core.so.5(_ZN16QCoreApplication4execEv+0x87)[0x6e95d417]
/usr/lib/libQt5Gui.so.5(_ZN15QGuiApplication4execEv+0x25)[0x6ec355b5]
/usr/bin/harbour-jolla2gether(main+0x222)[0x6f779662]
/lib/libc.so.6(__libc_start_main+0xf8)[0x6e480408]
/usr/bin/harbour-jolla2gether(+0x184d)[0x6f77984d]
=== Memory map: 
204e5000-205e5000 rw-p  00:00 0 
24b92000-24ba ---p  00:00 0 
24ba-24bb rw-p  00:00 0 
24bb-24bc2000 ---p  00:00 0 
2bffb000-2c024000 rwxp  00:00 0 
2e70-2e749000 rw-p  00:00 0 
2fe0-2fe09000 rw-p  00:00 0 
2fe09000-2fe0a000 ---p  00:00 0 
2fe0a000-2feff000 rwxp  00:00 0 
2feff000-2ff0 ---p  00:00 0 
3030-3040 rw-p  00:00 0 
3670-36709000 rw-p  00:00 0 
36709000-3670a000 ---p  00:00 0 
3670a000-3676a000 rwxp  00:00 0 
3676a000-3676b000 ---p  00:00 0 
3ce03000-3ce04000 r-xp  00:00 0 
3dd8e000-3dd8f000 r-xp  00:00 0 
4480-44819000 rw-p  00:00 0 
45499000-4549a000 r-xp  00:00 0 
45bde000-45bdf000 r-xp  00:00 0 
49969000-4996a000 r-xp  00:00 0 
4b10-4b139000 rw-p  00:00 0 
4b70-4b719000 rw-p  00:00 0 
4d0a5000-4d0ce000 ---p  00:00 0 
5603f000-5604 r-xp  00:00 0 
5780-57841000 rw-p  00:00 0 
57841000-5790 ---p  00:00 0 
57904000-57905000 ---p  00:00 0 
57905000-57907000 ---p  

Re: [SailfishDevel] app crashed when using Canvas in Dialog page

2014-08-13 Thread Kimmo Lindholm
Do you have virtual keyboard visible when closing dialog?

https://together.jolla.com/question/44780/closing-dialog-with-vkb-active-breaks-canvas-on-returning-page/

-kimmo

From: devel-boun...@lists.sailfishos.org 
[mailto:devel-boun...@lists.sailfishos.org] On Behalf Of Samuli Silvius
Sent: Wednesday, August 13, 2014 10:07 PM
To: Sailfish OS Developers
Subject: Re: [SailfishDevel] app crashed when using Canvas in Dialog page

Hi,

Sdk produces this dump, cannot really figure out the reason? Or what backtrace 
you mean?

-Samuli

2014-08-13 21:50 GMT+03:00 Andrey Kozhevnikov 
coderusin...@gmail.commailto:coderusin...@gmail.com:
try to get backtrace and check what exactly is the reason of crash.
14.08.2014 00:49, Samuli Silvius пишет:
Hi,

I have Canvas in Silica Dialog page but app crashes when leaving dialog page 
both with accept or cancel swipe. It does not crash always just quite often.

the code:

Canvas {

id: imageCanvas

visible: isImageUrl

width: imgLoader.sourceSize.width

height: imgLoader.sourceSize.height

renderStrategy: Canvas.Immediate

onPaint: {

var ctx = getContext(2d)

ctx.drawImage(imgLoader, 0, 0)

}

}

Image {

id: imgLoader

visible: false

source: isImageUrl ? url : 

}
The idea is to save image to the gallery in onAccepted if user has selected 
that option as Canvas has save method which can be used to save image to a file.

And it works fine, but causing app to crash sometimes when leaving Dialog page 
with cancel swipe. SDK outputs a long crash dump.

-Samuli


___

SailfishOS.org Devel mailing list

To unsubscribe, please send a mail to 
devel-unsubscr...@lists.sailfishos.orgmailto:devel-unsubscr...@lists.sailfishos.org


___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to 
devel-unsubscr...@lists.sailfishos.orgmailto:devel-unsubscr...@lists.sailfishos.org

___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Re: [SailfishDevel] app crashed when using Canvas in Dialog page

2014-08-13 Thread Samuli Silvius
I tried FramebufferObject and now app crashes immediately when opening that
dialog page, right after Canvas's onPaint is executed (I have console.log
on last line of onPaint()).


[W] QWaylandGLContext::makeCurrent:100 -
QEGLPlatformContext::makeCurrent: eglError: 3002, this: 0x71661d28


[W] GLAcquireContext::GLAcquireContext:80 - Can't make current GL context

Remote application crashed: Process killed by signal



2014-08-13 22:27 GMT+03:00 Kimmo Lindholm kimmo.lindh...@eke.fi:

  ok.



 I have not used renderStrategy at all in paint,

 but renderTarget: Canvas.FramebufferObject



 I have also dialogs there, and only way I got it broken, is that vkb case.



 -kimmo



 *From:* devel-boun...@lists.sailfishos.org [mailto:
 devel-boun...@lists.sailfishos.org] *On Behalf Of *Samuli Silvius
 *Sent:* Wednesday, August 13, 2014 10:20 PM

 *To:* Sailfish OS Developers
 *Subject:* Re: [SailfishDevel] app crashed when using Canvas in Dialog
 page



 No vkb used on that page. Only couple of TextSwitch:es



 -Samuli



 2014-08-13 22:15 GMT+03:00 Kimmo Lindholm kimmo.lindh...@eke.fi:

 Do you have virtual keyboard visible when closing dialog?




 https://together.jolla.com/question/44780/closing-dialog-with-vkb-active-breaks-canvas-on-returning-page/



 -kimmo



 *From:* devel-boun...@lists.sailfishos.org [mailto:
 devel-boun...@lists.sailfishos.org] *On Behalf Of *Samuli Silvius
 *Sent:* Wednesday, August 13, 2014 10:07 PM
 *To:* Sailfish OS Developers
 *Subject:* Re: [SailfishDevel] app crashed when using Canvas in Dialog
 page



 Hi,



 Sdk produces this dump, cannot really figure out the reason? Or what
 backtrace you mean?



 -Samuli



 2014-08-13 21:50 GMT+03:00 Andrey Kozhevnikov coderusin...@gmail.com:

 try to get backtrace and check what exactly is the reason of crash.

 14.08.2014 00:49, Samuli Silvius пишет:

   Hi,



 I have Canvas in Silica Dialog page but app crashes when leaving dialog
 page both with accept or cancel swipe. It does not crash always just quite
 often.



 the code:

 Canvas {

 id: *imageCanvas*

 visible: *isImageUrl*

 width: *imgLoader*.sourceSize.width

 height: *imgLoader*.sourceSize.height

 renderStrategy: Canvas.Immediate

 onPaint: {

 var *ctx* = *getContext*(2d)

 *ctx*.drawImage(*imgLoader*, 0, 0)

 }

 }

 Image {

 id: *imgLoader*

 visible: false

 source: *isImageUrl* ? *url* : 

 }

  The idea is to save image to the gallery in onAccepted if user has
 selected that option as Canvas has save method which can be used to save
 image to a file.



 And it works fine, but causing app to crash sometimes when leaving Dialog
 page with cancel swipe. SDK outputs a long crash dump.



 -Samuli



 ___

 SailfishOS.org Devel mailing list

 To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org




 ___
 SailfishOS.org Devel mailing list
 To unsubscribe, please send a mail to
 devel-unsubscr...@lists.sailfishos.org




 ___
 SailfishOS.org Devel mailing list
 To unsubscribe, please send a mail to
 devel-unsubscr...@lists.sailfishos.org



 ___
 SailfishOS.org Devel mailing list
 To unsubscribe, please send a mail to
 devel-unsubscr...@lists.sailfishos.org

___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org