Memory leakage...
Hi, I have been getting this error message on my FreeBSD 3.3 system: swap_pager: Out of Swap space. After digging a little bit, we found that there is a lot of memory leakage happening. This is how we went about finding: ps -aux for the process showed that vsz column was increasing very fast. But the rss column was almost stable( was not changing much). pstat -S also showed drastic fall in available swap space. My question is what could be the reason for this drastic increase in vsz column of ps -aux output? Is it because of unfreed malloced memory? Why rss is stable? Somebody could help me when will the vsz(virtual size) increases? thanks a lot --gb -- Never trust an operating system you don't have sources for. ;-) To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: How do I get port inside kernel....
Hi, Thanks a lot for your reply. It's quite useful. But I have some more questions generated of this study of nfs code and sendfile(2) code. The question is about getting a proc structure. Here it is. As you all know that every system call in side kernel needs a process structure to be passed. So to call socreate, sobind or getsocket we need a proc structure. My doubt is which process structure to pass? In nfs code, at some places it is passing the curproc structure which is nothing but currently running process. At other places example for socreate() and sobind(), it is using proc0 structure which is nothing but of the swap process. So when I am executing the kernel, what is the current process? Is it safe if I use proc0 to pass the proc structure to call socreate() and sobind()? How safe it is to use curproc structure? Somebody mentioned that it will not work in interrupt handlers. So somebody out there throw some light on the currently running process when inside kernel? thanks a lot --gb On Mon, 5 Jun 2000, Alfred Perlstein wrote: * G.B.Naidu [EMAIL PROTECTED] [000605 05:37] wrote: Hi, If I want to get a port inside kernel, how do I do that? In user land we will call socket(), bind() to get a port. But in kernel, is there any way to get a new port? Any ideas are appreciated. Check the nfsd code. src/sys/nfs -- To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
[REPOST] Re: How do I get port inside kernel.... (fwd)
Hi, Have posted this question yesterday. But no reply. Hope to et a reply to day. thanks for your time --gb -- -- Forwarded message -- Date: Tue, 6 Jun 2000 11:55:18 +0530 (IST) From: G.B.Naidu [EMAIL PROTECTED] To: Alfred Perlstein [EMAIL PROTECTED] Cc: [EMAIL PROTECTED], Deepika Kakrania [EMAIL PROTECTED], Madhavi Suram [EMAIL PROTECTED] Subject: Re: How do I get port inside kernel Hi, Thanks a lot for your reply. It's quite useful. But I have some more questions generated of this study of nfs code and sendfile(2) code. The question is about getting a proc structure. Here it is. As you all know that every system call in side kernel needs a process structure to be passed. So to call socreate, sobind or getsocket we need a proc structure. My doubt is which process structure to pass? In nfs code, at some places it is passing the curproc structure which is nothing but currently running process. At other places example for socreate() and sobind(), it is using proc0 structure which is nothing but of the swap process. So when I am executing the kernel, what is the current process? Is it safe if I use proc0 to pass the proc structure to call socreate() and sobind()? How safe it is to use curproc structure? Somebody mentioned that it will not work in interrupt handlers. So somebody out there throw some light on the currently running process when inside kernel? thanks a lot --gb On Mon, 5 Jun 2000, Alfred Perlstein wrote: * G.B.Naidu [EMAIL PROTECTED] [000605 05:37] wrote: Hi, If I want to get a port inside kernel, how do I do that? In user land we will call socket(), bind() to get a port. But in kernel, is there any way to get a new port? Any ideas are appreciated. Check the nfsd code. src/sys/nfs -- To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
How do I get port inside kernel....
Hi, If I want to get a port inside kernel, how do I do that? In user land we will call socket(), bind() to get a port. But in kernel, is there any way to get a new port? Any ideas are appreciated. thanks --gb -- To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: DDB is not setting break points...
Hi, Thanks Bruse for the reply. I am running 3.3-Release of FreeBSD. And my kernel is elf kernel. So according to Bruce, I cannot set the breakpoints from DDB until sysinit() finishes. So what is the safe point from where I can set break points from DDB? I want to use DDB because I want to debug online. thanks for the help. --gb On Fri, 2 Jun 2000, Bruce Evans wrote: On Thu, 1 Jun 2000, G.B.Naidu wrote: I am having problems with DDB while setting breakpoints in the kernel. I entered the DDB by giving kernel -d at boot prompt. After that I tried to set break point at ip_output() by giving "b ip_output". But it complains saying that "sumbol not found". I thought this might be due to stripped Early setting of breakpoints by name was broken by the switch to elf in FreeBSD-3.0 (symbols aren't available until the kernel module sysinit runs much later). I think it works for aout kernels in 3.x but not in 4.0 or -current. Use gdb or set breakpoints early by value in broken versions. Bruce -- To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: DDB is not setting break points... (fwd)
Hi, I have tried with unstripped kernel also. I am getting the same error. So looks like the symbols are not available until sysinit is called. So what is the right place to put breakpoints in the process of booting up? thanks --gb On Fri, 2 Jun 2000, Daniel C. Sobral wrote: "G.B.Naidu" wrote: Hi Doug, Thanks for your reply. We tried as per your mail. But still the DDB is complaining the same saying that "symbol not found". What could be the reason? Am I missing something in the whole process? Maybe you are stripping your kernel. -- To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: DDB is not setting break points... (fwd)
Hi Doug, Thanks for your reply. We tried as per your mail. But still the DDB is complaining the same saying that "symbol not found". What could be the reason? Am I missing something in the whole process? thanks --gb On Thu, 1 Jun 2000, Doug White wrote: On Thu, 1 Jun 2000, G.B.Naidu wrote: Have posted this questoin earlier. I have got no replies. Some body take some time to clarify this? cd /sys/boot make depend all install disklabel -B ad0 reboot This will update your bootblocks. In the handbook chap 21, Note says: Note that if you have an older version of boot blocks. your debugger symbols might not be loaded at all. Update the bopot blocks; Doug White| FreeBSD: The Power to Serve [EMAIL PROTECTED] | www.FreeBSD.org -- To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
RE: system hangs... (fwd)
Hi, I have posted this earlier. I didnt get any reply about system hangs. Please some body help me out to track down these hangs. Questions are below. thanks --gb -- Forwarded message -- Date: Tue, 30 May 2000 14:32:30 +0530 (IST) From: G.B.Naidu [EMAIL PROTECTED] To: "Koster, K.J." [EMAIL PROTECTED] Cc: [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: system hangs... Hi, Please see my comments below: On Tue, 30 May 2000, Koster, K.J. wrote: We have made some kernel changes. And accordingly we are testing the changes using some user level daemon. After sending some packets, the system hangs. The number of packets sent before the system hangs varies from time to time. What kind of changes? What kind of packets? What kind of deamon? What kind of kernel? We are trying to implement MPLS on FreeBSD. so we are implementing forwarding tables in side the kernel. The chamges are done in ip_output() and ether_output(). We have added some more routing messages and corresponding functions. Dameon we are running is LDP daemon. The packets We are sending to test are ping packets. Kernel version is 3.3-RELEASE Could some body tell me how to know what is happening? How do I find out the reason for hanging? Is there anyway to get such information through some core dump? I have enabled taking dumps and it is dumping when the system panics but not when it hangs. You can make the system panic manually, and then you have your kernel core. I am concerned about hangs not panic. If it hangs, I cant type even enter. Nothing responds except the reset and power off key. SO is there a way I can take core dumps when the system hangs? As for how to know what's happening: printf() is your friend. Is there a way to redirect the out put of printf() statements into /var/log/messages file? How do I do that? Is memory leakage can cause a system hang? If so how do I find out that there is a memory leakage? There are many good books and web sites that cover basic debugging techniques. Could you please give me some pointers to these locations and books? I would be glad to know those locations where I can get some debug techniques. You have to provide a *lot* more information than this. We can only help you if you are able to produce some detailed description of your problem. If you can't tell sitting behind the box, how are we supposed to know what you've done wrong? If you need any more information, please let me know. The problem is because the system hangs, I cant do anything to find out what's happening. thanks a lot --gb Kees Jan == Everyone is responsible for his own actions, and (people tend to forget this) the effect they have on others. To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-net" in the body of the message To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: system hangs... (fwd)
Hi Soren, Thanks a lot for the help. CTRL+ALT+ESC works. Thanks once again. Now we can do some analysis. regards --gb On Wed, 31 May 2000, Soren Schmidt wrote: It seems G.B.Naidu wrote: I have posted this earlier. I didnt get any reply about system hangs. Please some body help me out to track down these hangs. Questions are below. Have you tried putting DDB into the kernel, and tried to hit ALT+CTRL+ESC to go into the debugger on the hang ? Printf is a good tool here, sprinkle your source with printf's so you can see how far you get, and what essential values are getting used. Another possibility is to attach 8 LED's to a printer port, those you can then turn on/off at will by a simple outb statement. I use a 2*40 char LCD display connected this way sometimes, that gives me a history of 80 values, so I can se the exact sequence of events that let me to the problem at hand.. -Søren -- To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
DDB is not setting break points...
Hi, I am having problems with DDB while setting breakpoints in the kernel. I entered the DDB by giving kernel -d at boot prompt. After that I tried to set break point at ip_output() by giving "b ip_output". But it complains saying that "sumbol not found". I thought this might be due to stripped kernel.( I configured the kernel with -g option), so I installed the unstripped kernel. Still I am getting the same error message from DDB. Why it is not setting break points? Am I missing some thing? In the handbook chap 21, Note says: Note that if you have an older version of boot blocks. your debugger symbols might not be loaded at all. Update the bopot blocks; I am having a doubt that is it due to older version of boot blocks? I am running FreeBSD 3.3-RELEASE. How do I findout that whether my boot blocks are older? In the first place is it the reason for DDB complaining about symbols not found? Any help is appreciated. thanks --gb -- To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
RE: system hangs...
Hi Guys, My system hangs. I know how to take core dumps and start debugging if it is panicing. But the system hangs, then I cant do anything. The only thing I can do is reset or power off and on. What I would like to know is how to handle hangs. I guess that panic and hangs are different. Koster, I will reply to your mail soon. I will try to give all the information I can give. thanks a lot --gb On Tue, 30 May 2000, Joshua Goodall wrote: I think, generically, you want to look at http://www.freebsd.org/handbook/kerneldebug.html in particular 22.4 -- Joshua Goodall To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
RE: system hangs...
Hi, Please see my comments below: On Tue, 30 May 2000, Koster, K.J. wrote: We have made some kernel changes. And accordingly we are testing the changes using some user level daemon. After sending some packets, the system hangs. The number of packets sent before the system hangs varies from time to time. What kind of changes? What kind of packets? What kind of deamon? What kind of kernel? We are trying to implement MPLS on FreeBSD. so we are implementing forwarding tables in side the kernel. The chamges are done in ip_output() and ether_output(). We have added some more routing messages and corresponding functions. Dameon we are running is LDP daemon. The packets We are sending to test are ping packets. Kernel version is 3.3-RELEASE Could some body tell me how to know what is happening? How do I find out the reason for hanging? Is there anyway to get such information through some core dump? I have enabled taking dumps and it is dumping when the system panics but not when it hangs. You can make the system panic manually, and then you have your kernel core. I am concerned about hangs not panic. If it hangs, I cant type even enter. Nothing responds except the reset and power off key. SO is there a way I can take core dumps when the system hangs? As for how to know what's happening: printf() is your friend. Is there a way to redirect the out put of printf() statements into /var/log/messages file? How do I do that? Is memory leakage can cause a system hang? If so how do I find out that there is a memory leakage? There are many good books and web sites that cover basic debugging techniques. Could you please give me some pointers to these locations and books? I would be glad to know those locations where I can get some debug techniques. You have to provide a *lot* more information than this. We can only help you if you are able to produce some detailed description of your problem. If you can't tell sitting behind the box, how are we supposed to know what you've done wrong? If you need any more information, please let me know. The problem is because the system hangs, I cant do anything to find out what's happening. thanks a lot --gb Kees Jan == Everyone is responsible for his own actions, and (people tend to forget this) the effect they have on others. To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
How do I time in kernel...
Hi, I would like to know how to get time of the day in side kernel. When I used gettimeofday() in side kernel, it was giving panic on 3.3 FreeBSD release. It didnt panic on 3.1-RELEASE. So what is the problem? Can I use gettimeofday() inside kernel? if so why 3.3 is panicking? Ifnot why 3.1 is not panicking? Next question is how can I achieve the equal functionality of gettimeofday() call in kernel? Is there anyway? One more question: Is it wrong to call system call from kernel files? Any help is appreciated. thanks --gb -- To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Device driver requirement...
Hi, I would like to know about the device drivre development. I know the basic concepts behind a device driver. But haven't written a driver my self. But now time has come for me to do that. I need to develop a device driver for a ethernet switch/hub. So I would like to have some clarifications: 1. How much effort it takes for a real device driver to be written? Please provide a realistic estimate. I guess somebody might have written some commercial device drivres. 2. What all information do I need to design a device driver? I have the data sheets of the product available from the net. Anything else I need? 3. How do I decide whether a driver has to be block device or character device? 4. I went through the two documents posted on the list about newbus. Is it mandatory that one has to use newbus architecture from FreeBSD 4.0 onwards? Frankly speaking I didnt understand much of the documents. 5. I would like to know where I can get the small driver written by Warner Losh? 6. Any other info on device drivers for freeBSD other than these two documents posted on the list? I checked in the handbook but there seems nothing on device drivres. thanks in advance --gb To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
new comer...
Hi, I am G.B. Naidu, a unix maniac. What is the discussion that's going on currently on this list? I have some simple question. Many of you might have written some hooks into the kernel. I wonder what are these hooks and how to write them? Can somebody help me to understand this. thanks --gb -- To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message