casaroli commented on code in PR #19562:
URL: https://github.com/apache/nuttx/pull/19562#discussion_r3743865340


##########
arch/Kconfig:
##########
@@ -11,7 +11,7 @@ config ARCH_ARM
        bool "ARM"
        select ARCH_HAVE_BACKTRACE
        select ARCH_HAVE_INTERRUPTSTACK
-       select ARCH_HAVE_FORK
+       select ARCH_HAVE_VFORK if !BUILD_KERNEL

Review Comment:
   ARM selected the fork family unconditionally including kernel builds, and 
that has never worked. I tried removing them to check. On qemu-armv7a:knsh:
   
   ```
   user_main: vfork() test
   vfork_test: Started
   arm_dataabort: Data abort. PC: 80200430 DFAR: fffffb8d DFSR: 00000805
   dump_assert_info: Assertion failed panic: at file: 
armv7-a/arm_dataabort.c:174 task: ostest
   ```
   
   The problem is written in the [help text of kconfig 
option](https://github.com/casaroli/nuttx/blob/9093ae505d66075343667636e35c62e7dcfb4869/arch/Kconfig#L511-L514):
   
   ```
                in a kernel build fork() is reached through a system call, so 
the
                return address and stack pointer the architecture's fork entry 
point
                can see for itself are the kernel's, not the caller's, and a 
child
                built from those resumes at a kernel address.
   ```
   
   I have this working for armv7-a, arm64 and x86_64 and Xtensa LX7, but if I 
put here, just the armv7 is enough to double the PR size. So I propose we keep 
this unselectable now for kernel builds, and then on the following PRs, we 
remove this guard for arm, as we add the real arch support.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to