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 635194 - Assertion failed with lambda using upper closure member
Assertion failed with lambda using upper closure member
Status: RESOLVED INCOMPLETE
Product: vala
Classification: Core
Component: Code Generator
0.11.x
Other All
: Urgent normal
: ---
Assigned To: Vala maintainers
Vala maintainers
critical-on-valid-code test-case
Depends on:
Blocks:
 
 
Reported: 2010-11-18 17:28 UTC by Radosław Szkodziński
Modified: 2014-06-27 02:09 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Radosław Szkodziński 2010-11-18 17:28:04 UTC
The following code produces an error while compiling with vala 0.11.2:

Code:
class Foo {
        public void print_handler (string msg) {
        }
        public static void main (string[] args) {
                var foo = new Foo ();
                set_print_handler((msg) => {foo.print_handler(msg);});
        }
}

Error:
**
ERROR:arraylist.c:348:vala_array_list_real_get: assertion failed: (_tmp0_)
Aborted

Making foo a global variable works around the issue.
Comment 1 Luca Bruno 2010-11-19 19:26:32 UTC
Thanks for reporting the bug.
I'm not able to reproduce it. Could you please provide the test case full of all definitions?
Comment 2 Radosław Szkodziński 2010-11-20 12:54:47 UTC
Previous info was for Hardened Gentoo Linux.
The following is for Windows Val(a)IDE Vala 0.11.2 build, ran in latest MSYS.

AstralStorm@destiny-vm ~
$ valac test.vala
**
ERROR:arraylist.c:335:vala_array_list_real_get: assertion failed: ((index >= 0)
&& (index < self->priv->_size))

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

AstralStorm@destiny-vm ~
$ valac --version
Vala 0.11.2
Comment 3 Evan Nemerson 2014-06-27 02:09:34 UTC
Thanks for taking the time to report this bug.
This bug report isn't very useful because it doesn't describe the bug well. If you have time and can still reproduce the bug, please read http://bugzilla.gnome.org/bug-HOWTO.html and add a more useful description to this bug.