On 2009-03-06 16:04, Jose-Marcio Martins da Cruz wrote:
> Török Edwin wrote:
>
>   
>> What gcc version did you use? Did you set -mcpu flag?
>>     
>
> SunStudio 12
>
> 160 - clamav/clamav-0.95rc1 > cc -V
> cc: Sun C 5.9 SunOS_sparc 2007/05/03
>
> with standard flags.
>
> I don't have gcc installed at this computer. Well, it's there but I 
> don't use it.
>
>   
>> Looks like the Linux/gcc-4.3.3 on sparc beats Solaris10 on a sparc
>> T2000, at least for DB load times.
>> It wouldn't surprise me to find out that gcc-4.3.3 is responsible for
>> the speedup, gcc's optimizers improved a lot in the past years.
>>
>> You might want to try CFLAGS="-m64 -O2 -g -mcpu=niagara", and
>> CFLAGS="-mcpu=niagara -O2 -g", and see if any of them is faster
>> than the defaults.
>>     
>
> With  CFLAGS="-m64 -xO2" reload time falls down to 9 secs.
>
> ----------- SCAN SUMMARY -----------
> Known viruses: 514236
> Engine version: 0.95rc1
> Scanned directories: 0
> Scanned files: 0
> Infected files: 0
> Data scanned: 0.00 MB
> Time: 8.944 sec (0 m 8 s)
>
>
> In a side history... I tried to increase optimization, setting -xO3 or 
> -xO4, but configure stops with the message :
>
> **************************
> checking for gcc bug PR26763-2... ok, bug not present
> checking for valid code generation of CLI_ISCONTAINED... configure: 
> error: your compiler has a bug that causes clamav bug no. 670, use a 
> different compiler, see http://bugs.clamav.net/bugzilla/show_bug.cgi?id=670
> **************************
>
> This a test against a gcc bug. But I'm using cc, and configure knows 
> about it, so maybe it shouldn't look for a gcc bug.
>   

No, this is a test for "valid code generation of CLI_ISCONTAINED", the
gcc bug tests passed.

[And I think it should look for gcc bugs even if the compiler is not
gcc, if the testcase is miscompiled there is something
wrong with the compiler]

> configure:3161: checking for gcc
> configure:3191: result: no
> configure:3258: checking for cc
> configure:3279: found /opt/SUNWspro/bin/cc
> configure:3302: result: cc
> configure:3426: checking for C compiler version
>
> Looking at config.log, the reason configure stoped is a core dump.
>   


That means that your Sun Studio compiler at -xO3 generates buggy code,
the same way that
gcc 4.0.x, and 4.1.0 do.

This is a serious compiler error, it miscompiles our bounds checking
code, resulting in a binary that
can be exploited (buffer overflow), even if the original source code is
not vulnerable.

Best regards,
--Edwin
_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://www.clamav.net/support/ml

Reply via email to