You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "LingaoM (via GitHub)" <gi...@apache.org> on 2023/06/09 04:36:07 UTC

[GitHub] [nuttx] LingaoM opened a new pull request, #9499: debug: change generate debug symbols default enable

LingaoM opened a new pull request, #9499:
URL: https://github.com/apache/nuttx/pull/9499

   Since this not occupy actual binary size, so default y for debug used.
   
   ## Summary
   
   ## Impact
   
   ## Testing
   
   


-- 
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] [nuttx] patacongo commented on a diff in pull request #9499: debug: change generate debug symbols default enable

Posted by "patacongo (via GitHub)" <gi...@apache.org>.
patacongo commented on code in PR #9499:
URL: https://github.com/apache/nuttx/pull/9499#discussion_r1228392480


##########
Kconfig:
##########
@@ -1904,7 +1904,7 @@ config HEAP_COLORATION
 
 config DEBUG_SYMBOLS
 	bool "Generate Debug Symbols"
-	default n
+	default y

Review Comment:
   > it's tradeoff between the easy use and the more secure.
   
   I would always opt for security over convenience.  The consequence of security problems is much worse than any invconvience since it could result in the exposure of intellectual property.,
   
   You could make the default setting for CONFIG_DEBUG_SYMBOLS be "n" normally, but "y" if CONFIG_DEBUG_FEATURES is selected.  That default would probably be correct most of the time and, when it is not, it can still be overridden in the configuration.
   
   A more hardline approach would be to make CONFIG_DEBUG_SYMBOLS  depend on CONFIG_DEBUG_FEATURES   That would probably not be wise.
   
   In order for GDB to be usable, it needs not only symbols but usually also disabling optimization.  Should that have the same default setting?
   



-- 
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] [nuttx] xiaoxiang781216 commented on a diff in pull request #9499: debug: change generate debug symbols default enable

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #9499:
URL: https://github.com/apache/nuttx/pull/9499#discussion_r1226725960


##########
Kconfig:
##########
@@ -1904,7 +1904,7 @@ config HEAP_COLORATION
 
 config DEBUG_SYMBOLS
 	bool "Generate Debug Symbols"
-	default n
+	default y

Review Comment:
   it's tradeoff between the easy use and the more secure.



-- 
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] [nuttx] acassis commented on a diff in pull request #9499: debug: change generate debug symbols default enable

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on code in PR #9499:
URL: https://github.com/apache/nuttx/pull/9499#discussion_r1225815817


##########
Kconfig:
##########
@@ -1904,7 +1904,7 @@ config HEAP_COLORATION
 
 config DEBUG_SYMBOLS
 	bool "Generate Debug Symbols"
-	default n
+	default y

Review Comment:
   I think it could be useful for users that are willing to debug NuttX, but probably some users will forget to disable it and will ship the firmware with symbols enabled.



-- 
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] [nuttx] acassis commented on a diff in pull request #9499: debug: change generate debug symbols default enable

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on code in PR #9499:
URL: https://github.com/apache/nuttx/pull/9499#discussion_r1226626982


##########
Kconfig:
##########
@@ -1904,7 +1904,7 @@ config HEAP_COLORATION
 
 config DEBUG_SYMBOLS
 	bool "Generate Debug Symbols"
-	default n
+	default y

Review Comment:
   @raiden00pl @xiaoxiang781216 I did a test compiling stm32f103-minimum with and without debug symbols activated and in fact the final nuttx.bin is 99.999% equal in both cases. Actually the version with debug sysmbols enabled generated a binary 4 bytes smaller: 47464 vs 47468.
   
   So, the only issue is fine the company ship the ELF binary to the user for some reason.



-- 
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] [nuttx] davids5 commented on a diff in pull request #9499: debug: change generate debug symbols default enable

Posted by "davids5 (via GitHub)" <gi...@apache.org>.
davids5 commented on code in PR #9499:
URL: https://github.com/apache/nuttx/pull/9499#discussion_r1230540219


##########
Kconfig:
##########
@@ -1904,7 +1904,7 @@ config HEAP_COLORATION
 
 config DEBUG_SYMBOLS
 	bool "Generate Debug Symbols"
-	default n
+	default y

Review Comment:
   Please do not couple optimization setting and symbols. 
   
   This is easier, but not the way the release code will really run. Chaining it may make an image not fit in Flash or change the target of a crash. 
   
   Please do no make is easier for the user by turning on symbols automatically. 
   
   It is a trivial change a user can make and does not expose them to unconscious security issues without their own actions.  
   
   



-- 
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] [nuttx] acassis commented on a diff in pull request #9499: debug: change generate debug symbols default enable

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on code in PR #9499:
URL: https://github.com/apache/nuttx/pull/9499#discussion_r1227053474


##########
Kconfig:
##########
@@ -1904,7 +1904,7 @@ config HEAP_COLORATION
 
 config DEBUG_SYMBOLS
 	bool "Generate Debug Symbols"
-	default n
+	default y

Review Comment:
   @xiaoxiang781216 what about the "make debug" / "make release" approach?
   



-- 
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] [nuttx] raiden00pl commented on a diff in pull request #9499: debug: change generate debug symbols default enable

Posted by "raiden00pl (via GitHub)" <gi...@apache.org>.
raiden00pl commented on code in PR #9499:
URL: https://github.com/apache/nuttx/pull/9499#discussion_r1230630157


##########
Kconfig:
##########
@@ -1904,7 +1904,7 @@ config HEAP_COLORATION
 
 config DEBUG_SYMBOLS
 	bool "Generate Debug Symbols"
-	default n
+	default y

Review Comment:
   Choosing convenience over security is the worst possible option and is probably responsible for a large proportion of critical failures (infosec but also engineering in general). On the one hand, we have a small profit in the form of convenience for devs. On the other hand, we have the potential risk of a huge IP leak. From a risk management perspective, this change is just bad.



-- 
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] [nuttx] xiaoxiang781216 commented on a diff in pull request #9499: debug: change generate debug symbols default enable

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #9499:
URL: https://github.com/apache/nuttx/pull/9499#discussion_r1225835907


##########
Kconfig:
##########
@@ -1904,7 +1904,7 @@ config HEAP_COLORATION
 
 config DEBUG_SYMBOLS
 	bool "Generate Debug Symbols"
-	default n
+	default y

Review Comment:
   but we normally ship firmware with binary, hex or srec format.



-- 
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] [nuttx] xiaoxiang781216 commented on a diff in pull request #9499: debug: change generate debug symbols default enable

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #9499:
URL: https://github.com/apache/nuttx/pull/9499#discussion_r1228520984


##########
Kconfig:
##########
@@ -1904,7 +1904,7 @@ config HEAP_COLORATION
 
 config DEBUG_SYMBOLS
 	bool "Generate Debug Symbols"
-	default n
+	default y

Review Comment:
   But symbols is also very useful in Postmortem debugging.



-- 
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] [nuttx] acassis commented on a diff in pull request #9499: debug: change generate debug symbols default enable

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on code in PR #9499:
URL: https://github.com/apache/nuttx/pull/9499#discussion_r1230096538


##########
Kconfig:
##########
@@ -1904,7 +1904,7 @@ config HEAP_COLORATION
 
 config DEBUG_SYMBOLS
 	bool "Generate Debug Symbols"
-	default n
+	default y

Review Comment:
   > In order for GDB to be usable, it needs not only symbols but usually also disabling optimization. Should that have the same default setting?
   
   Greg, that is not always true. Normally for ARM (ie. Cortex-M family) disabling optimization helps (or even is needed to show correctly functions parameters, etc), but for Xtensa (ESP32) disabling optimization doesn't help the debug and introduces some issues. It could be something specific for Xtensa GCC, not sure. It was something that /me, @gustavonihei and @Ouss4 faced while debugging ESP32 chips.
   



-- 
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] [nuttx] raiden00pl commented on a diff in pull request #9499: debug: change generate debug symbols default enable

Posted by "raiden00pl (via GitHub)" <gi...@apache.org>.
raiden00pl commented on code in PR #9499:
URL: https://github.com/apache/nuttx/pull/9499#discussion_r1226187267


##########
Kconfig:
##########
@@ -1904,7 +1904,7 @@ config HEAP_COLORATION
 
 config DEBUG_SYMBOLS
 	bool "Generate Debug Symbols"
-	default n
+	default y

Review Comment:
   Enabling this option by default can lead to big f*ckups when ELF file with symbols is sent to users. 
   DJI used to ship their pro drone cameras with debug symbols, which made it possible to reverse engineer their products but also showed a violation of the GPL license. I don't think the company was happy about that.
   Potentially this is too dangerous for the fw provider.



-- 
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] [nuttx] xiaoxiang781216 commented on a diff in pull request #9499: debug: change generate debug symbols default enable

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #9499:
URL: https://github.com/apache/nuttx/pull/9499#discussion_r1227433155


##########
Kconfig:
##########
@@ -1904,7 +1904,7 @@ config HEAP_COLORATION
 
 config DEBUG_SYMBOLS
 	bool "Generate Debug Symbols"
-	default n
+	default y

Review Comment:
   it need more work



-- 
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] [nuttx] xiaoxiang781216 commented on a diff in pull request #9499: debug: change generate debug symbols default enable

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #9499:
URL: https://github.com/apache/nuttx/pull/9499#discussion_r1225835907


##########
Kconfig:
##########
@@ -1904,7 +1904,7 @@ config HEAP_COLORATION
 
 config DEBUG_SYMBOLS
 	bool "Generate Debug Symbols"
-	default n
+	default y

Review Comment:
   but we normally ship firmware with binary or hex format.



-- 
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] [nuttx] acassis commented on a diff in pull request #9499: debug: change generate debug symbols default enable

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on code in PR #9499:
URL: https://github.com/apache/nuttx/pull/9499#discussion_r1226626982


##########
Kconfig:
##########
@@ -1904,7 +1904,7 @@ config HEAP_COLORATION
 
 config DEBUG_SYMBOLS
 	bool "Generate Debug Symbols"
-	default n
+	default y

Review Comment:
   @raiden00pl @xiaoxiang781216 I did a test compiling stm32f103-minimum with and without debug symbols activated and in fact the final nuttx.bin is 99.992% equal in both cases. Actually the version with debug sysmbols enabled generated a binary 4 bytes smaller: 47464 vs 47468.
   
   So, the only issue is fine the company ship the ELF binary to the user for some reason.



-- 
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] [nuttx] acassis commented on a diff in pull request #9499: debug: change generate debug symbols default enable

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on code in PR #9499:
URL: https://github.com/apache/nuttx/pull/9499#discussion_r1230096538


##########
Kconfig:
##########
@@ -1904,7 +1904,7 @@ config HEAP_COLORATION
 
 config DEBUG_SYMBOLS
 	bool "Generate Debug Symbols"
-	default n
+	default y

Review Comment:
   > In order for GDB to be usable, it needs not only symbols but usually also disabling optimization. Should that have the same default setting?
   
   Greg, that is not always true. Normally for ARM (ie. Cortex-M family) disabling optimization helps (or even is needed to show correctly functions parameters, etc), but for Xtensa (ESP32) disabling optimization doesn't help the debug and introduces some issues. It could be something specific for Xtensa GCC, not use. It was something that /me, @gustavonihei and @Ouss4 faced while debugging ESP32 chips.
   



-- 
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