Opened 16 years ago
Closed 16 years ago
#3128 closed bug (fixed)
sh leaks memory
Reported by: | bhaible | Owned by: | bonefish |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | System/Kernel | Version: | R1/pre-alpha1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
When executing large configure scripts, the 'sh' process gets bigger and bigger.
While running a configure script in tight memory situation, I got an application crash. Clicking on the "Debug" button of the error dialog, I was presented a gdb session the shell that was executing the configure script. At the top, function fork().
To reproduce:
- Start Haiku in QEMU with 256 MB RAM allocated to it,
- Open a Terminal.
- $ tar xvfz testdir3.tar.gz
- $ cd testdir3
- $ ./configure --host=i586-pc-haiku --build=i586-pc-haiku
--prefix=/boot/home/config CPPFLAGS="-Wall" 2>&1 | tee log1
- Repeatedly do "ps". After some time, the "sh" process uses
40 MB user memory and 100 MB kernel memory. And it gets more and more... Until either a message "Out of memory" or a crash. Such a shell script should be executable in 10 MB.
Change History (3)
comment:1 by , 16 years ago
Component: | - General → System/Kernel |
---|
comment:2 by , 16 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
The kernel leak is fixed in hrev28644. Please reopen, if you can actually reproduce that the shell is leaking memory.
I don't see the growing shell memory size here. At least ProcessController constantly shows a little more than 400 KB for the terminal's login shell the whole time, and about 1.2 MB for the configure shell while it runs. I do see an increase in kernel memory usage though, suggesting a memory leak in the kernel.
The leak checking suggests that memory allocated in arch_vm_translation_map_init_map() is leaked, so supposedly the ref-counting doesn't work as it should. Will look into this later tonight, unless someone beats me to it.