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 606837 - Segmentation fault with relative paths
Segmentation fault with relative paths
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2010-01-13 12:30 UTC by pancake
Modified: 2010-02-07 10:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix segfaults while opening (1.87 KB, patch)
2010-01-13 12:32 UTC, pancake
none Details | Review

Description pancake 2010-01-13 12:30:41 UTC
It is possible to get segfaults in many situations while using valac by giving to him relative paths.

Here's some examples of segfaults.

A simple patch is attached to fix those segfaults. But we should review all FileStream.open to avoid those crashes:

$ mkdir -p foo/bar
$ :> foo/bar/cow.vala
$ valac -C foo/bar/cow.vala -d foo
Segmentation fault

Another one:

$ mkdir -p foo/bar foo2
$ :> foo/bar/cow.vala
$ cd foo2
$ valac --library ../foo/bar/lib -C ../foo/bar/test.vala -d ../foo/bar

Do the --library should accept paths? I thought 'name' is just for 'library name' not library path.

Do we really want to concatenate all relative paths to the destination directory? shouldn't we just get the filename?

It is not specified anywhere which should be the correct way to react in such situations.
Comment 1 pancake 2010-01-13 12:32:49 UTC
Created attachment 151332 [details] [review]
Fix segfaults while opening
Comment 2 Jürg Billeter 2010-02-07 10:25:13 UTC
commit 3587d178d7f612de8862ef23d3ab8e464aea4e16
Author: Jürg Billeter <j@bitron.ch>
Date:   Sun Feb 7 11:23:48 2010 +0100

    Fix crash when opening file fails
    
    Based on patch by pancake, fixes bug 606837.