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 666480 - [REGRESSION] Vala from git - virtual method in interface tries to access the self->priv
[REGRESSION] Vala from git - virtual method in interface tries to access the ...
Status: RESOLVED DUPLICATE of bug 589968
Product: vala
Classification: Core
Component: Code Generator
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks: 589968
 
 
Reported: 2011-12-19 03:26 UTC by Maciej (Matthew) Piechotka
Modified: 2012-01-17 09:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
mapiterator.vala (4.18 KB, text/x-vala)
2011-12-19 03:26 UTC, Maciej (Matthew) Piechotka
  Details
mapiterator.c (from 0.14) (12.19 KB, text/x-csrc)
2011-12-19 03:28 UTC, Maciej (Matthew) Piechotka
  Details
mapiterator.c (from git) (12.19 KB, text/x-csrc)
2011-12-19 03:29 UTC, Maciej (Matthew) Piechotka
  Details
mapiterator.c (from git) (13.22 KB, text/x-csrc)
2011-12-19 03:30 UTC, Maciej (Matthew) Piechotka
  Details
Reintroduce memory leak when using generics in interfaces (1.10 KB, patch)
2012-01-17 09:08 UTC, Luca Bruno
none Details | Review

Description Maciej (Matthew) Piechotka 2011-12-19 03:26:46 UTC
Created attachment 203825 [details]
mapiterator.vala

mapiterator.vala from current git master compiles on Vala 0.14 but not current git master:


  CC     libgee_0_8_la-mapiterator.lo
mapiterator.c: In function ‘gee_map_iterator_real_fold’:
mapiterator.c:178:29: error: dereferencing pointer to incomplete type
mapiterator.c:178:86: error: dereferencing pointer to incomplete type
mapiterator.c:179:29: error: dereferencing pointer to incomplete type
mapiterator.c:179:86: error: dereferencing pointer to incomplete type
mapiterator.c:206:30: error: dereferencing pointer to incomplete type
mapiterator.c:206:88: error: dereferencing pointer to incomplete type
mapiterator.c:207:30: error: dereferencing pointer to incomplete type
mapiterator.c:207:88: error: dereferencing pointer to incomplete type
mapiterator.c: In function ‘gee_map_iterator_real_foreach’:
mapiterator.c:248:29: error: dereferencing pointer to incomplete type
mapiterator.c:248:86: error: dereferencing pointer to incomplete type
mapiterator.c:249:29: error: dereferencing pointer to incomplete type
mapiterator.c:249:86: error: dereferencing pointer to incomplete type
mapiterator.c:270:30: error: dereferencing pointer to incomplete type
mapiterator.c:270:88: error: dereferencing pointer to incomplete type
mapiterator.c:271:30: error: dereferencing pointer to incomplete type
mapiterator.c:271:88: error: dereferencing pointer to incomplete type
Comment 1 Maciej (Matthew) Piechotka 2011-12-19 03:28:43 UTC
Created attachment 203826 [details]
mapiterator.c (from 0.14)
Comment 2 Maciej (Matthew) Piechotka 2011-12-19 03:29:40 UTC
Created attachment 203827 [details]
mapiterator.c (from git)
Comment 3 Maciej (Matthew) Piechotka 2011-12-19 03:30:53 UTC
Created attachment 203828 [details]
mapiterator.c (from git)

Ups. Incorrect file
Comment 4 Luca Bruno 2011-12-21 07:25:07 UTC
That's because get_key() and get_value() return an owned value. I believe the old code leaked.
Comment 5 Maciej (Matthew) Piechotka 2011-12-21 13:00:14 UTC
(In reply to comment #4)
> That's because get_key() and get_value() return an owned value. I believe the
> old code leaked.

Yes. However the same problem affects fold in Traversable which does not have this problem:

	public virtual A fold<A> (FoldFunc<A, G> f, owned A seed)
	{
		this.foreach ((item) => {seed = f ((owned) item, (owned) seed);});
		return (owned) seed;
	}

(C code:

(...)
        _tmp1_ = item;
        item = NULL;
(...)
        _tmp3_ = _tmp0_ (_tmp1_, _tmp2_, _tmp0__target);
(...)
        ((item == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (item = (self->priv->g_destroy_func (item), NULL));

)
Comment 6 Luca Bruno 2011-12-21 14:36:19 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > That's because get_key() and get_value() return an owned value. I believe the
> > old code leaked.
> 
> Yes. However the same problem affects fold in Traversable which does not have
> this problem:

It does, "item" is owned.
Comment 7 Maciej (Matthew) Piechotka 2011-12-21 14:41:01 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > (In reply to comment #4)
> > > That's because get_key() and get_value() return an owned value. I believe the
> > > old code leaked.
> > 
> > Yes. However the same problem affects fold in Traversable which does not have
> > this problem:
> 
> It does, "item" is owned.

I mean that it does not have memory leak yet it produces non-compiling code.
Comment 8 Maciej (Matthew) Piechotka 2012-01-16 23:48:09 UTC

*** This bug has been marked as a duplicate of bug 589968 ***
Comment 9 Luca Bruno 2012-01-17 09:08:58 UTC
Created attachment 205427 [details] [review]
Reintroduce memory leak when using generics in interfaces

The bug was present in older Vala versions. Reintroducing it avoids
breaking old code, until a proper fix is found.

Does the patch addresses your problem?