This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos 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: Problems with init_all_network_interfaces


Andrew Lunn wrote:

[ ... ]


vaddr=0x0000000c


I guess this is the address its trying to access. This looks like its
trying to dereference a pointer to a structure and the pointer is
NULL.

You say its in ioctl. Hum...

io.cxx:

__externC int ioctl( int fd, CYG_ADDRWORD com, CYG_ADDRWORD data )
{
FILEIO_ENTRY();
int ret;
cyg_file *fp;
fp = cyg_fp_get( fd );
if( fp == NULL )
FILEIO_RETURN(EBADF);
LOCK_FILE( fp );
ret = fp->f_ops->fo_ioctl( fp, com, data );



fileio.h:


struct CYG_FILEOPS_TAG
{
    cyg_fileop_read     *fo_read;
    cyg_fileop_write    *fo_write;
    cyg_fileop_lseek    *fo_lseek;
    cyg_fileop_ioctl    *fo_ioctl;

so fo_ioctl will be at offset 0x0c in f_ops.

So you need to work out why this fd does not have an ioctl handler. I
would put some diag_printf's into init_all_network_interfaces() and
work out which ioctl is failing. You can then work out how the fd was
created and what its supposed to be. Then work out why it does not
have an ioctl handler.

I've managed to figure out what is going wrong here -- I have several configurations of eCos I'm working on, and I specified the wrong path, so the wrong 'extras.o' (without the FreeBSD stack) got linked in. Due to the way this is done with Equator's tools, it did link with the correct libtarget, making this error difficult to detect.

The crash was then caused by the function 'socket' in
io/fileio/current/src/socket.cxx, which returns an invalid cyg_file
instead of an error when no networking stack exists (nstab is empty).
--
--------------------------------------------------------------------
|     Eric Doenges              |     DynaPel Laboratories GmbH    |
|     Tel: +49 89 962428 23     |     Fraunhoferstrasse 9/2        |
|     Fax: +49 89 962428 90     |     D - 85737 Ismaning, Germany  |
--------------------------------------------------------------------


-- Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos and search the list archive: http://sources.redhat.com/ml/ecos-discuss


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