Bug 51061 - Deprecated -I- option causes segfault
Summary: Deprecated -I- option causes segfault
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: preprocessor (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: 4.7.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-09 14:44 UTC by Ryan Mansfield
Modified: 2011-11-09 17:28 UTC (History)
2 users (show)

See Also:
Host: x86_64-linux-gnu
Target: arm-unknown-linux-gnueabi
Build: x86_64-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Untested (258 bytes, patch)
2011-11-09 14:59 UTC, Paolo Carlini
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan Mansfield 2011-11-09 14:44:27 UTC
$ touch t.c
$ ./xgcc -B. -I- t.c
cc1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
$ ./xgcc -v
Using built-in specs.
COLLECT_GCC=./xgcc
Target: arm-unknown-linux-gnueabi
Configured with: ../configure --target=arm-unknown-linux-gnueabi --prefix=/home/ryan/x-tools/arm-unknown-linux-gnueabi --with-sysroot=/home/ryan/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sys-root --disable-multilib --with-local-prefix=/home/ryan/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sys-root --disable-nls --enable-threads=posix --enable-symvers=gnu --enable-c99 --enable-long-long --enable-target-optspace target_alias=arm-unknown-linux-gnueabi --enable-languages=c++ --disable-shared --disable-libmudflap --disable-libssp
Thread model: posix
gcc version 4.7.0 20111109 (experimental) [trunk revision 181205] (GCC)

After the fix to PR36819, -I- has split_quote_chain calling free_path with a null path
Comment 1 Paolo Carlini 2011-11-09 14:58:33 UTC
Bother. Frankly I don't feel like spending much time on PR36819, we can as well revert it. Or please test the attached. Joseph, does it make sense to you?
Comment 2 Paolo Carlini 2011-11-09 14:59:41 UTC
Created attachment 25770 [details]
Untested
Comment 3 Ryan Mansfield 2011-11-09 15:10:59 UTC
Yes, the patch fixes the crash. Thanks.
Comment 4 paolo@gcc.gnu.org 2011-11-09 17:26:42 UTC
Author: paolo
Date: Wed Nov  9 17:26:37 2011
New Revision: 181216

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=181216
Log:
2011-11-09  Paolo Carlini  <paolo.carlini@oracle.com>

	PR preprocessor/51061
	* incpath.c (merge_include_chains): Make sure to not pass null
	pointers to free_path.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/incpath.c
Comment 5 Paolo Carlini 2011-11-09 17:28:23 UTC
Fixed, thanks for testing!