Quote:
hai eerok, your correct. thank you. " (String literals are stored in protected memory.) " --> this i am able to understand ( your correct ) and is there any way to see this string in protected memory ? in elf. is there any tool for that. but the core dump results shows strcpy raises segmentation fault. i am sure it is happening in this point. but my question is if you take the same concept program with array then you will not get segmentation problem then why it is for pointer? if your answer is "protected" means how can i make sure myself is there any way to make it conform using the linux tools? can you please help me to understand the problem. Thanks & Regards dayalan |
Quote:
It's true that an array doesn't create the problem of the string literal; a string literal is defined in the standard as a preprocessing token, so it's processed before user data areas are initialized. The standard says string literals are used to "initialize an array of static storage duration and length just sufficient to contain the sequence." (n1124.pdf "6.4.5 String literals") Perhaps it's faster to use string literals in the case where the contents don't need to be modified, or perhaps it's sometimes desirable to protect these strings for other reasons, but I admit that the larger questions here are beyond my technical competence :) |
Quote:
thanks for your good explanation. i understand the concept thank you once again. but can you tell me is there any tools in linux to trace these kind of problems other than gdb? thank you. Thanks & Regards dayalan |
|
All times are GMT -5. The time now is 03:14 AM. |