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 562384 - broken codegen causes exceptions to be silently suppressed [affects all versions including trunk]
broken codegen causes exceptions to be silently suppressed [affects all versi...
Status: RESOLVED DUPLICATE of bug 475922
Product: vala
Classification: Core
Component: Code Generator
0.5.x
Other All
: Normal blocker
: ---
Assigned To: Jürg Billeter
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2008-11-26 22:07 UTC by Martin Olsson
Modified: 2008-11-30 23:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
minimal testcase showing codegen causing silently suppressed exception (512 bytes, application/x-compressed-tar)
2008-11-26 22:08 UTC, Martin Olsson
Details

Description Martin Olsson 2008-11-26 22:07:47 UTC
Please describe the problem:
After 3 days of debugging I finally managed to reduce this weird bug down to a small understandable test case.

Basically the Vala code generator sometimes generates code for methods in such a way that exceptions (g_error codes) are suppressed and forgotten.

That this is a codegen bug because evident when you look at the generated code for ForwardingMethod(), it looks like this:
static gint someclass_ForwardingMethod (GError** error) {
        GError * inner_error;
        inner_error = NULL;
        return someclass_MethodTwentyTwo (&inner_error);
}
Clearly, whatever is written to inner_error will be ignored and forgotten, instead I think it was intended that it should say &error directly and that the inner_error should never have been declared?

Feel free to use this test case as a regression test in the future.

Steps to reproduce:
1. download the attached test case
2. execute "make run"

Actual:
The assert(false) is reached.

Expected:
Since the method always throws an error, it should be impossible to reach the assert.

Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Martin Olsson 2008-11-26 22:08:40 UTC
Created attachment 123494 [details]
minimal testcase showing codegen causing silently suppressed exception
Comment 2 Martin Olsson 2008-11-27 20:21:08 UTC
FWIW, I suspect that this bug might be hiding somewhere between line 1966 and 2044 inside the file vala/valaccodebasemodule.vala
Comment 3 Jürg Billeter 2008-11-29 19:27:43 UTC
Thanks for taking the time to report this bug.
This particular bug has already been reported into our bug tracking system, but we are happy to tell you that the problem has already been fixed. It should be solved in the next software version. You may want to check for a software upgrade.


*** This bug has been marked as a duplicate of 475922 ***
Comment 4 Martin Olsson 2008-11-30 23:03:45 UTC
Thank you very much for fixing this bug Jürg. Keep up the good work. Vala rocks!