route(8) core dump, possible gcc(1) related

Sean Chittenden sean at chittenden.org
Sun Dec 16 22:49:27 PST 2007


>> 1033           q = strchr(s,'/');
>> 1034           if (q && which == RTA_DST) {
>> 1035                   *q = '\0';
>> 1036                   if ((val = inet_network(s)) != INADDR_NONE) {
>> 1037                           inet_makenetandmask(
>> 1038                                   val, &su->sin, strtoul(q+1,
>> 0, 0)); 1039                           return (0);
>> 1040                   }
>> 1041                   *q = '/';
>> 1042           }
>>
>> Any comments?
>>
> Preliminary results show that inet_network from libc is somehow
> thrashing $ebx even if it is not supposed to. -O0 disables value
> caching in register and always allocates stack slot for the 'q'
> pointer, so the problem is not visible.


Does setting q to volatile suffice as a workaround for the problem?  I  
was talking to someone last week that said they have taken to using  
volatile as a work around for GCC aligning instructions inside of  
conditionals improperly.  -sc

--
Sean Chittenden
sean at chittenden.org
http://sean.chittenden.org/



More information about the freebsd-current mailing list