Re: [PATCH] thread.hpp: Fix redefinition of default argument

2022-03-19 Thread Chris Johns
Ok to push

Thanks
Chris

> On 19 Mar 2022, at 2:16 am, Sebastian Huber 
>  wrote:
> 
> A default argument shall be defined only once.
> 
> Close #4632.
> ---
> cpukit/include/rtems/thread.hpp | 32 ++--
> 1 file changed, 14 insertions(+), 18 deletions(-)
> 
> diff --git a/cpukit/include/rtems/thread.hpp b/cpukit/include/rtems/thread.hpp
> index cdef690740..56e301c0bc 100644
> --- a/cpukit/include/rtems/thread.hpp
> +++ b/cpukit/include/rtems/thread.hpp
> @@ -220,6 +220,12 @@ namespace rtems
>   /* affinity, cpu set size is? */
> };
> 
> +template 
> +inline typename std::decay::type
> +decay_copy(T&& t) {
> +  return std::forward(t);
> +}
> +
> /**
>  * @brief Create a thread with thread attributes.
>  *
> @@ -310,7 +316,14 @@ namespace rtems
>*/
>   template  class = enable_if_attributes>
> -  explicit thread(A&& attr, F&& func, Args&&... args);
> +  explicit thread(A&& attr, F&& func, Args&&... args)
> +: id_(0) {
> +start_thread(
> +  make_state(attr,
> + make_invoker(decay_copy(std::forward(func)),
> +  decay_copy(std::forward(args))...))
> +);
> +  }
> 
>   /**
>* Move the thread id to this instance.
> @@ -428,12 +441,6 @@ namespace rtems
>   void start_thread(state_ptr s);
> };
> 
> -template 
> -inline typename std::decay::type
> -decay_copy(T&& t) {
> -  return std::forward(t);
> -}
> -
> template
> thread::thread(F&& func, Args&&... args)
>   : id_(0)  {
> @@ -445,17 +452,6 @@ namespace rtems
>   );
> }
> 
> -template - class = thread::enable_if_attributes>
> -thread::thread(A&& attr, F&& func, Args&&... args)
> -  : id_(0) {
> -  start_thread(
> -make_state(attr,
> -   make_invoker(decay_copy(std::forward(func)),
> -decay_copy(std::forward(args))...))
> -  );
> -}
> -
> inline std::thread::id thread::get_id() const noexcept {
>   return std::thread::id(id_.id_);
> }
> -- 
> 2.34.1
> 

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] shell: Avoid potential stack corruption

2022-03-19 Thread Chris Johns

> On 15 Mar 2022, at 5:27 pm, Sebastian Huber 
>  wrote:
> 
> The rtems_shell_init() passed the address of a stack variable
> (exit_code) to rtems_shell_run().  If wait == false, then the stack
> variable goes out of scope but may be accessed by the created shell
> thread.
> 
> The rtems_shell_script() was affected by the same problem.
> 
> Close #4629.

Does this change remove the exit code?

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] shell: Avoid potential stack corruption

2022-03-19 Thread Sebastian Huber

On 19/03/2022 08:31, Chris Johns wrote:

On 15 Mar 2022, at 5:27 pm, Sebastian Huber 
 wrote:

The rtems_shell_init() passed the address of a stack variable
(exit_code) to rtems_shell_run().  If wait == false, then the stack
variable goes out of scope but may be accessed by the created shell
thread.

The rtems_shell_script() was affected by the same problem.

Close #4629.

Does this change remove the exit code?


No, the exit code member is still in the shell environment.

--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] GDB: Prefer Python 3 over 2

2022-03-19 Thread Sebastian Huber



On 18/03/2022 22:56, Chris Johns wrote:



On 19 Mar 2022, at 2:40 am, Sebastian Huber 
 wrote:

On 17/03/2022 12:51, Sebastian Huber wrote:

This fixes the build of a recent GDB version:
gdb/python/py-micmd.c: In function 'int 
micmdpy_uninstall_command(micmdpy_object*)':
gdb/python/py-micmd.c:430:20: error: 'PyDict_GetItemWithError' was not declared 
in this scope
PyObject *curr = PyDict_GetItemWithError (mi_cmd_dict.get (),
 ^~~


Has a bug report been raised with gdb?


The Python 2 EOL was January 1, 2020. This code was added by:

commit 740b42ceb7c7ae7b5343183782973576a93bc7b3
Author: Andrew Burgess 
Date:   Tue Jun 23 14:45:38 2020 +0100

gdb/python/mi: create MI commands using python

It is not a bug from my point of view.




I was able to build the latest GDB with this patch. Otherwise all architectures 
failed with the above error.


Has gdb dropped Python 2 support?


It seems so.



What happens on a host without python3 installed? Does the error appear? Does 
this in effect force RTEMS to drop the Python2 requirement for rtems6?


I guess if we want to use the next GDB release, then Python 3 is required.

--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

arm (bsp=xilinx_zynq_a9_qemu ) task in 'testsuites/fstests/fsdosfsname01.exe' failed

2022-03-19 Thread Heinz Junkes
Waf: Leaving directory 
`/home/rtems/ARM_TST/kernel/build/arm/xilinx_zynq_a9_qemu'
Build failed
 -> task in 'testsuites/fstests/fsdosfsname01.exe' failed with exit status 1 
(run with -v to display more information)

[1714/4241] Linking 
build/arm/xilinx_zynq_a9_qemu/testsuites/fstests/mimfs_fspermission.exe
[1715/4241] Linking 
build/arm/xilinx_zynq_a9_qemu/testsuites/fstests/mdosfs_fsrdwr.exe
/home/rtems/ARM_WORK/rtems/6/lib/gcc/arm-rtems6/10.3.1/../../../../arm-rtems6/bin/ld:
 
/home/rtems/ARM_WORK/rtems/6/lib/gcc/arm-rtems6/10.3.1/../../../../arm-rtems6/lib/thumb/armv7-a+simd/hard/libc.a(libc_a-ucsconv.o):
 in function `ucs_based_conversion_open':
/home/rtems/ARM_TST/rsb/rtems/build/arm-rtems6-gcc-0f001dd-newlib-d88cbd0-x86_64-linux-gnu-1/build/arm-rtems6/thumb/armv7-a+simd/hard/newlib/../../../../../../gnu-mirror-gcc-0f001dd/newlib/libc/iconv/lib/ucsconv.c:66:
 undefined reference to `_iconv_to_ucs_ces'
/home/rtems/ARM_WORK/rtems/6/lib/gcc/arm-rtems6/10.3.1/../../../../arm-rtems6/bin/ld:
 
/home/rtems/ARM_TST/rsb/rtems/build/arm-rtems6-gcc-0f001dd-newlib-d88cbd0-x86_64-linux-gnu-1/build/arm-rtems6/thumb/armv7-a+simd/hard/newlib/../../../../../../gnu-mirror-gcc-0f001dd/newlib/libc/iconv/lib/ucsconv.c:66:
 undefined reference to `_iconv_to_ucs_ces'
/home/rtems/ARM_WORK/rtems/6/lib/gcc/arm-rtems6/10.3.1/../../../../arm-rtems6/bin/ld:
 
/home/rtems/ARM_TST/rsb/rtems/build/arm-rtems6-gcc-0f001dd-newlib-d88cbd0-x86_64-linux-gnu-1/build/arm-rtems6/thumb/armv7-a+simd/hard/newlib/../../../../../../gnu-mirror-gcc-0f001dd/newlib/libc/iconv/lib/ucsconv.c:78:
 undefined reference to `_iconv_from_ucs_ces'
/home/rtems/ARM_WORK/rtems/6/lib/gcc/arm-rtems6/10.3.1/../../../../arm-rtems6/bin/ld:
 
/home/rtems/ARM_TST/rsb/rtems/build/arm-rtems6-gcc-0f001dd-newlib-d88cbd0-x86_64-linux-gnu-1/build/arm-rtems6/thumb/armv7-a+simd/hard/newlib/../../../../../../gnu-mirror-gcc-0f001dd/newlib/libc/iconv/lib/ucsconv.c:78:
 undefined reference to `_iconv_from_ucs_ces'
/home/rtems/ARM_WORK/rtems/6/lib/gcc/arm-rtems6/10.3.1/../../../../arm-rtems6/bin/ld:
 
/home/rtems/ARM_TST/rsb/rtems/build/arm-rtems6-gcc-0f001dd-newlib-d88cbd0-x86_64-linux-gnu-1/build/arm-rtems6/thumb/armv7-a+simd/hard/newlib/../../../../../../gnu-mirror-gcc-0f001dd/newlib/libc/iconv/lib/ucsconv.c:77:
 undefined reference to `_iconv_from_ucs_ces'
/home/rtems/ARM_WORK/rtems/6/lib/gcc/arm-rtems6/10.3.1/../../../../arm-rtems6/bin/ld:
 
/home/rtems/ARM_TST/rsb/rtems/build/arm-rtems6-gcc-0f001dd-newlib-d88cbd0-x86_64-linux-gnu-1/build/arm-rtems6/thumb/armv7-a+simd/hard/newlib/../../../../../../gnu-mirror-gcc-0f001dd/newlib/libc/iconv/lib/ucsconv.c:77:
 undefined reference to `_iconv_from_ucs_ces'
/home/rtems/ARM_WORK/rtems/6/lib/gcc/arm-rtems6/10.3.1/../../../../arm-rtems6/bin/ld:
 
/home/rtems/ARM_TST/rsb/rtems/build/arm-rtems6-gcc-0f001dd-newlib-d88cbd0-x86_64-linux-gnu-1/build/arm-rtems6/thumb/armv7-a+simd/hard/newlib/../../../../../../gnu-mirror-gcc-0f001dd/newlib/libc/iconv/lib/ucsconv.c:78:
 undefined reference to `_iconv_from_ucs_ces'
/home/rtems/ARM_WORK/rtems/6/lib/gcc/arm-rtems6/10.3.1/../../../../arm-rtems6/bin/ld:
 
/home/rtems/ARM_WORK/rtems/6/lib/gcc/arm-rtems6/10.3.1/../../../../arm-rtems6/lib/thumb/armv7-a+simd/hard/libc.a(libc_a-ucsconv.o):/home/rtems/ARM_TST/rsb/rtems/build/arm-rtems6-gcc-0f001dd-newlib-d88cbd0-x86_64-linux-gnu-1/build/arm-rtems6/thumb/armv7-a+simd/hard/newlib/../../../../../../gnu-mirror-gcc-0f001dd/newlib/libc/iconv/lib/ucsconv.c:78:
 more undefined references to `_iconv_from_ucs_ces' follow
collect2: error: ld returned 1 exit status

Gruss Heinz


___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: arm (bsp=xilinx_zynq_a9_qemu ) task in 'testsuites/fstests/fsdosfsname01.exe' failed

2022-03-19 Thread Joel Sherrill
Sebastian found this and is working on it. Newlib had a lot of work on its
build system and this broke.

Hopefully he will weigh in with status

On Sat, Mar 19, 2022, 10:54 AM Heinz Junkes 
wrote:

> Waf: Leaving directory
> `/home/rtems/ARM_TST/kernel/build/arm/xilinx_zynq_a9_qemu'
> Build failed
>  -> task in 'testsuites/fstests/fsdosfsname01.exe' failed with exit status
> 1 (run with -v to display more information)
>
> [1714/4241] Linking
> build/arm/xilinx_zynq_a9_qemu/testsuites/fstests/mimfs_fspermission.exe
> [1715/4241] Linking
> build/arm/xilinx_zynq_a9_qemu/testsuites/fstests/mdosfs_fsrdwr.exe
> /home/rtems/ARM_WORK/rtems/6/lib/gcc/arm-rtems6/10.3.1/../../../../arm-rtems6/bin/ld:
> /home/rtems/ARM_WORK/rtems/6/lib/gcc/arm-rtems6/10.3.1/../../../../arm-rtems6/lib/thumb/armv7-a+simd/hard/libc.a(libc_a-ucsconv.o):
> in function `ucs_based_conversion_open':
> /home/rtems/ARM_TST/rsb/rtems/build/arm-rtems6-gcc-0f001dd-newlib-d88cbd0-x86_64-linux-gnu-1/build/arm-rtems6/thumb/armv7-a+simd/hard/newlib/../../../../../../gnu-mirror-gcc-0f001dd/newlib/libc/iconv/lib/ucsconv.c:66:
> undefined reference to `_iconv_to_ucs_ces'
> /home/rtems/ARM_WORK/rtems/6/lib/gcc/arm-rtems6/10.3.1/../../../../arm-rtems6/bin/ld:
> /home/rtems/ARM_TST/rsb/rtems/build/arm-rtems6-gcc-0f001dd-newlib-d88cbd0-x86_64-linux-gnu-1/build/arm-rtems6/thumb/armv7-a+simd/hard/newlib/../../../../../../gnu-mirror-gcc-0f001dd/newlib/libc/iconv/lib/ucsconv.c:66:
> undefined reference to `_iconv_to_ucs_ces'
> /home/rtems/ARM_WORK/rtems/6/lib/gcc/arm-rtems6/10.3.1/../../../../arm-rtems6/bin/ld:
> /home/rtems/ARM_TST/rsb/rtems/build/arm-rtems6-gcc-0f001dd-newlib-d88cbd0-x86_64-linux-gnu-1/build/arm-rtems6/thumb/armv7-a+simd/hard/newlib/../../../../../../gnu-mirror-gcc-0f001dd/newlib/libc/iconv/lib/ucsconv.c:78:
> undefined reference to `_iconv_from_ucs_ces'
> /home/rtems/ARM_WORK/rtems/6/lib/gcc/arm-rtems6/10.3.1/../../../../arm-rtems6/bin/ld:
> /home/rtems/ARM_TST/rsb/rtems/build/arm-rtems6-gcc-0f001dd-newlib-d88cbd0-x86_64-linux-gnu-1/build/arm-rtems6/thumb/armv7-a+simd/hard/newlib/../../../../../../gnu-mirror-gcc-0f001dd/newlib/libc/iconv/lib/ucsconv.c:78:
> undefined reference to `_iconv_from_ucs_ces'
> /home/rtems/ARM_WORK/rtems/6/lib/gcc/arm-rtems6/10.3.1/../../../../arm-rtems6/bin/ld:
> /home/rtems/ARM_TST/rsb/rtems/build/arm-rtems6-gcc-0f001dd-newlib-d88cbd0-x86_64-linux-gnu-1/build/arm-rtems6/thumb/armv7-a+simd/hard/newlib/../../../../../../gnu-mirror-gcc-0f001dd/newlib/libc/iconv/lib/ucsconv.c:77:
> undefined reference to `_iconv_from_ucs_ces'
> /home/rtems/ARM_WORK/rtems/6/lib/gcc/arm-rtems6/10.3.1/../../../../arm-rtems6/bin/ld:
> /home/rtems/ARM_TST/rsb/rtems/build/arm-rtems6-gcc-0f001dd-newlib-d88cbd0-x86_64-linux-gnu-1/build/arm-rtems6/thumb/armv7-a+simd/hard/newlib/../../../../../../gnu-mirror-gcc-0f001dd/newlib/libc/iconv/lib/ucsconv.c:77:
> undefined reference to `_iconv_from_ucs_ces'
> /home/rtems/ARM_WORK/rtems/6/lib/gcc/arm-rtems6/10.3.1/../../../../arm-rtems6/bin/ld:
> /home/rtems/ARM_TST/rsb/rtems/build/arm-rtems6-gcc-0f001dd-newlib-d88cbd0-x86_64-linux-gnu-1/build/arm-rtems6/thumb/armv7-a+simd/hard/newlib/../../../../../../gnu-mirror-gcc-0f001dd/newlib/libc/iconv/lib/ucsconv.c:78:
> undefined reference to `_iconv_from_ucs_ces'
> /home/rtems/ARM_WORK/rtems/6/lib/gcc/arm-rtems6/10.3.1/../../../../arm-rtems6/bin/ld:
> /home/rtems/ARM_WORK/rtems/6/lib/gcc/arm-rtems6/10.3.1/../../../../arm-rtems6/lib/thumb/armv7-a+simd/hard/libc.a(libc_a-ucsconv.o):/home/rtems/ARM_TST/rsb/rtems/build/arm-rtems6-gcc-0f001dd-newlib-d88cbd0-x86_64-linux-gnu-1/build/arm-rtems6/thumb/armv7-a+simd/hard/newlib/../../../../../../gnu-mirror-gcc-0f001dd/newlib/libc/iconv/lib/ucsconv.c:78:
> more undefined references to `_iconv_from_ucs_ces' follow
> collect2: error: ld returned 1 exit status
>
> Gruss Heinz
>
>
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: arm (bsp=xilinx_zynq_a9_qemu ) task in 'testsuites/fstests/fsdosfsname01.exe' failed

2022-03-19 Thread Sebastian Huber

On 19/03/2022 17:20, Joel Sherrill wrote:

Sebastian found this and is working on it. Newlib had a lot of work on its
build system and this broke.

Hopefully he will weigh in with status


I sent a patch do the Newlib mailing list and wait for approval.

--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel