public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] RAMFS new problem, access to address 0.
@ 2001-11-09  1:58 felixwong
  2001-11-15  4:18 ` [ECOS] " felixwong
  0 siblings, 1 reply; 2+ messages in thread
From: felixwong @ 2001-11-09  1:58 UTC (permalink / raw)
  To: Ecos-Discuss

The case can be duplicated easily from my ARM7 EB40 board & PC synthetic target.

In running the RAMFS testing program "fileio1" built from the RAMFS test.
(I use block device with external label name).


In "main" of "fileio1.c" for RAMFS testing:
    err = chdir( "/" );
This line will cause error which will write to a NULL pointer at 0.

Since EB40 not writable at 0 by default. No fault will be generated.
But in PC synthetic target, a segmentation fault will occur.

In file.cxx:
ret = cdir_mtab_entry->fs->chdir( cdir_mtab_entry, cdir_dir, NULL, NULL );

Since cyg_dir cdir_dir = CYG_DIR_NULL; as defined in misc.cxx initially.
cdir_dir == 0 as passed to the chdir routine.

Follow the above line, we arrive at "ramfs_chdir" routine.
In which has a line :
	dec_refcnt( node );
where node is 0.  (take the parameter of cdir_dir).

node->refcnt--;

This line cause the protection fault in subroutine "dec_refcnt".
cdir_dir should be initiallized after a file system is mounted with "/" included.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [ECOS] RE: RAMFS new problem, access to address 0.
  2001-11-09  1:58 [ECOS] RAMFS new problem, access to address 0 felixwong
@ 2001-11-15  4:18 ` felixwong
  0 siblings, 0 replies; 2+ messages in thread
From: felixwong @ 2001-11-15  4:18 UTC (permalink / raw)
  To: Ecos-Discuss

Anyone ever tried to use the RAM file system and meet the same problem?
Something need to be fixed.  What do you think, the author to RAMFS?


-----Original Message-----
From: felixwong@i-technologies.cc [mailto:felixwong@i-technologies.cc]
Sent: Friday, November 16, 2001 11:39 AM
To: Ecos-Discuss
Subject: RAMFS new problem, access to address 0.


The case can be duplicated easily from my ARM7 EB40 board & PC synthetic target.

In running the RAMFS testing program "fileio1" built from the RAMFS test.
(I use block device with external label name).


In "main" of "fileio1.c" for RAMFS testing:
    err = chdir( "/" );
This line will cause error which will write to a NULL pointer at 0.

Since EB40 not writable at 0 by default. No fault will be generated.
But in PC synthetic target, a segmentation fault will occur.

In file.cxx:
ret = cdir_mtab_entry->fs->chdir( cdir_mtab_entry, cdir_dir, NULL, NULL );

Since cyg_dir cdir_dir = CYG_DIR_NULL; as defined in misc.cxx initially.
cdir_dir == 0 as passed to the chdir routine.

Follow the above line, we arrive at "ramfs_chdir" routine.
In which has a line :
	dec_refcnt( node );
where node is 0.  (take the parameter of cdir_dir).

node->refcnt--;

This line cause the protection fault in subroutine "dec_refcnt".
cdir_dir should be initiallized after a file system is mounted with "/" included.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-11-26  3:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-09  1:58 [ECOS] RAMFS new problem, access to address 0 felixwong
2001-11-15  4:18 ` [ECOS] " felixwong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).