[Bug 1612] New: Recent change to rtems/cpukit/libcsupport/src/freenode.c breaks socket use

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Fri Jul 9 19:19:07 UTC 2010


https://www.rtems.org/bugzilla/show_bug.cgi?id=1612

           Summary: Recent change to
                    rtems/cpukit/libcsupport/src/freenode.c breaks socket
                    use
           Product: RTEMS
           Version: HEAD
          Platform: All
        OS/Version: RTEMS
            Status: NEW
          Severity: blocker
          Priority: P3
         Component: cpukit
        AssignedTo: joel.sherrill at oarcorp.com
        ReportedBy: manuel.koeppen at esd.eu


Using the CVS HEAD, network doesn't work at all ATM.
At the first ifconfig (within rtems_bsdnet_initialize_network) a socket is
opened, then closed.

Rtems uses unchecked NULL-Pointers whenever a socket is closed.
It's because socket fds are not created by open and they don't have a
filesystem.
In the rtems_libio_tt,the pathinfo member (rtems_filesystem_location_info_t) is
just zero'd memory created by rtems_libio_allocate. So the ops pointer in that
struct as well. Then a function pointer somewhere at the beginning of the
memory is pulled and branched to, causing an exception in my case.

Possible solutions:
1) Undo the last change on rtems/cpukit/libcsupport/src/freenode.c
It worked but I did only minor testing.

2) Add some code to rtems/cpukit/libcsupport/src/libio_sockets.c that will
create a dummy fileops table filled with default functions pointers.

3) In rtems/cpukit/libcsupport/src/close.c add some code to find out it's a
socket and don't call rtems_filesystem_freenode(&iop->pathinfo) in that case.

What worries me is that I have a PPC and filled the 256 byte reserved memory at
address 0 with a pattern. After starting rtems, some bytes are overwritten. So
somebody is using a null-pointer. I can't say whether this has something to do
with the changeset that remove lots of null-pointer checks...

-- 
Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the bugs mailing list