Skip to main content

Questions tagged [stack]

Filter by
Sorted by
Tagged with
2 votes
1 answer
218 views

With the function function fail() { local msg="$*" echo $msg at for i in ${!FUNCNAME[@]}; do echo " ${FUNCNAME[$i]} ${BASH_SOURCE[$i]}:${BASH_LINENO[$i]}" done exit ...
Harald's user avatar
  • 1,050
1 vote
1 answer
225 views

When setting up dynamic memory allocation, the Linux kernel has got to choose a place to put its heap, no? How does it avoid overriding its own stack or the stack growing and overriding the heap later?...
CocytusDEDI's user avatar
0 votes
0 answers
39 views

First of all, I tried to keep this post as clear as possible, and looked on stack websites for the below stack composes, but I failed to assemble them together in a sense to provide a standalone ...
Bruno Lobo's user avatar
1 vote
1 answer
214 views

Everything mapped in memory is explicit in ELF files except the stack segment. The stack segment is mapped automatically. Why is the stack segment not like other segments, with explicit settings in ...
Tomek Czajka's user avatar
0 votes
1 answer
281 views

I want to change the kernel stack size of Ubuntu 14.04 for the kernel modules. However, with menuconfig, or .config I couldn't find the CONFIG_THREAD_STACK_SIZE option. I just want to increase the ...
lee yk's user avatar
  • 11
1 vote
0 answers
46 views

In Linux, there is a per-process kernel stack that stores at the bottom of it (or top if the stack grows upwards) a small struct named thread_info, which in turn points to the task_struct of the ...
Idan Rosenzweig's user avatar
0 votes
1 answer
192 views

Iam trying to get the stack pointer of some thread using the /proc//stat, whenever i run the command,cat /proc/<pid>/stat | cut -d" " -f29 i end up getting zero, but when i run sudo ...
Hodgson Tetteh's user avatar
1 vote
2 answers
1k views

In the process address space, there is the stack and the heap. When a function is called, or even when a local variable is declared, it uses the stack; the kernel must assign physical address and ...
Dev Jain's user avatar
1 vote
1 answer
1k views

Linux allows ulimit -s unlimited, which allows programs to exhaust system memory and crash the computer. So, generally no good. But what are the drawbacks to a significantly higher limit to the ...
Ana's user avatar
  • 143
1 vote
1 answer
1k views

I have a Raspberry Pi 4 with the latest build of (Debian) raspberry pi OS. I am trying to configure iptables to redirect all traffic coming from the Pi (with ) to another machine (lets say with an IP ...
Phippsy's user avatar
  • 31
1 vote
1 answer
587 views

I was reading the Rust Unstable Book, and I saw a new feature for emit-stack-sizes, The rustc flag -Z emit-stack-sizes makes LLVM emit stack size metadata. It goes on to say NOTE: This LLVM feature ...
Evan Carroll's user avatar
  • 35.2k
1 vote
1 answer
380 views

How can I get the address bounds of the Linux stack using syscalls without resorting to using exception handlers? I can get the stack size using getrlimit, but it doesn't say where the stack starts ...
Vikors's user avatar
  • 11
2 votes
1 answer
2k views

As far as I know the Linux stack size limit is 8 MB, but on 64-bit machines there's no reason why it couldn't be massively increased, e.g. to 4 GB. This would allow programmers to mostly not worry ...
Timmmm's user avatar
  • 685
4 votes
2 answers
2k views

I've been carefully reading the linux man page for clone(), and I understand the difference between the clone() wrapper and the "raw" system call. But what I don't understand is why the ...
exliontamer's user avatar
0 votes
2 answers
482 views

How do I use, i.e. to have in bash variable, a directory just've been pushd, and not to do popd command ?
user avatar
1 vote
2 answers
179 views

I am running Arch Linux, 64bit latest update on one of my computers. I am currently a Computer Science student and we had a test yesterday where we were to implement a dynamic stack using linked lists....
linker's user avatar
  • 153
1 vote
1 answer
9k views

I have some old code that needs the stack to not be limited to 8192kb in order for it to run. I am used to doing this in /etc/security/limits.conf * stack hard unlimited * stack soft ...
ron's user avatar
  • 9,198
3 votes
1 answer
1k views

My default stack size (according to ulimit -s) is 8192 kB, so naturally the code below segfaults when I try to run it. Also, naturally, it works fine if I do a 'ulimit -s 9000'. However, when I do a '...
user3856370's user avatar
0 votes
1 answer
45 views

My understanding is that the Linux kernel allocates a stack to every process before it starts, and this initial size is configurable. A process can PUSH data to the stack directly via CPU instructions,...
Josh's user avatar
  • 1,784
0 votes
1 answer
97 views

Nowadays with protections like W^X , is it still possible to successfully exploit buffer overflows with for example NOP Slide ?
Parsa Mousavi's user avatar
5 votes
1 answer
293 views

I'm using bash 5.0.16 (and bash-completion 2.10) on Manjaro. Today, I absentmindedly hit the tab key while moving some files, and was greeted with an unexpected message: [charles@wirepile some_dir]$ ...
Charles Diploma's user avatar
2 votes
1 answer
596 views

(This is in the context of x86-64 Linux.) I am trying to write a high-reliability userland executable, and I have total control over the generated assembly. I don't want to rely on automatic stack ...
Mario Carneiro's user avatar
1 vote
1 answer
5k views

I have seen this answer and according to that Stack Trace can be seen like: $ cat /proc/<PID>/stack [<ffffffff81012b72>] save_stack_trace_tsk+0x22/0x40 [<ffffffff81213abe>] ...
Yash Jain's user avatar
  • 113
2 votes
1 answer
2k views

I have looked in several places such as here but none explain in detail the structs used for implementing the stack itself (the place where "tasks" (processes/threads) store their nested call ...
Lance Pollard's user avatar
3 votes
1 answer
1k views

As far as I understand, stack canaries work as fllows: Upon program startup a random value is generated and stored in the thread local storage (%fs:0x28). This random value is then pushed onto the ...
CryptoThomas's user avatar
12 votes
2 answers
6k views

I'm studying the ELF specification (http://www.skyfree.org/linux/references/ELF_Format.pdf), and one point that is not clear to me about the program loading process is how the stack is initialized, ...
Mario Carneiro's user avatar
1 vote
1 answer
778 views

Does exist any tool/command for checking the maximum that a process stack has used? I need that to tune the stack size configuration for a program.
Marcos Moraes's user avatar
1 vote
1 answer
2k views

What happens when a user mode task is interrupted ? I know for a fact that the CPU switches to the kernel mode stack by refring the TSS. But when and how does the kernel switches to the IRQ stack?
Neelansh Mittal's user avatar
22 votes
2 answers
32k views

For example, on OSX, it's even less than 512k. Is there any recommended size, having in mind, that the app does not use recursion and does not allocate a lot of stack variables? I know the question ...
Kiril Kirov's user avatar
22 votes
2 answers
10k views

From this post it is shown that FS:[0x28] is a stack-canary. I'm generating that same code using GCC on this function, void foo () { char a[500] = {}; printf("%s", a); } Specifically, I'm ...
Evan Carroll's user avatar
  • 35.2k
2 votes
1 answer
4k views

I am running pstack to find function stack for my application running on two machines (both RHEL) In one of my machine it is working as expected [root@civ4cez191 bin]# pstack 22947 Thread 2 (Thread ...
Gaurav's user avatar
  • 121
3 votes
0 answers
669 views

I have a program written in OCaml that tends to stack-overflow on platforms with small stacks. Rather than ulimiting the program to find and solve stack overflows one by one, I'd like to get a sorted ...
Clément's user avatar
  • 632
1 vote
1 answer
8k views

For gdb debugger (gdb) p &buffer This command is used to print the content of starting of buffer (stack), or print the address? If it is content, how to print the address?
TJCLK's user avatar
  • 153
-1 votes
2 answers
1k views

In terms of memory allocation efficiency is it right to say that after a fork() in the code of the child if I execute a program with execve() this would be more efficient than the same program ...
Zeno Raiser's user avatar
4 votes
1 answer
9k views

I learned default stack size for each process is limited to 8MB and mmap_base is calculated based on stack size in rlimit and random value. Code below is mmap_base function which calculates mmap_base ...
JuHyung Son's user avatar
0 votes
1 answer
1k views

I've analyzed memory consumption of a java program on Linux Mint. I used top to capture memory statistics (memory used by program and also system-wide indicators like total_mem_used and mem_free). The ...
rychu's user avatar
  • 101
1 vote
1 answer
826 views

On Linux, is it possible that memory pages that contain the process stack get swapped to disk? If so, is there a way to prevent that, either at compile time or at runtime. I'm asking because of a ...
FSMaxB's user avatar
  • 301
4 votes
2 answers
2k views

I created a simple C program and every time I load it in GDB, I see the same memory addresses allocated to the instructions of the program. For example, a function what() always loads at memory ...
7_R3X's user avatar
  • 1,204
1 vote
1 answer
1k views

According to Wikipedia and many other sources, Since PCB contains the critical information for the process, it must be kept in an area of memory protected from normal user access. In some ...
Humberto Fioravante Ferro's user avatar
2 votes
1 answer
1k views

I am currently reading Linux Kernel Development by Robert Love. In the chapter "15 The Process Address Space" he prints the memory map of a process. user@machine:~$ pmap 1424 #all the processes ...
JDurstberger's user avatar
1 vote
1 answer
152 views

What I want to know is how is the data in a stack translated. We can see the data like: 0x80808080 but does it have a meaning? What parts of the numbers stand for something different? And what does '...
user179648's user avatar
1 vote
3 answers
156 views

So, I have a directory containing around 50 directories having for name 3 letter uppercase words: AXC BCC EFC amongst other directories. I have already done a find to seek these 3 letter directories ...
scandalous's user avatar
2 votes
2 answers
864 views

What are the main stacks in Linux? What I mean is, for example when an interrupt occurs what stack will be used for it, and what is the difference between user process and kernel process stacks?
Nik Novák's user avatar
0 votes
1 answer
83 views

I have 2 files, file 1 and file 2 with the same column numbers. Column one has the chromosome number, column two has the promoter start site and column three has the promoter stop site. I want to ...
Maan's user avatar
  • 1
-1 votes
2 answers
204 views

for eg: CREATE TABLE MWWDATA.ACK997 ( AKTYPE CHAR(2) DEFAULT '' NOT NULL , AKNUM CHAR(9) DEFAULT '' NOT NULL ); CREATE TABLE MWWDATA.APREIDEXC ( EMPLID NUMBER(15, 0) DEFAULT NULL ); I ...
TOM's user avatar
  • 23
0 votes
3 answers
139 views

for eg: CREATE TABLE MWWDATA."VTCat02" ( "ID" NUMBER(10) DEFAULT NULL , "Cat" VARCHAR2(255) DEFAULT NULL , "Style_Code" VARCHAR2(255) DEFAULT NULL , "Vendor_Style_#" VARCHAR2(255) ...
TOM's user avatar
  • 23
0 votes
1 answer
583 views

eg: CREATE VIEW AIPKEYITEM.SEASONGROUPNETSALES ( CALENDARID , PRODUCTGROUPID FOR COLUMN PRDGRPID , NETSALESDOLLARS FOR COLUMN NETSA00001 , NETSALESUNITS FOR COLUMN NETSA00002 ) AS SELECT ...
TOM's user avatar
  • 23
12 votes
1 answer
26k views

Before jumping in and writing my own code, I want to find out if there is GNU/Linux software that is able to output something similar to QNX's showmem. For each thread of each process that is running,...
Alex Dima's user avatar
  • 121
23 votes
3 answers
25k views

Does the OS reserve the fixed amount of valid virtual space for stack or something else? Am I able to produce a stack overflow just by using big local variables? I've wrote a small C program to test ...
Amos's user avatar
  • 502
2 votes
1 answer
4k views

I am running an application on a Solaris 10 system. Yesterday we have set the process stack size to unlimited: ulimit -s unlimited Today during the load the process would not come up reporting that ...
Karlson's user avatar
  • 5,985