GNOME Bugzilla – Bug 606837
Segmentation fault with relative paths
Last modified: 2010-02-07 10:25:13 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.
Created attachment 151332 [details] [review] Fix segfaults while opening
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.