Skip to content
Advertisement

Tag: segmentation-fault

trying to cause SIGSEGV in mmap

I’m trying to create a memory mapping of length greater than the underlying file. When I access pages of the mapping (which are not correspondingly mapped to a file), a SIGBUS is caused. However when I try to access the memory outside the memory mapping length, it should cause SIGSEGV (but isn’t), why is that? Answer Stopping your program and

Execute binary file inside C code (No system())

I am trying to execute a binary executable file inside C code without using system since it has security and resource management issues. The system used here is Debian Buster with kernel 5.4.0-2-amd64 and gcc 9.2.1. I used the method in this question: execute binary machine code from C which is to convert executable into hexadecimal code with xxd -i,

Segmentation Fault with g++ in Linux Ubuntu, but not with g++/MingW in Windows, when printing a char string in C++ [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 3 years ago. Improve this question

Why is MAP_GROWSDOWN mapping does not grow?

I tried to create MAP_GROWSDOWN mapping with the expectation it would grow automatically. As specified in the manual page: MAP_GROWSDOWN This flag is used for stacks. It indicates to the kernel virtual memory system that the mapping should extend downward in memory. The return address is one page lower than the memory area that is actually created in the process’s

Segmentation fault core dumped 2d array

I’m trying to compile a c code under linux using gcc-4.9 (tried also 5.4) while so, I faced a segmentation fault error. this is the part of code where the problem exists: automorf is an array n x n long (int automorf[n][n]) Can you please help correcting the problem? Answer Try this and see output we have not p3[3]; and

Advertisement