c/10460: optimization switch causes read( ) gcc stdlib function to fail.

md@realmwireless.com md@realmwireless.com
Wed Apr 23 10:56:00 GMT 2003


>Number:         10460
>Category:       c
>Synopsis:       optimization switch causes read( ) gcc stdlib function to fail.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 23 10:56:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     mark
>Release:        unknown-1.0
>Organization:
>Environment:
Kernel 2.2.19, Glibc 2.1.3.50, gcc 2.95.3.	
>Description:
Compiling with -O2 <-> -O0 causes various compilations of same program
to succeed or fail using SOCK_RAW on socket bound to "eth0".

The specific call that fails is read( ) using that socket. Poll also fails.

This would indicate that the originating socket( ) function call is not being properly registered 
in the kernel.

So changing the compiler optimization allows the program to execute
the mentioned function calls completely.

I am going to upgrade my GCC to try a new version to see if that fixes
anything.
>How-To-Repeat:
Create project with a socket( ) with AF_PACKET, SOCK_RAW under linux kernel 2.2.19+.
with protocol of 0x0003

Retrieve the "eth0" interface and bind to socket.

Have another machine ping this machine.

Repeatedly try different compilations to see if he read( ) function will detect broadcast traffice 
on eth0.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-prs mailing list