You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/11/02 16:49:20 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 opened a new pull request #4776: sim host ASAN improvement

xiaoxiang781216 opened a new pull request #4776:
URL: https://github.com/apache/incubator-nuttx/pull/4776


   ## Summary
   
   - sim: fix sim runtime err under sanitize check mode. 
   - sim: Split SIM_SANITIZE to SIM_ASAN and SIM_UBSAN
   - sim: Add more config to asan/kasan for testing
   
   ## Impact
   
   ## Testing
   Pass CI and ostest
   


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #4776: sim host ASAN improvement

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #4776:
URL: https://github.com/apache/incubator-nuttx/pull/4776#discussion_r741297136



##########
File path: boards/sim/sim/sim/scripts/Make.defs
##########
@@ -200,11 +205,15 @@ ifeq ($(CONFIG_SIM_M32),y)
   HOSTLDFLAGS += -m32
 endif
 
-ifeq ($(CONFIG_SIM_SANITIZE),y)
-  CCLINKFLAGS += -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer
+ifeq ($(CONFIG_SIM_ASAN),y)
+  CCLINKFLAGS += -fsanitize=address -fno-omit-frame-pointer
 else ifeq ($(CONFIG_MM_KASAN),y)
   CCLINKFLAGS += -fsanitize=kernel-address
 endif
 
+ifeq ($(CONFIG_SIM_UBSAN),y)
+  CCLINKFLAGS += -fsanitize=undefined

Review comment:
       According to [clang documentation](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#stack-traces-and-report-symbolization), `-fno-omit-frame-pointer` also contributes to UBSan.
   Consider adding it via a hidden Kconfig option that is selected when either ASan or UBSan is selected.




-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #4776: sim host ASAN improvement

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #4776:
URL: https://github.com/apache/incubator-nuttx/pull/4776#discussion_r741297136



##########
File path: boards/sim/sim/sim/scripts/Make.defs
##########
@@ -200,11 +205,15 @@ ifeq ($(CONFIG_SIM_M32),y)
   HOSTLDFLAGS += -m32
 endif
 
-ifeq ($(CONFIG_SIM_SANITIZE),y)
-  CCLINKFLAGS += -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer
+ifeq ($(CONFIG_SIM_ASAN),y)
+  CCLINKFLAGS += -fsanitize=address -fno-omit-frame-pointer
 else ifeq ($(CONFIG_MM_KASAN),y)
   CCLINKFLAGS += -fsanitize=kernel-address
 endif
 
+ifeq ($(CONFIG_SIM_UBSAN),y)
+  CCLINKFLAGS += -fsanitize=undefined

Review comment:
       According to [clang documentation](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#stack-traces-and-report-symbolization), `-fno-omit-frame-pointer` also contributes to UBSan.
   Consider adding it via a hidden Kconfig option that is selected when either ASan or UBSan is selected.




-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] Ouss4 merged pull request #4776: sim host ASAN improvement

Posted by GitBox <gi...@apache.org>.
Ouss4 merged pull request #4776:
URL: https://github.com/apache/incubator-nuttx/pull/4776


   


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #4776: sim host ASAN improvement

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #4776:
URL: https://github.com/apache/incubator-nuttx/pull/4776#discussion_r741307704



##########
File path: boards/sim/sim/sim/scripts/Make.defs
##########
@@ -200,11 +205,15 @@ ifeq ($(CONFIG_SIM_M32),y)
   HOSTLDFLAGS += -m32
 endif
 
-ifeq ($(CONFIG_SIM_SANITIZE),y)
-  CCLINKFLAGS += -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer
+ifeq ($(CONFIG_SIM_ASAN),y)
+  CCLINKFLAGS += -fsanitize=address -fno-omit-frame-pointer
 else ifeq ($(CONFIG_MM_KASAN),y)
   CCLINKFLAGS += -fsanitize=kernel-address
 endif
 
+ifeq ($(CONFIG_SIM_UBSAN),y)
+  CCLINKFLAGS += -fsanitize=undefined

Review comment:
       It's too complex to add a new Kconfig to handle it. It's fine to add -fno-omit-frame-pointer twice. Please take a look.




-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #4776: sim host ASAN improvement

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #4776:
URL: https://github.com/apache/incubator-nuttx/pull/4776#discussion_r741307704



##########
File path: boards/sim/sim/sim/scripts/Make.defs
##########
@@ -200,11 +205,15 @@ ifeq ($(CONFIG_SIM_M32),y)
   HOSTLDFLAGS += -m32
 endif
 
-ifeq ($(CONFIG_SIM_SANITIZE),y)
-  CCLINKFLAGS += -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer
+ifeq ($(CONFIG_SIM_ASAN),y)
+  CCLINKFLAGS += -fsanitize=address -fno-omit-frame-pointer
 else ifeq ($(CONFIG_MM_KASAN),y)
   CCLINKFLAGS += -fsanitize=kernel-address
 endif
 
+ifeq ($(CONFIG_SIM_UBSAN),y)
+  CCLINKFLAGS += -fsanitize=undefined

Review comment:
       It's too complex to add a new Kconfig to handle it. It's fine to add -fno-omit-frame-pointer twice. Please take a look.




-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #4776: sim host ASAN improvement

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #4776:
URL: https://github.com/apache/incubator-nuttx/pull/4776#discussion_r741297136



##########
File path: boards/sim/sim/sim/scripts/Make.defs
##########
@@ -200,11 +205,15 @@ ifeq ($(CONFIG_SIM_M32),y)
   HOSTLDFLAGS += -m32
 endif
 
-ifeq ($(CONFIG_SIM_SANITIZE),y)
-  CCLINKFLAGS += -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer
+ifeq ($(CONFIG_SIM_ASAN),y)
+  CCLINKFLAGS += -fsanitize=address -fno-omit-frame-pointer
 else ifeq ($(CONFIG_MM_KASAN),y)
   CCLINKFLAGS += -fsanitize=kernel-address
 endif
 
+ifeq ($(CONFIG_SIM_UBSAN),y)
+  CCLINKFLAGS += -fsanitize=undefined

Review comment:
       According to [clang documentation](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#stack-traces-and-report-symbolization), `-fno-omit-frame-pointer` also contributes to UBSan.
   Consider adding it via a hidden Kconfig option that is selected when either ASan or UBSan is selected.




-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] Ouss4 merged pull request #4776: sim host ASAN improvement

Posted by GitBox <gi...@apache.org>.
Ouss4 merged pull request #4776:
URL: https://github.com/apache/incubator-nuttx/pull/4776


   


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #4776: sim host ASAN improvement

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #4776:
URL: https://github.com/apache/incubator-nuttx/pull/4776#discussion_r741307704



##########
File path: boards/sim/sim/sim/scripts/Make.defs
##########
@@ -200,11 +205,15 @@ ifeq ($(CONFIG_SIM_M32),y)
   HOSTLDFLAGS += -m32
 endif
 
-ifeq ($(CONFIG_SIM_SANITIZE),y)
-  CCLINKFLAGS += -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer
+ifeq ($(CONFIG_SIM_ASAN),y)
+  CCLINKFLAGS += -fsanitize=address -fno-omit-frame-pointer
 else ifeq ($(CONFIG_MM_KASAN),y)
   CCLINKFLAGS += -fsanitize=kernel-address
 endif
 
+ifeq ($(CONFIG_SIM_UBSAN),y)
+  CCLINKFLAGS += -fsanitize=undefined

Review comment:
       It's too complex to add a new Kconfig to handle it. It's fine to add -fno-omit-frame-pointer twice. Please take a look.




-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org