This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Segfault Question



On 2018-12-17 11:12 a.m., nick wrote:
> 
> 
> On 2018-12-17 10:23 a.m., Nathan Sidwell wrote:
>> On 12/17/18 10:11 AM, Jonathan Wakely wrote:
>>
>>> The second snippet is his suggested fix for the caller of tsubst_expr
>>> in expand_concept. That would have been a lot more helpful as a patch:
>>>
>>> --- a/gcc/cp/constraint.cc
>>> +++ b/gcc/cp/constraint.cc
>>> @@ -563,7 +563,7 @@ expand_concept (tree decl, tree args)
>>>     ++processing_template_decl;
>>>     tree result = tsubst_expr (def, args, tf_none, NULL_TREE, true);
>>>     --processing_template_decl;
>>> -  if (result == error_mark_node)
>>> +  if (result == error_mark_node || t == NULL_TREE)
>>>       return error_mark_node;
>>>
>>>     /* And lastly, normalize it, check for implications, and save
>>>
>>> The point is that tsubst_expr can return NULL_TREE, we should check for it.
>>
>> Are there cases that tsubst_expr returns NULL when the incoming T is non-null?  I.e. I'm hypothesizing DEF is NULL already.
>>
>> nathan
>>
> 
> Sorry about my miscommunication before it. 
> As for Nathan's comment you could be right. But the bug reports
> two concept calls in gdb where only one crashes according to it.
> However I managed to track down the differences to  this occurring with the seg fault caller:
> #45 0x00000000008f3dfa in (anonymous namespace)::satisfy_associated_constraints (args=0x7ffff70ca4a0, ci=0x7ffff70ca3c0) at ../../gcc/gcc/cp/cp-tree.h:1446
> versus without:
> #30 0x00000000008f55f2 in (anonymous namespace)::tsubst_compound_requirement (in_decl=0x0, complain=0, args=0x7ffff70bfde8, t=0x7ffff70bf528) at ../../gcc/gcc/tree.h:3658
> 
> Don't know why this would cause issues:
> #define OMP_CLAUSE_PRIVATE_DEBUG(NODE) \
> (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_PRIVATE)->base.public_flag)
> 
> in gcc/tree.h on line 1448. Any ideas?
> 
> Nick
> 

I tried working on it more today and it seems that this make be wrong it call.c:
for (ix = 1; args->iterate (ix, &arg); ++ix)
tempvec->quick_push (arg);

for add_candiates. I don't know why we aren't setting it like:

tempvec->quick_push((*arg[ix]));

If you would prefer I send a patch to show the proposed fix just let me known,

Nick


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]