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 644938 - generic type parameters with underscores seg fault
generic type parameters with underscores seg fault
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Code Generator
0.11.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2011-03-16 17:32 UTC by Jonathan Ryan
Modified: 2016-11-04 08:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test program (177 bytes, text/x-vala)
2011-03-16 17:32 UTC, Jonathan Ryan
  Details
program ran, gdb backtrace attached (2.29 KB, text/plain)
2011-03-16 17:32 UTC, Jonathan Ryan
  Details
Allow underscores in type parameter names (includes testcase) (3.29 KB, patch)
2013-09-01 00:05 UTC, Severin Heiniger
none Details | Review
codegen: Allow underscores in type parameter names (3.63 KB, patch)
2014-06-27 05:14 UTC, Evan Nemerson
none Details | Review
fixes this bug (3.41 KB, patch)
2016-08-08 12:11 UTC, Matthias Berndt
rejected Details | Review
codegen: Allow underscores in type parameter names (3.50 KB, patch)
2016-11-03 21:37 UTC, Rico Tzschichholz
committed Details | Review

Description Jonathan Ryan 2011-03-16 17:32:18 UTC
Created attachment 183556 [details]
test program

The attached test program is fixed by removing the underscore in the type generic. If this isn't allowed vala should at least catch it. It took me a while to figure this out, so it's mostly likely not that trivial.

Attached test program, and output.
Comment 1 Jonathan Ryan 2011-03-16 17:32:50 UTC
Created attachment 183557 [details]
program ran, gdb backtrace attached
Comment 2 Severin Heiniger 2013-09-01 00:05:20 UTC
Created attachment 253727 [details] [review]
Allow underscores in type parameter names (includes testcase)

Thank you for taking the time to report this bug.

The compiled program crashes because it tries to register GObject properties whose names contain underscores, which are not allowed. Replacing the underscores in the code generator fixes the problem.

Attached is a simple patch and a corresponding test case.
Comment 3 Evan Nemerson 2014-06-27 05:14:51 UTC
Created attachment 279359 [details] [review]
codegen: Allow underscores in type parameter names

Rebased, looks fine to me.
Comment 4 Matthias Berndt 2016-08-08 12:11:21 UTC
Created attachment 332938 [details] [review]
fixes this bug

Hey guys,

I noticed this bug independently, fixed it and then found this bug report. I'm attaching a patch, it would be great if somebody could take a look…

Cheers,
Matthias
Comment 5 Matthias Berndt 2016-08-08 17:41:08 UTC
Sorry, I mixed up two completely unrelated bugs. Please ignore my comment and my patch.
Comment 6 Rico Tzschichholz 2016-11-03 21:37:53 UTC
Created attachment 339079 [details] [review]
codegen: Allow underscores in type parameter names
Comment 7 Rico Tzschichholz 2016-11-04 08:04:14 UTC
Attachment 339079 [details] pushed as 457743f - codegen: Allow underscores in type parameter names