Discussion:
Bug in getcwd()
Rohner Thomas
2014-10-01 14:26:13 UTC
Permalink
Hello,



maybe I found a bug in getcwd().



We're using RTEMS 4.0 with Gaisler-Aeroflex....

With our libraries I get an erroneous string when directory-depth is about 4 folders from root!

When I use this string to read directory it crahes!





Is there a limitation of string-length?

I get the same results for



Char buffer[200];

getcwd(buffer,sizeof(buffer));



or



char* ret = getcwd(NULL,0);









Freundliche Grüsse / Kind regards,





Thomas Rohner

Entwicklungsingenieur Software



nanoTRONIC GmbH

Werkstrasse 27, CH - 3250 Lyss





T: +41 32 384 69 30, F: +41 32 384 69 31

www.nanotronic.ch <http://www.nanotronic.ch/> | thomas.rohner-3eeWUiZ0u1f/***@public.gmane.org <mailto:thomas.rohner-3eeWUiZ0u1f/***@public.gmane.org>
Joel Sherrill
2014-10-01 18:10:58 UTC
Permalink
Post by Rohner Thomas
Hello,
maybe I found a bug in getcwd().
We’re using RTEMS 4.0 with Gaisler-Aeroflex….
With our libraries I get an erroneous string when directory-depth is
about 4 folders from root!
When I use this string to read directory it crahes!
Is there a limitation of string-length?
I get the same results for
Char buffer[200];
getcwd(buffer,sizeof(buffer));
or
char* ret = getcwd(NULL,0);
Is this with the IMFS? What BSP?

Can you put together a full test example so we can
see what is really happening?

There is a POSIX constant for PATH_MAX as I recall but
it is quite large.
Post by Rohner Thomas
Freundliche Grüsse / Kind regards,
image001
*Thomas Rohner***
Entwicklungsingenieur Software
nanoTRONIC GmbH
Werkstrasse 27, CH - 3250 Lyss
T: +41 32 384 69 30, F: +41 32 384 69 31
www.nanotronic.ch <http://www.nanotronic.ch/> |
--
Joel Sherrill, Ph.D. Director of Research & Development
joel.sherrill-***@public.gmane.org On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
Rohner Thomas
2014-10-02 10:11:15 UTC
Permalink
Hello,
We have a system with the following configuration.
·Chip GR712RC
·Board: GR712 Development Board
·Compiler RTEMS RCC (according to your websites version)
·RTOS: RTEMS
·Library: GR-RTEMS-DRIVER Version 1.2.1.0
I'm using FAT as filesystem. We have same phenomenon for FAT12 or FAT16!





Freundliche Grüsse / Kind regards,





Thomas Rohner

Entwicklungsingenieur Software



nanoTRONIC GmbH

Werkstrasse 27, CH - 3250 Lyss





T: +41 32 384 69 30, F: +41 32 384 69 31

www.nanotronic.ch <http://www.nanotronic.ch/> | thomas.rohner-3eeWUiZ0u1f/***@public.gmane.org













From: Joel Sherrill [mailto:joel.sherrill-lGxtRh3/***@public.gmane.org]
Sent: Mittwoch, 1. Oktober 2014 20:11
To: Rohner Thomas; rtems-users-***@public.gmane.org
Subject: Re: Bug in getcwd()





On 10/1/2014 9:26 AM, Rohner Thomas wrote:

Hello,



maybe I found a bug in getcwd().



We're using RTEMS 4.0 with Gaisler-Aeroflex....

With our libraries I get an erroneous string when directory-depth is about 4 folders from root!

When I use this string to read directory it crahes!





Is there a limitation of string-length?

I get the same results for



Char buffer[200];

getcwd(buffer,sizeof(buffer));



or



char* ret = getcwd(NULL,0);





Is this with the IMFS? What BSP?

Can you put together a full test example so we can
see what is really happening?

There is a POSIX constant for PATH_MAX as I recall but
it is quite large.





Freundliche Grüsse / Kind regards,





Thomas Rohner

Entwicklungsingenieur Software



nanoTRONIC GmbH

Werkstrasse 27, CH - 3250 Lyss





T: +41 32 384 69 30, F: +41 32 384 69 31

www.nanotronic.ch <http://www.nanotronic.ch/> | thomas.rohner-3eeWUiZ0u1f/***@public.gmane.org
--
Joel Sherrill, Ph.D. Director of Research & Development
joel.sherrill-***@public.gmane.org On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
Hoefle Marco
2014-10-14 16:09:16 UTC
Permalink
Hello,

getcwd() seems also buggy on an external FAT12 image. On 4.11 there is no crash but this behavior:



RAM disks registered

disk addr 1: 0x400c6fa0, size: 1000000

disk addr 2: 0x40074060, size: 262144

format /dev/rda done.

mount return: 0

mount return: 0

Starting 1 threads...

started thread 0: id: 0x0b010002, prio: 10

=========================

starting shell

=========================



RTEMS SHELL (Ver.1.0-FRC):/dev/console. Oct 14 2014. 'help' to list commands.

[/] #

[/] #

[/] #

[/] # pwd

/

[/] # ls

dev mram sdram

[/] # cdhello dude, this is tick nr: 0



[/] # cd mram

hello dude, this is tick nr: 1



[/mram] # cd template

[/mram/template] # pwd

/mram/template

[/mram/template] # ls

logs param

[/mram/template] #

[/mram/template] # cd logs

hello dude, this is tick nr: 0

RAM disks registered

disk addr 1: 0x400c6fa0, size: 1000000

disk addr 2: 0x40074060, size: 262144

format /dev/rda done.

mount return: 0

mount return: 0

Starting 1 threads...

started thread 0: id: 0x0b010002, prio: 10

=========================

starting shell

=========================



RTEMS SHELL (Ver.1.0-FRC):/dev/console. Oct 14 2014. 'help' to list commands.

[/] #

[/] #

[/] #

[/] # pwd

/

[/] # ls

dev mram sdram

[/] # cd mram

[/mram] # cd template

[/mram/template] # pwd

/mram/template

[/mram/template] # ls

logs param

[/mram/template] #

[/mram/template] # cd logs

[?] # pwd

ᅵ





I'll be happy to forward the test case to an rtems developer.

This behavior occurs only when mounting an external fat12 image generated this way:



NAME = libfatfsimg



BUILDDIR = build





all: $(NAME).a



.PHONY: $(NAME).a



$(NAME).o:

@echo [GEN FATFS] $@

@dd if=/dev/zero of=$(NAME) bs=256 count=1024 > /dev/null

/sbin/mkfs.vfat -F 12 -S 512 -s 1 -r 512 -f 1 -v $(NAME)

mcopy -b/ -i $(NAME) content/* ::/

@xxd -i $(NAME) > $(NAME).c

@echo [CC] $@

@$(CC) -c $(CFLAGS) -o $@ $(NAME).c





$(NAME).a: $(NAME).o

@$(AR) rcs $@ $^



The object file is then linked against the rtems test application.

Marco







________________________________

From: users [mailto:users-bounces-***@public.gmane.org] On Behalf Of Rohner Thomas
Sent: Donnerstag, 2. Oktober 2014 12:11
To: Joel Sherrill; rtems-users-***@public.gmane.org
Subject: RE: Bug in getcwd()



Hello,
We have a system with the following configuration.
·Chip GR712RC
·Board: GR712 Development Board
·Compiler RTEMS RCC (according to your websites version)
·RTOS: RTEMS
·Library: GR-RTEMS-DRIVER Version 1.2.1.0
I'm using FAT as filesystem. We have same phenomenon for FAT12 or FAT16!







Freundliche Grüsse / Kind regards,





Thomas Rohner

Entwicklungsingenieur Software



nanoTRONIC GmbH

Werkstrasse 27, CH - 3250 Lyss





T: +41 32 384 69 30, F: +41 32 384 69 31

www.nanotronic.ch <http://www.nanotronic.ch/> | thomas.rohner-3eeWUiZ0u1f/***@public.gmane.org













From: Joel Sherrill [mailto:joel.sherrill-lGxtRh3/***@public.gmane.org]
Sent: Mittwoch, 1. Oktober 2014 20:11
To: Rohner Thomas; rtems-users-***@public.gmane.org
Subject: Re: Bug in getcwd()





On 10/1/2014 9:26 AM, Rohner Thomas wrote:

Hello,



maybe I found a bug in getcwd().



We're using RTEMS 4.0 with Gaisler-Aeroflex....

With our libraries I get an erroneous string when directory-depth is about 4 folders from root!

When I use this string to read directory it crahes!





Is there a limitation of string-length?

I get the same results for



Char buffer[200];

getcwd(buffer,sizeof(buffer));



or



char* ret = getcwd(NULL,0);





Is this with the IMFS? What BSP?

Can you put together a full test example so we can
see what is really happening?

There is a POSIX constant for PATH_MAX as I recall but
it is quite large.





Freundliche Grüsse / Kind regards,





Thomas Rohner

Entwicklungsingenieur Software



nanoTRONIC GmbH

Werkstrasse 27, CH - 3250 Lyss





T: +41 32 384 69 30, F: +41 32 384 69 31

www.nanotronic.ch <http://www.nanotronic.ch/> | thomas.rohner-3eeWUiZ0u1f/***@public.gmane.org
--
Joel Sherrill, Ph.D. Director of Research & Development
joel.sherrill-***@public.gmane.org On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
Chris Johns
2014-10-15 00:16:59 UTC
Permalink
Post by Rohner Thomas
Hello,
getcwd() seems also buggy on an external FAT12 image. On 4.11 there is
Why FAT12 ?

Does FAT32 work ?
Post by Rohner Thomas
RAM disks registered
disk addr 1: 0x400c6fa0, size: 1000000
disk addr 2: 0x40074060, size: 262144
format /dev/rda done.
mount return: 0
mount return: 0
Starting 1 threads...
started thread 0: id: 0x0b010002, prio: 10
=========================
starting shell
=========================
RTEMS SHELL (Ver.1.0-FRC):/dev/console. Oct 14 2014. 'help' to list commands.
[/] #
[/] #
[/] #
[/] # pwd
/
[/] # ls
dev mram sdram
[/] # cdhello dude, this is tick nr: 0
[/] # cd mram
hello dude, this is tick nr: 1
[/mram] # cd template
[/mram/template] # pwd
/mram/template
[/mram/template] # ls
logs param
[/mram/template] #
[/mram/template] # cd logs
hello dude, this is tick nr: 0
RAM disks registered
disk addr 1: 0x400c6fa0, size: 1000000
disk addr 2: 0x40074060, size: 262144
format /dev/rda done.
mount return: 0
mount return: 0
Starting 1 threads...
started thread 0: id: 0x0b010002, prio: 10
=========================
starting shell
=========================
RTEMS SHELL (Ver.1.0-FRC):/dev/console. Oct 14 2014. 'help' to list commands.
[/] #
[/] #
[/] #
[/] # pwd
/
[/] # ls
dev mram sdram
[/] # cd mram
[/mram] # cd template
[/mram/template] # pwd
/mram/template
[/mram/template] # ls
logs param
[/mram/template] #
[/mram/template] # cd logs
[?] # pwd
�
I’ll be happy to forward the test case to an rtems developer.
Please create a bug report for this and attach anything you think is
important. The easier it is to reproduce the more chance someone will
look into it.

Thanks
Chris
Post by Rohner Thomas
NAME = libfatfsimg
BUILDDIR = build
all: $(NAME).a
.PHONY: $(NAME).a
@echo [GEN FATFS] $@
@dd if=/dev/zero of=$(NAME) bs=256 count=1024 > /dev/null
/sbin/mkfs.vfat -F 12 -S 512 -s 1 -r 512 -f 1 -v $(NAME)
mcopy -b/ -i $(NAME) content/* ::/
@xxd -i $(NAME) > $(NAME).c
@echo [CC] $@
@$(CC) -c $(CFLAGS) -o $@ $(NAME).c
$(NAME).a: $(NAME).o
@$(AR) rcs $@ $^
The object file is then linked against the rtems test application.
Marco
------------------------------------------------------------------------
*Sent:* Donnerstag, 2. Oktober 2014 12:11
*Subject:* RE: Bug in getcwd()
Hello,
We have a system with the following configuration.
·Chip GR712RC
·Board: GR712 Development Board
·Compiler RTEMS RCC (according to your websites version)
·RTOS: RTEMS
·Library: GR-RTEMS-DRIVER Version 1.2.1.0
I’m using FAT as filesystem. We have same phenomenon for FAT12 or FAT16!
Freundliche Grüsse / Kind regards,
image001
*Thomas Rohner*
Entwicklungsingenieur Software
nanoTRONIC GmbH
Werkstrasse 27, CH - 3250 Lyss
T: +41 32 384 69 30, F: +41 32 384 69 31
www.nanotronic.ch <http://www.nanotronic.ch/> |
*Sent:* Mittwoch, 1. Oktober 2014 20:11
*Subject:* Re: Bug in getcwd()
Hello,
maybe I found a bug in getcwd().
We’re using RTEMS 4.0 with Gaisler-Aeroflex….
With our libraries I get an erroneous string when directory-depth is
about 4 folders from root!
When I use this string to read directory it crahes!
Is there a limitation of string-length?
I get the same results for
Char buffer[200];
getcwd(buffer,sizeof(buffer));
or
char* ret = getcwd(NULL,0);
Is this with the IMFS? What BSP?
Can you put together a full test example so we can
see what is really happening?
There is a POSIX constant for PATH_MAX as I recall but
it is quite large.
Freundliche Grüsse / Kind regards,
image001
*Thomas Rohner*
Entwicklungsingenieur Software
nanoTRONIC GmbH
Werkstrasse 27, CH - 3250 Lyss
T: +41 32 384 69 30, F: +41 32 384 69 31
www.nanotronic.ch <http://www.nanotronic.ch/> |
--
Joel Sherrill, Ph.D. Director of Research & Development
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
_______________________________________________
users mailing list
http://lists.rtems.org/mailman/listinfo/users
Joel Sherrill
2014-10-15 00:21:08 UTC
Permalink
This looks like the same basic application setup and, if so, the stack size for the shell task was minimum. Almost certainly Yoo small.
Post by Chris Johns
Post by Rohner Thomas
Hello,
getcwd() seems also buggy on an external FAT12 image. On 4.11 there
is
Why FAT12 ?
Does FAT32 work ?
Post by Rohner Thomas
RAM disks registered
disk addr 1: 0x400c6fa0, size: 1000000
disk addr 2: 0x40074060, size: 262144
format /dev/rda done.
mount return: 0
mount return: 0
Starting 1 threads...
started thread 0: id: 0x0b010002, prio: 10
=========================
starting shell
=========================
RTEMS SHELL (Ver.1.0-FRC):/dev/console. Oct 14 2014. 'help' to list commands.
[/] #
[/] #
[/] #
[/] # pwd
/
[/] # ls
dev mram sdram
[/] # cdhello dude, this is tick nr: 0
[/] # cd mram
hello dude, this is tick nr: 1
[/mram] # cd template
[/mram/template] # pwd
/mram/template
[/mram/template] # ls
logs param
[/mram/template] #
[/mram/template] # cd logs
hello dude, this is tick nr: 0
RAM disks registered
disk addr 1: 0x400c6fa0, size: 1000000
disk addr 2: 0x40074060, size: 262144
format /dev/rda done.
mount return: 0
mount return: 0
Starting 1 threads...
started thread 0: id: 0x0b010002, prio: 10
=========================
starting shell
=========================
RTEMS SHELL (Ver.1.0-FRC):/dev/console. Oct 14 2014. 'help' to list commands.
[/] #
[/] #
[/] #
[/] # pwd
/
[/] # ls
dev mram sdram
[/] # cd mram
[/mram] # cd template
[/mram/template] # pwd
/mram/template
[/mram/template] # ls
logs param
[/mram/template] #
[/mram/template] # cd logs
[?] # pwd
�
I’ll be happy to forward the test case to an rtems developer.
Please create a bug report for this and attach anything you think is
important. The easier it is to reproduce the more chance someone will
look into it.
Thanks
Chris
Post by Rohner Thomas
NAME = libfatfsimg
BUILDDIR = build
all: $(NAME).a
.PHONY: $(NAME).a
@echo [GEN FATFS] $@
@dd if=/dev/zero of=$(NAME) bs=256 count=1024 > /dev/null
/sbin/mkfs.vfat -F 12 -S 512 -s 1 -r 512 -f 1 -v $(NAME)
mcopy -b/ -i $(NAME) content/* ::/
@xxd -i $(NAME) > $(NAME).c
@echo [CC] $@
@$(CC) -c $(CFLAGS) -o $@ $(NAME).c
$(NAME).a: $(NAME).o
@$(AR) rcs $@ $^
The object file is then linked against the rtems test application.
Marco
------------------------------------------------------------------------
Thomas
Post by Rohner Thomas
*Sent:* Donnerstag, 2. Oktober 2014 12:11
*Subject:* RE: Bug in getcwd()
Hello,
We have a system with the following configuration.
·Chip GR712RC
·Board: GR712 Development Board
·Compiler RTEMS RCC (according to your websites version)
·RTOS: RTEMS
·Library: GR-RTEMS-DRIVER Version 1.2.1.0
I’m using FAT as filesystem. We have same phenomenon for FAT12 or
FAT16!
Post by Rohner Thomas
Freundliche Grüsse / Kind regards,
image001
*Thomas Rohner*
Entwicklungsingenieur Software
nanoTRONIC GmbH
Werkstrasse 27, CH - 3250 Lyss
T: +41 32 384 69 30, F: +41 32 384 69 31
www.nanotronic.ch <http://www.nanotronic.ch/> |
*Sent:* Mittwoch, 1. Oktober 2014 20:11
*Subject:* Re: Bug in getcwd()
Hello,
maybe I found a bug in getcwd().
We’re using RTEMS 4.0 with Gaisler-Aeroflex….
With our libraries I get an erroneous string when directory-depth
is
Post by Rohner Thomas
about 4 folders from root!
When I use this string to read directory it crahes!
Is there a limitation of string-length?
I get the same results for
Char buffer[200];
getcwd(buffer,sizeof(buffer));
or
char* ret = getcwd(NULL,0);
Is this with the IMFS? What BSP?
Can you put together a full test example so we can
see what is really happening?
There is a POSIX constant for PATH_MAX as I recall but
it is quite large.
Freundliche Grüsse / Kind regards,
image001
*Thomas Rohner*
Entwicklungsingenieur Software
nanoTRONIC GmbH
Werkstrasse 27, CH - 3250 Lyss
T: +41 32 384 69 30, F: +41 32 384 69 31
www.nanotronic.ch <http://www.nanotronic.ch/> |
--
Joel Sherrill, Ph.D. Director of Research & Development
On-Line Applications Research
Post by Rohner Thomas
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
_______________________________________________
users mailing list
http://lists.rtems.org/mailman/listinfo/users
Hoefle Marco
2014-10-17 09:10:52 UTC
Permalink
I filed bug 2190:
https://www.rtems.org/bugzilla/show_bug.cgi?id=2190

a test case is attached. Due to the automatic fatfs image build procedure the Makfile process is a bit different to standard Makefile approaches.
If there are questions (or improvements to achieve the same thing) please contact me directly per email.



-----Original Message-----
From: Joel Sherrill [mailto:joel.sherrill-lGxtRh3/***@public.gmane.org]
Sent: Mittwoch, 15. Oktober 2014 02:21
To: Chris Johns; Hoefle Marco; Rohner Thomas; rtems-users-***@public.gmane.org
Subject: Re: Bug in getcwd() also in 4.11 kernel

This looks like the same basic application setup and, if so, the stack size for the shell task was minimum. Almost certainly Yoo small.
Post by Chris Johns
Post by Rohner Thomas
Hello,
getcwd() seems also buggy on an external FAT12 image. On 4.11 there
is
Why FAT12 ?
Does FAT32 work ?
Post by Rohner Thomas
RAM disks registered
disk addr 1: 0x400c6fa0, size: 1000000
disk addr 2: 0x40074060, size: 262144
format /dev/rda done.
mount return: 0
mount return: 0
Starting 1 threads...
started thread 0: id: 0x0b010002, prio: 10
=========================
starting shell
=========================
RTEMS SHELL (Ver.1.0-FRC):/dev/console. Oct 14 2014. 'help' to list commands.
[/] #
[/] #
[/] #
[/] # pwd
/
[/] # ls
dev mram sdram
[/] # cdhello dude, this is tick nr: 0
[/] # cd mram
hello dude, this is tick nr: 1
[/mram] # cd template
[/mram/template] # pwd
/mram/template
[/mram/template] # ls
logs param
[/mram/template] #
[/mram/template] # cd logs
hello dude, this is tick nr: 0
RAM disks registered
disk addr 1: 0x400c6fa0, size: 1000000
disk addr 2: 0x40074060, size: 262144
format /dev/rda done.
mount return: 0
mount return: 0
Starting 1 threads...
started thread 0: id: 0x0b010002, prio: 10
=========================
starting shell
=========================
RTEMS SHELL (Ver.1.0-FRC):/dev/console. Oct 14 2014. 'help' to list commands.
[/] #
[/] #
[/] #
[/] # pwd
/
[/] # ls
dev mram sdram
[/] # cd mram
[/mram] # cd template
[/mram/template] # pwd
/mram/template
[/mram/template] # ls
logs param
[/mram/template] #
[/mram/template] # cd logs
[?] # pwd
�
I'll be happy to forward the test case to an rtems developer.
Please create a bug report for this and attach anything you think is
important. The easier it is to reproduce the more chance someone will
look into it.
Thanks
Chris
Post by Rohner Thomas
NAME = libfatfsimg
BUILDDIR = build
all: $(NAME).a
.PHONY: $(NAME).a
@echo [GEN FATFS] $@
@dd if=/dev/zero of=$(NAME) bs=256 count=1024 > /dev/null
/sbin/mkfs.vfat -F 12 -S 512 -s 1 -r 512 -f 1 -v $(NAME)
mcopy -b/ -i $(NAME) content/* ::/
@xxd -i $(NAME) > $(NAME).c
@echo [CC] $@
@$(CC) -c $(CFLAGS) -o $@ $(NAME).c
$(NAME).a: $(NAME).o
@$(AR) rcs $@ $^
The object file is then linked against the rtems test application.
Marco
------------------------------------------------------------------------
Thomas
Post by Rohner Thomas
*Sent:* Donnerstag, 2. Oktober 2014 12:11
*Subject:* RE: Bug in getcwd()
Hello,
We have a system with the following configuration.
·Chip GR712RC
·Board: GR712 Development Board
·Compiler RTEMS RCC (according to your websites version)
·RTOS: RTEMS
·Library: GR-RTEMS-DRIVER Version 1.2.1.0
I'm using FAT as filesystem. We have same phenomenon for FAT12 or
FAT16!
Post by Rohner Thomas
Freundliche Grüsse / Kind regards,
image001
*Thomas Rohner*
Entwicklungsingenieur Software
nanoTRONIC GmbH
Werkstrasse 27, CH - 3250 Lyss
T: +41 32 384 69 30, F: +41 32 384 69 31
www.nanotronic.ch <http://www.nanotronic.ch/> |
*Sent:* Mittwoch, 1. Oktober 2014 20:11
*Subject:* Re: Bug in getcwd()
Hello,
maybe I found a bug in getcwd().
We're using RTEMS 4.0 with Gaisler-Aeroflex....
With our libraries I get an erroneous string when directory-depth
is
Post by Rohner Thomas
about 4 folders from root!
When I use this string to read directory it crahes!
Is there a limitation of string-length?
I get the same results for
Char buffer[200];
getcwd(buffer,sizeof(buffer));
or
char* ret = getcwd(NULL,0);
Is this with the IMFS? What BSP?
Can you put together a full test example so we can
see what is really happening?
There is a POSIX constant for PATH_MAX as I recall but
it is quite large.
Freundliche Grüsse / Kind regards,
image001
*Thomas Rohner*
Entwicklungsingenieur Software
nanoTRONIC GmbH
Werkstrasse 27, CH - 3250 Lyss
T: +41 32 384 69 30, F: +41 32 384 69 31
www.nanotronic.ch <http://www.nanotronic.ch/> |
--
Joel Sherrill, Ph.D. Director of Research & Development
On-Line Applications Research
Post by Rohner Thomas
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
_______________________________________________
users mailing list
http://lists.rtems.org/mailman/listinfo/users
Rohner Thomas
2014-10-15 11:09:34 UTC
Permalink
During my tests with a filesystem < 12MB the FAT32 wasn't working.
Isn't it like this that the table for FAT32 is too large for only 12MB of memory.

Aer there other limitations?

Freundliche Grüsse / Kind regards,

 

Thomas Rohner
Entwicklungsingenieur Software

 

nanoTRONIC GmbH

Werkstrasse 27, CH - 3250 Lyss 

 
 
T: +41 32 384 69 30, F: +41 32 384 69 31
www.nanotronic.ch | thomas.rohner-3eeWUiZ0u1f/***@public.gmane.org






-----Original Message-----
From: Chris Johns [mailto:chrisj-***@public.gmane.org]
Sent: Mittwoch, 15. Oktober 2014 02:17
To: Hoefle Marco; Rohner Thomas; Joel Sherrill; rtems-users-***@public.gmane.org
Subject: Re: Bug in getcwd() also in 4.11 kernel
Post by Rohner Thomas
Hello,
getcwd() seems also buggy on an external FAT12 image. On 4.11 there
Why FAT12 ?

Does FAT32 work ?
Post by Rohner Thomas
RAM disks registered
disk addr 1: 0x400c6fa0, size: 1000000
disk addr 2: 0x40074060, size: 262144
format /dev/rda done.
mount return: 0
mount return: 0
Starting 1 threads...
started thread 0: id: 0x0b010002, prio: 10
=========================
starting shell
=========================
RTEMS SHELL (Ver.1.0-FRC):/dev/console. Oct 14 2014. 'help' to list commands.
[/] #
[/] #
[/] #
[/] # pwd
/
[/] # ls
dev mram sdram
[/] # cdhello dude, this is tick nr: 0
[/] # cd mram
hello dude, this is tick nr: 1
[/mram] # cd template
[/mram/template] # pwd
/mram/template
[/mram/template] # ls
logs param
[/mram/template] #
[/mram/template] # cd logs
hello dude, this is tick nr: 0
RAM disks registered
disk addr 1: 0x400c6fa0, size: 1000000
disk addr 2: 0x40074060, size: 262144
format /dev/rda done.
mount return: 0
mount return: 0
Starting 1 threads...
started thread 0: id: 0x0b010002, prio: 10
=========================
starting shell
=========================
RTEMS SHELL (Ver.1.0-FRC):/dev/console. Oct 14 2014. 'help' to list commands.
[/] #
[/] #
[/] #
[/] # pwd
/
[/] # ls
dev mram sdram
[/] # cd mram
[/mram] # cd template
[/mram/template] # pwd
/mram/template
[/mram/template] # ls
logs param
[/mram/template] #
[/mram/template] # cd logs
[?] # pwd
�
I'll be happy to forward the test case to an rtems developer.
Please create a bug report for this and attach anything you think is important. The easier it is to reproduce the more chance someone will look into it.

Thanks
Chris
Post by Rohner Thomas
NAME = libfatfsimg
BUILDDIR = build
all: $(NAME).a
.PHONY: $(NAME).a
@echo [GEN FATFS] $@
@dd if=/dev/zero of=$(NAME) bs=256 count=1024 > /dev/null
/sbin/mkfs.vfat -F 12 -S 512 -s 1 -r 512 -f 1 -v $(NAME)
mcopy -b/ -i $(NAME) content/* ::/
@xxd -i $(NAME) > $(NAME).c
@echo [CC] $@
@$(CC) -c $(CFLAGS) -o $@ $(NAME).c
$(NAME).a: $(NAME).o
@$(AR) rcs $@ $^
The object file is then linked against the rtems test application.
Marco
----------------------------------------------------------------------
--
Thomas
*Sent:* Donnerstag, 2. Oktober 2014 12:11
*Subject:* RE: Bug in getcwd()
Hello,
We have a system with the following configuration.
·Chip GR712RC
·Board: GR712 Development Board
·Compiler RTEMS RCC (according to your websites version)
·RTOS: RTEMS
·Library: GR-RTEMS-DRIVER Version 1.2.1.0
I'm using FAT as filesystem. We have same phenomenon for FAT12 or FAT16!
Freundliche Grüsse / Kind regards,
image001
*Thomas Rohner*
Entwicklungsingenieur Software
nanoTRONIC GmbH
Werkstrasse 27, CH - 3250 Lyss
T: +41 32 384 69 30, F: +41 32 384 69 31
www.nanotronic.ch <http://www.nanotronic.ch/> |
*Sent:* Mittwoch, 1. Oktober 2014 20:11
*Subject:* Re: Bug in getcwd()
Hello,
maybe I found a bug in getcwd().
We're using RTEMS 4.0 with Gaisler-Aeroflex....
With our libraries I get an erroneous string when directory-depth is
about 4 folders from root!
When I use this string to read directory it crahes!
Is there a limitation of string-length?
I get the same results for
Char buffer[200];
getcwd(buffer,sizeof(buffer));
or
char* ret = getcwd(NULL,0);
Is this with the IMFS? What BSP?
Can you put together a full test example so we can see what is really
happening?
There is a POSIX constant for PATH_MAX as I recall but it is quite
large.
Freundliche Grüsse / Kind regards,
image001
*Thomas Rohner*
Entwicklungsingenieur Software
nanoTRONIC GmbH
Werkstrasse 27, CH - 3250 Lyss
T: +41 32 384 69 30, F: +41 32 384 69 31
www.nanotronic.ch <http://www.nanotronic.ch/> |
--
Joel Sherrill, Ph.D. Director of Research & Development
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
_______________________________________________
users mailing list
http://lists.rtems.org/mailman/listinfo/users
Loading...