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 608548 - Regression: not able to call multiple struct constructors in constructor
Regression: not able to call multiple struct constructors in constructor
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Semantic Analyzer
0.7.x
Other Linux
: High blocker
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2010-01-30 18:34 UTC by Jens Georg
Modified: 2010-02-01 11:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Bug 608548 - Regression: not able to call multiple struct constructors (1009 bytes, patch)
2010-01-30 19:26 UTC, Marc-Andre Lureau
none Details | Review

Description Jens Georg 2010-01-30 18:34:21 UTC
This snippet

public class Foo : Object {
    private Foo() {
        var tv1 = TimeVal();
        var tv2 = TimeVal();
    }
}

results in
error: Multiple constructor calls in the same constructor are not permitted
        var tv2 = TimeVal();
Comment 1 Jens Georg 2010-01-30 18:37:32 UTC
Looks like this is the culprit:

http://git.gnome.org/browse/vala/commit/?id=e42d65d7856ab1f9ab048daf5749951f7d1c9f20
Comment 2 Sebastian Pölsterl 2010-01-30 19:15:40 UTC
This commit broke gnome-dvb-daemon build, too.

** CRITICAL **: vala_ccode_fragment_append: assertion `node != NULL' failed
aborting...

Program received signal SIGABRT, Aborted.
0x00007ffff71444b5 in *__GI_raise (sig=<value optimized out>)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64	../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
---Type <return> to continue, or q <return> to quit---
	in ../nptl/sysdeps/unix/sysv/linux/raise.c
(gdb) bt
  • #0 *__GI_raise
    at ../nptl/sysdeps/unix/sysv/linux/raise.c line 64
  • #1 *__GI_abort
    at abort.c line 92
  • #2 IA__g_logv
    at /build/buildd/glib2.0-2.22.3/glib/gmessages.c line 549
  • #3 IA__g_log
    at /build/buildd/glib2.0-2.22.3/glib/gmessages.c line 569
  • #4 vala_gerror_module_real_append_local_free
    at valagerrormodule.c line 1350
  • #5 vala_ccode_base_module_real_append_local_free
    at valaccodebasemodule.c line 7072
  • #6 vala_gerror_module_uncaught_error_statement
    at valagerrormodule.c line 815
  • #7 vala_gerror_module_real_add_simple_check
    at valagerrormodule.c line 1043
  • #8 vala_ccode_base_module_real_visit_expression_statement---Type <return> to continue, or q <return> to quit---
    at valaccodebasemodule.c line 6909
  • #9 vala_block_real_accept_children
    at valablock.c line 1453
  • #10 vala_ccode_base_module_real_visit_block
    at valaccodebasemodule.c line 3815
  • #11 vala_gerror_module_real_visit_try_statement
    at valagerrormodule.c line 1181
  • #12 vala_block_real_accept_children
    at valablock.c line 1453
  • #13 vala_ccode_base_module_real_visit_block
    at valaccodebasemodule.c line 3815
  • #14 vala_gerror_module_real_visit_try_statement
    at valagerrormodule.c line 1178
  • #15 vala_block_real_accept_children
    at valablock.c line 1453
  • #16 vala_ccode_base_module_real_visit_block
    at valaccodebasemodule.c line 3815
  • #17 vala_ccode_method_module_real_visit_method
    at valaccodemethodmodule.c line 1093
  • #18 vala_class_real_accept_children
    at valaclass.c line 1141
  • #19 vala_gtype_module_real_visit_class
    at valagtypemodule.c line 1816
  • #20 vala_gobject_module_real_visit_class
    at valagobjectmodule.c line 634
  • #21 vala_source_file_accept_children
    at valasourcefile.c line 351
  • #22 vala_ccode_base_module_real_visit_source_file
    at valaccodebasemodule.c line 1225
  • #23 vala_ccode_base_module_real_emit
    at valaccodebasemodule.c line 838
  • #24 vala_ccode_generator_real_emit
    at valaccodegenerator.c line 435
  • #25 vala_compiler_run
    at valacompiler.c line 762
  • #26 vala_compiler_main
    at valacompiler.c line 1138
  • #27 __libc_start_main
    at libc-start.c line 220
  • #28 _start
    at ../sysdeps/x86_64/elf/start.S line 113


Finally, gcc complains, too (not sure if that's related or not):

src/RecordingsStore.c: In function 'dvb_recordings_store_restore_from_dir':
src/RecordingsStore.c:899: error: duplicate label '__catch45_g_error'
src/RecordingsStore.c:830: note: previous definition of '__catch45_g_error' was here
src/RecordingsStore.c:909: error: duplicate label '__finally45'
src/RecordingsStore.c:840: note: previous definition of '__finally45' was here
src/RecordingsStore.c:965: error: duplicate label '__catch45_g_error'
src/RecordingsStore.c:830: note: previous definition of '__catch45_g_error' was here
src/RecordingsStore.c:975: error: duplicate label '__finally45'
src/RecordingsStore.c:840: note: previous definition of '__finally45' was here
src/RecordingsStore.c:1048: error: duplicate label '__catch45_g_error'
src/RecordingsStore.c:830: note: previous definition of '__catch45_g_error' was here
src/RecordingsStore.c:1058: error: duplicate label '__finally45'
src/RecordingsStore.c:840: note: previous definition of '__finally45' was here
make[2]: *** [src/gnome_dvb_daemon-RecordingsStore.o] Error 1
Comment 3 Marc-Andre Lureau 2010-01-30 19:26:14 UTC
Created attachment 152645 [details] [review]
Bug 608548 - Regression: not able to call multiple struct constructors
Comment 4 Sebastian Pölsterl 2010-01-30 20:17:22 UTC
Turns out my issue is not related, I filed a separate bug 608553. Sorry, for the noise.
Comment 5 Michael 'Mickey' Lauer 2010-01-31 16:56:07 UTC
Confirming, breaks fsogsmd as well.
Comment 6 Jürg Billeter 2010-02-01 11:19:47 UTC
The patch doesn't look right. Unless I'm missing something, this would break chaining up for structs again.
Comment 7 Jürg Billeter 2010-02-01 11:22:02 UTC
commit 6f42cc9b284f1258698c9f64222df407457a3395
Author: Jürg Billeter <j@bitron.ch>
Date:   Mon Feb 1 12:18:31 2010 +0100

    Do not consider struct creation as chain-up
    
    Fixes bug 608548.