After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 702754 - clutter_stage_read_pixels makes language bindings crash
clutter_stage_read_pixels makes language bindings crash
Status: RESOLVED DUPLICATE of bug 653590
Product: clutter
Classification: Platform
Component: ClutterStage
git master
Other Linux
: Normal normal
: ---
Assigned To: clutter-maint
clutter-maint
Depends on:
Blocks:
 
 
Reported: 2013-06-20 15:29 UTC by Kalev Lember
Modified: 2014-01-27 15:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
stage: Add read_pixels_with_length for language bindings (4.04 KB, patch)
2013-06-20 15:39 UTC, Kalev Lember
none Details | Review

Description Kalev Lember 2013-06-20 15:29:35 UTC
I am running into the following assertion when using clutter_stage_read_pixels from JS bindings:

Gjs:ERROR:gi/arg.c:2140:gjs_array_from_fixed_size_array: assertion failed: (length != -1)

The crash happens when constructing the return value. The C function's return value is a plain C array, which doesn't include enough information to tell the language bindings what size the corresponding JS array has to be.

I can think of two ways to solve this:

 1) Create another function that returns a GByteArray

 2) Create another function that is solely for language bindings, and has an extra (out) param to return the array size. THis would be renamed back to clutter_stage_read_pixels in the gir file.
Comment 1 Kalev Lember 2013-06-20 15:39:43 UTC
Created attachment 247338 [details] [review]
stage: Add read_pixels_with_length for language bindings

The current clutter_stage_read_pixels returns a plain C array, which doesn't
include enough information for higher level languages, where we'd need to know
the exact size to construct the array.

This commit implements clutter_stage_read_pixels_with_length that has an extra
(out) param with the array length, mostly only for language bindings.
Comment 2 Emmanuele Bassi (:ebassi) 2013-06-22 09:36:56 UTC
the actual solution would be to commit the patch for bug 653590 instead, which makes read_pixels() an async operation that gets performed at the right point in the pipeline.

it would be great if you could test the patch there and verify that it works.
Comment 3 Kalev Lember 2013-06-22 11:47:26 UTC
Sure, will do -- can you update the patch there, please? It doesn't seem to apply on top of current clutter tree.
Comment 4 Zeeshan Ali 2013-09-24 21:19:10 UTC
(In reply to comment #3)
> Sure, will do -- can you update the patch there, please? It doesn't seem to
> apply on top of current clutter tree.

Emmanuele? Would be nice to get this fix in sooner than later so that get basic printing implemented in Maps (bug#702583).
Comment 5 Emmanuele Bassi (:ebassi) 2013-09-24 22:15:47 UTC
too late for 3.10: 1.16.0 was released and we cannot add new API for the 1.16 series.

for 3.12, I really think we should get bug 653590 done. I'm going to close this as a duplicate.

*** This bug has been marked as a duplicate of bug 653590 ***