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]

Serial (__DEVTAB__ ?) problem on i386


Hi

I updated my eCos install, with the dayly CVS tar package from 
ftp.skynet.ie/cvs/, and started to get problems with diag_printf, printf, and 
everything that had to do with serialports.
I wrote a "Hello World" program to test that the problem wouldn't be in my 
code.

#include <stdio.h>
#include <cyg/infra/diag.h>
int main(void) {

    diag_printf("diag Hello world\n");
    printf("Hello world\n");
    return 0;
}

This program crached when it came to printf, but not diag_printf.

Then I tried opening a serial port and debugged cyg_io_lookup. This is values 
of the local variables when I came to line 122 in iosys.c.

 
 116 cyg_io_lookup(const char *name, cyg_io_handle_t *handle)
-117 {
 118     cyg_devtab_entry_t *t, *st;
 119     Cyg_ErrNo res;
 120     const char *name_ptr;
-121     for (t = &__DEVTAB__[0]; t != &__DEVTAB_END__; t++) {
-122------>>> if (cyg_io_compare(name, t->name, &name_ptr)) { <<<-------------
 123             // FUTURE: Check 'avail'/'online' here
-124             if (t->dep_name) {
-125                 res = cyg_io_lookup(t->dep_name, (cyg_io_handle_t *)&st);
-126                 if (res != ENOERR) {
-127                     return res;

Local Variables
 name                    (char *) 0x10ff6a "/dev/ser1"
+handle                  (cyg_io_handle_t *) 0x114224
-t                       (cyg_devtab_entry_t *) 0x110600
 |-name    ---------->>> (char *) 0x7665642f '˙' <repeats 200 times>...
 |-dep_name              (char *) 0x10ff8b "/dev/haldiag"
 ...


The program made a segmentation fault after I pressed 'next'. I think the 
variable t->name is a pointer to a forbidden memory area.

I don't know when the problems started, but the last version that I'm using 
that is still working has the latest changes made 2001-08-14.

When I tested, I installed the host tools and rebuilt RedBoot. The tested 
vesion is from 2001-10-04 and I'm using i386-elf-gcc version 2.95.2. 


   Kåre


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