Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 01-22-2010, 03:30 AM   #1
LQ Newbie
Registered: Jul 2007
Posts: 1

Rep: Reputation: 0
memory corruption and the use or not of MALLOC_CHECK_

a program can have a memory corruption or a double free. therefore, I can use MALLOC_CHECK_ to debug, which is fine. However, I don't want to use this variable in production because it impairs performance and its purpose is for debugging. In this case, I have another problem. If MALLOC_CHECK_ is unset, glibc writes info in some channels, which can be /dev/tty or stderr or syslog. a program that is a server usually wants to detache from the console, which is my case. a server should also close stdin, stdout and stderr, which is my case as well. In my case, glibc can write in stderr, but the fd = 2 can be in use for my purpose (a file, a socket, whatever, but not stderr anymore). Therefore, I'll have glibc write in my file descriptor. what i could is to open /dev/null to 2 so to use the file desciptror.
What I would like to do is to prevent glibc from writing into stderr. I look up the internet for any kernel parameter, but I haven't found anything so far.
Can I configure something to control the behaviour of glibc?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
why MALLOC_CHECK_? sr_sanjeev Linux - General 4 03-20-2008 04:12 PM
malloc() memory corruption (C++) Coxynelle Programming 1 01-17-2007 05:07 PM
glibc detected ; memory corruption pingu Linux - Software 3 10-12-2005 02:29 AM
reboot corruption memory (slack 9.1) muhkuhmasta Slackware 4 07-21-2004 03:21 AM
Memory Corruption on AGP Video Card?! beutin Linux - Hardware 0 07-10-2003 06:37 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:41 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration