Some developers have programmed processes under Linux and found a Segmentation fault error when debugging with GDB. This error is mainly caused by accessing the wrong memory segment. It may be that there is no permission or the memory segment does not exist. How to deal with this problem?
follows:
This error is a result of how it? It turns out that a pointer of a char type is defined, and then the string is directly related to the pointer. For example:
char *c1;
for(i=0; i"n;i++)
{
*c1 = getchar();
c1++;
}
The code means this is the case, this is a problem that many developers will make. This pointer is dangerous, be cautious, just take it here, so assign pointers, we don't know where this pointer points, if the data written covers critical area data, it may have disastrous consequences, This is where you should visit. What is the solution? Tell this pointer to where it is. I use malloc to apply for a space for the string that the pointer will point to. This will indicate that the system allocates a safe space and will not divide the critical area of the memory. For you. This way you can operate safely.
This example tells us that pointers can't be used. If the pointer points to the wrong memory, it will cause a Segmentation fault error during programming. You can also use the above method. If you point to other areas, it will lead to more serious. as a result of.
Samba is a tool that can implement SMB protocol. You can share Linux system software through Samba s
The XFS file system is a 64-bit high-performance file system with very powerful fea
Because Linux installation software is more complicated, if the downloaded software is modified, it
In the Linuxp system, the itables command can perform a backup or restore for us, b
Linux changes the way Docker runs the root directory
How Linux sets up port forwarding for intranet access to intranet
Getting Started with Arch Linux
How to set up Kde5 for Gentoo Linux system?
How to modify the default timeout time of sudo in Ubuntu system?
Linux SecureCRT Chinese garbled how to do?
Summary of usage of the hexdump command in Linux systems
How to upgrade Ubuntu system to 4.x kernel
How to connect wifi through the command line under Linux?
openSUSE upgrade to version 13.2 of the method
Maybe you don't know the little secret of the Win10 start menu
Win8 solves the trouble of system image production
LCD screen white screen failure analysis and solution
Naruto OL Lei Ninja exam 138 layer how to play Lei Ninja exam 138 layer Raiders
Win7 Ultimate is set to click or double-click to open the file when you open the file.
Eth0: ERROR while getting interface flags: No such device