xiaoxiang781216 commented on a change in pull request #1369:
URL: https://github.com/apache/incubator-nuttx/pull/1369#discussion_r487415276
##########
File path: arch/arm/src/arm/arm_initialstate.c
##########
@@ -52,13 +52,7 @@
* Pre-processor Definitions
****************************************************************************/
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
-/****************************************************************************
- * Private Functions
- ****************************************************************************/
+#define IDLETHREAD_STACKMARGIN 128
Review comment:
> Well the assembly code works. and it is not portable.
>
> I did not consider e.g. AddressSanitizer, Stack Smashing Protector. - So
you may be correct this may not work.
>
Then how do I handle this with your method? You need give a solution, right?
> **Please Note: Fill the stack ONLY with the fill value as defined from
before or you will break all the monitors.**
I can't understand what you mean. I don't change the fill value(all value
same as before) in this patch. If I am wrong, please point the code location I
will correct them.
>
> Here is how I was looking at it. 1) I Draw a picture of the stack frame
> [ ]
> [ ]
> [ ]
> [ ]<---At the function
> [ marker1]
> [ ]
> [ what is here or not does not matter ]
> [ ]
> [ marker2 ]
> [ ] <- the allocation
>
> if the compiler messes with you and it looks like this, does not matter.
>
> [ marker2]
> [ ]
> [ what is here or not does not matter ]
> [ ]
> [ marker1 ]
> [ ] <- the allocation
>
> safe = min of (&marker2, &marker1) word gets you the lowest point on the
stack you can write to,
>
Then do you think it's the right thing to memset "[ ] <- the allocation"?!
> DO NOT Use MEMSET! (it will not write the correct pattern, and you already
know the call it a problem) Use a for() with the appropriate sized type
>
First, the original code use memset, not my patch. Second, why not use
memset? the orignial code work well.
"it will not write the correct pattern", could you explain the reason?
Sorry, I don't think this statment is right.
> Set the start address and write from bottom up or top down from or to
`safe`.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]