GST objects are limited in size by 64K

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

GST objects are limited in size by 64K

Max Paklin
Hello,

I've recently stumbled upon a case when one of our elements exceeded 64K in
size (I deal with a lot of legacy pre-GST code, so this issue is an artifact
of that).
Approaching or exceeding 64K resulted in a number of rather peculiar
consequences (reproduced on both Linux and Windows). For example,


1. when sizeof(element) gets close to 64K, I got the following

(gst-launch-0.10:2236): GLib-GObject-WARNING **: specified instance size for
type `testelement' is smaller than the parent type's `GstElement' instance
size

(gst-launch-0.10:2236): GLib-CRITICAL **: g_once_init_leave: assertion
`initialization_value != 0' failed

** (gst-launch-0.10:2236): CRITICAL **: file
..\..\..\Source\gstreamer\gst\gstelementfactory.c: line 263: assertion
`g_type_is_a (type, GST_TYPE_ELEMENT)' failed

Googling revealed that errors of this kind usually take place when there is
a version mismatch between glib and its derivatives such as gst.
Well... usually, but not always I just learned.


2. when sizeof(element) got over 66K my element was "successfully" created,
but because the size of it was presumed to be around 2K (16 bit truncation),
using my internal data resulted in the whole thing crashing rather quick.


I have a question. Am I the only one who thinks that 16 bit object size
limitation is misplaced in 21st century?
I remember working on 16 bit computers back in early 80s, but with gobject
being a late 90th child, this seems rather strange. Is there a good reason
for this limitation?

Personally when I have to deal with this on a server that has GIGs of free
memory, I turn to get grumpy. Sure, I can work around it, but it requires me
to put out a bit of a code that makes everything less reliable.
I know I should probably take this up to glib folks, but I was wondering if
someone here might know that answer.

Thanks for letting me vent.
-- Max.


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: GST objects are limited in size by 64K

David Schleef-2
On Thu, Aug 04, 2011 at 03:50:40PM -0700, Max Paklin wrote:
> I've recently stumbled upon a case when one of our elements exceeded 64K in
> size (I deal with a lot of legacy pre-GST code, so this issue is an artifact
> of that).

> I have a question. Am I the only one who thinks that 16 bit object size
> limitation is misplaced in 21st century?

The 64 kB limitation is built into the GObject ABI.  Yes it sucks, but
it's also easy to work around.

> I know I should probably take this up to glib folks,

You could, but it probably wouldn't go very far, since this is a
known ABI problem and can't be fixed without an ABI break.  It would
be nice, however, if there was a warning or assertion with large
instance sizes.  Please file a bug report on glib about that.



David

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

RE: GST objects are limited in size by 64K

Max Paklin
Thanks David.
It's good to know that it's a known issue. I understand that it probably
won't be changed any time soon (if ever). My question was mostly on why it
was there to begin with.

I will file a bug against glib on lack of warning/assert when the size of
the object being created/registered exceeds 16 bit.

-- Max.



-----Original Message-----
From: gstreamer-devel-bounces+mpaklin=[hidden email]
[mailto:gstreamer-devel-bounces+mpaklin=[hidden email]]
On Behalf Of David Schleef
Sent: Thursday, August 04, 2011 5:20 PM
To: Discussion of the development of and with GStreamer
Subject: Re: GST objects are limited in size by 64K

On Thu, Aug 04, 2011 at 03:50:40PM -0700, Max Paklin wrote:
> I've recently stumbled upon a case when one of our elements exceeded
> 64K in size (I deal with a lot of legacy pre-GST code, so this issue
> is an artifact of that).

> I have a question. Am I the only one who thinks that 16 bit object
> size limitation is misplaced in 21st century?

The 64 kB limitation is built into the GObject ABI.  Yes it sucks, but it's
also easy to work around.

> I know I should probably take this up to glib folks,

You could, but it probably wouldn't go very far, since this is a known ABI
problem and can't be fixed without an ABI break.  It would be nice, however,
if there was a warning or assertion with large instance sizes.  Please file
a bug report on glib about that.



David

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel