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 655726 - crash when assigning an undefined reference to a constant
crash when assigning an undefined reference to a constant
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Semantic Analyzer
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2011-08-01 15:34 UTC by Abderrahim Kitouni
Modified: 2011-08-02 14:26 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Abderrahim Kitouni 2011-08-01 15:34:53 UTC
The following code will make valac crash if one forgets to include config.vapi and this is causing anjuta to crash (bug 651151)

public class Main : Object 
{
        const string UI_FILE = Config.PACKAGE_DATA_DIR;
        static int main (string[] args) 
        {
                return 0;
        }
}

Here is the backtrace:

Program received signal SIGSEGV, Segmentation fault.
0xb7d0072b in vala_data_type_compatible (self=0x0, target_type=0x9d661a0)
    at /home/dev/GNOME/vala/vala/valadatatype.vala:311
311		public virtual bool compatible (DataType target_type) {
(gdb) bt
  • #0 vala_data_type_compatible
    at /home/dev/GNOME/vala/vala/valadatatype.vala line 311
  • #1 vala_constant_real_check
    at /home/dev/GNOME/vala/vala/valaconstant.vala line 202
  • #2 vala_constant_real_check
    at valaconstant.c line 2028
  • #3 vala_code_node_check
    at /home/dev/GNOME/vala/vala/valacodenode.vala line 124
  • #4 vala_class_real_check
    at /home/dev/GNOME/vala/vala/valaclass.vala line 1073
  • #5 vala_class_real_check
    at valaclass.c line 6647
  • #6 vala_code_node_check
    at /home/dev/GNOME/vala/vala/valacodenode.vala line 124
  • #7 vala_source_file_check
    at /home/dev/GNOME/vala/vala/valasourcefile.vala line 317
  • #8 vala_semantic_analyzer_real_visit_source_file
    at /home/dev/GNOME/vala/vala/valasemanticanalyzer.vala line 242
  • #9 vala_code_visitor_visit_source_file
    at /home/dev/GNOME/vala/vala/valacodevisitor.vala line 36
  • #10 vala_source_file_accept
    at /home/dev/GNOME/vala/vala/valasourcefile.vala line 162
  • #11 vala_code_context_accept
    at /home/dev/GNOME/vala/vala/valacodecontext.vala line 451
  • #12 vala_semantic_analyzer_analyze
    at /home/dev/GNOME/vala/vala/valasemanticanalyzer.vala line 236
  • #13 vala_code_context_check
    at /home/dev/GNOME/vala/vala/valacodecontext.vala line 466
  • #14 vala_compiler_run
    at /home/dev/GNOME/vala/compiler/valacompiler.vala line 332
  • #15 vala_compiler_main
    at /home/dev/GNOME/vala/compiler/valacompiler.vala line 561
  • #16 main
    at /home/dev/GNOME/vala/compiler/valacompiler.vala line 531

Comment 1 Luca Bruno 2011-08-02 14:26:38 UTC
commit a4d21426be1e1256b3368bb68ced00a49906dcc7
Author: Luca Bruno <lucabru@src.gnome.org>
Date:   Tue Aug 2 16:25:31 2011 +0200

    Guard for possible errors when checking the value of constants
    
    Fixes bug 655726.

This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.