Linux-Development-Sys Digest #162, Volume #8 Thu, 21 Sep 00 05:13:07 EDT
Contents:
Re: Memprof -- lack of behavior. (Thaddeus L Olczyk)
/proc/*/stat: parsing the file name (Alan J Rosenthal)
C-Linux e le NCURSES (Iperione)
Video Overlay Card Recomendations needed ("Norm Dresner")
Problem with fopen under RedHat 6.2 (Doug Dodson)
Re: Problem with fopen under RedHat 6.2 (Kaz Kylheku)
Re: Problem with fopen under RedHat 6.2 (Serban-Mihai Popescu)
Re: High precision timer needed (Chuck)
Re: ASM problem building kernel (Myke Morgan)
Kernel Module Support: QM_SYMBOLS unknown error 263732004 (Subhachandra Chandra)
Re: How to add a system call (Yung-Hsiang Lu)
how is a sleeping disk woken up? (Yung-Hsiang Lu)
how to send process to background and foreground using a system or lib function?
("Richard Lim")
Re: how to send process to background and foreground using a system or lib function?
(Derek M. Flynn)
Re: High precision timer needed (Maciej Golebiewski)
Re: Memprof -- lack of behavior. (Graeme Roy)
----------------------------------------------------------------------------
From: [EMAIL PROTECTED] (Thaddeus L Olczyk)
Subject: Re: Memprof -- lack of behavior.
Date: Wed, 20 Sep 2000 17:25:28 GMT
Reply-To: [EMAIL PROTECTED]
gOn Tue, 19 Sep 2000 20:31:38 GMT, Szabolcs Csetey
<[EMAIL PROTECTED]> wrote:
> Art Haas <[EMAIL PROTECTED]> wrote:
>> I didn't think it would catch new() leaks, but I wasn't sure.
>
>new() uses malloc internally so all mem debug tool catches those leaks
>as well.
>
>> Purify catches these problems, but if you want an open-source type
>> tool, it won't do. I've seen it in action, though, and it does a great
>> job at finding these problems. There is the GNU Checker program, which
>> does similar things, but it doesn't seem to be maintained. Perhaps
>
>There are quite a lot of tools, a quick search should give you back tons
>of them. My favourits are yamd and mpatrol (both are free), of course
>they caught both leaks.
>
>WARNING: Memory leak
>Address 0x4017bff6, size 10
>Allocated by malloc at
> /lib/libc.so.6(malloc+0x2a)[0x400dea8a]
> /home/csz/test/memleak.cc:6(main)[0x8048efc]
> /lib/libc.so.6(__libc_start_main+0xff)[0x4009d9ab]
> (null):0(_init)[0x8048e41]
>
>WARNING: Memory leak
>Address 0x40023ff6, size 10
>Allocated by malloc at
> /lib/libc.so.6(malloc+0x2a)[0x400dea8a]
> /usr/lib/libstdc++-libc6.1-1.so.2(__builtin_new+0x26)[0x40057006]
> /usr/lib/libstdc++-libc6.1-1.so.2(__builtin_vec_new+0x1c)[0x400571dc]
> /home/csz/test/memleak.cc:5(main)[0x8048eed]
> /lib/libc.so.6(__libc_start_main+0xff)[0x4009d9ab]
> (null):0(_init)[0x8048e41]
>
>
I hate to be picky, but is there one that can read the symbol tables,
since I'm not very good at doing that myself :(
------------------------------
From: [EMAIL PROTECTED] (Alan J Rosenthal)
Subject: /proc/*/stat: parsing the file name
Date: 20 Sep 2000 16:21:59 GMT
Greetings. It seems to me that the /proc/*/stat file in linux is unparseable.
I created an executable which just cats /proc/self/stat, and I called it
'a) b' (hm, I just realized I could have simply renamed a copy of 'cat'),
and its output was then (line wrapped)
6592 (a) b) R 4579 6592 4579 34821 6592 0 20 0 79 0 0 1 0 0 17 0 0 0 890837136
1110016 81 2147483647 134512640 134513938 3221223936 3221223704 1074532452 0 0
0 0 0 0 0 17 0
Is there a way to parse this (re field #2)? I'm interested in a later field,
but I do have to skip the earlier stuff to get it. Unless I want to parse
from the end, blech.
'ps' seems to get it right... does it get its information from somewhere
else? It *does* refer to the /proc/<pid>/stat file in the source code,
and it has a big scanf (in accordance with the man page proc(4)) which I'm
sure has to fail in the case of spaces in the file name... or am I wrong?
I didn't spend the time to determine what it uses the result of that scanf
for but it does seem to get everything right about the process named with
parentheses and spaces in the file name, e.g. it gets its start time right
(which is what I'm looking for).
This is running with redhat's kernel 2.2.16-3, if it makes a difference,
which I assume it doesn't.
thanks,
ajr
------------------------------
From: Iperione <[EMAIL PROTECTED]>
Subject: C-Linux e le NCURSES
Date: Wed, 20 Sep 2000 19:30:44 +0200
Reply-To: [EMAIL PROTECTED]
Qualcuno ha esperienza di programmazione in C, con Linux, utilizzando
le librerie grafiche NCURSES? Potreste indicarmi le procedure per
l'attivazione di nuove finestre (solo chi le ha effettivamente testate)
il ridimensionamento della shell standard da programma, anche tramite
l'invocazione di System Calls alle API di Linux.
Mi basterebbe anche l'indicazione di dove reperire materiale informativo,
in italiano od inglese, su internet.
Grazie....
------------------------------
Reply-To: "Norm Dresner" <[EMAIL PROTECTED]>
From: "Norm Dresner" <[EMAIL PROTECTED]>
Subject: Video Overlay Card Recomendations needed
Date: Wed, 20 Sep 2000 17:43:46 GMT
I have an old MS-DOS/AMX system that uses a standard VGA card for the
primary program interface and a TrueVision Targa+64 Video (capture) board to
generate overlays for an separate NTSC video stream.
I need to update this system to Linux and I'm considering replacing the
Targa board because:
1. We have no source code for the driver that initializes the board even
though the board came with complete source code for the library itself
2. We have no spare board(s).
The primary requirements for the new board are:
A. Create overlay (text and/or simple pixel graphics) for an independent
NTSC video stream.
B. Co-exist with a normal VGA card that is the primary display
C. There must be either a complete Linux driver for the board or
complete programming information must be available so I can write the
driver(s).
D. We'd like the cost to be under $500US per board
E. COTS availability
All suggestions and recommendations are welcome.
Norm Dresner
Fellow Systems Engineer
Radar Systems Engineering Department
Electronic Systems and Sensors Segment
Northrop Grumman Corporation
MS 520
Box 746
Baltimore MD 21203
Voice: (410) 993 - 2096 Mornings; all-day voice-mail
(410) 969 - 8068 Afternoons with answering machine
FAX: (410) 993 - 8084 On-site
(410) 969 - 8068 Afternoons; call first to arrange
E-Mail:Mornings: [EMAIL PROTECTED]
Afternoons: [EMAIL PROTECTED]
------------------------------
From: Doug Dodson <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.misc
Subject: Problem with fopen under RedHat 6.2
Date: Wed, 20 Sep 2000 15:12:49 -0400
This is a multi-part message in MIME format.
==============3EA6091F89A90A858EF09622
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi,
I was away on vacation and might have missed any responses to this...
We are trying to port some code over to a Linux PC running RedHat 6.2.
Compilation of the code is fine, however when we run, we get a
segmentation fault on one of our fopen calls. We seem to be able to
pass through the code once, but on the second iteration, we get the
fault. This code is being ported from a Solaris machine where it ran
fine. Here is the output of "gdb sfg core". We are just wondering if
this is a known bug or if anyone has seen behavior like this before.
Thanks for any help:
GNU gdb 19991004
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "i386-redhat-linux"...
Core was generated by `sfg x w0000001.txt w0000002.txt w0000003.txt
w0000004.txt w0000005.txt w0001000'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libc.so.6...done.
Reading symbols from /lib/ld-linux.so.2...done.
#0 0x40074709 in chunk_alloc (ar_ptr=0x40109d60, nb=184) at
malloc.c:2763
2763 malloc.c: No such file or directory.
(gdb) where
#0 0x40074709 in chunk_alloc (ar_ptr=0x40109d60, nb=184) at
malloc.c:2763
#1 0x400745ce in __libc_malloc (bytes=176) at malloc.c:2696
#2 0x4006d83b in _IO_new_fopen (filename=0xbfff9cdc "w0000002.txt",
mode=0x8054708 "r") at iofopen.c:42
#3 0x804c8f0 in oratag ()
#4 0x8049e60 in main ()
#5 0x400339cb in __libc_start_main (main=0x8048b0c <main>, argc=992,
argv=0xbfffb954, init=0x80487d8 <_init>, fini=0x8053a5c <_fini>,
rtld_fini=0x4000ae60 <_dl_fini>, stack_end=0xbfffb94c)
at ../sysdeps/generic/libc-start.c:92
- Doug -
==============3EA6091F89A90A858EF09622
Content-Type: text/x-vcard; charset=us-ascii;
name="dodson.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Doug Dodson
Content-Disposition: attachment;
filename="dodson.vcf"
begin:vcard
n:Dodson;Douglas
x-mozilla-html:FALSE
org:SRI International;State College, PA
adr:;;;;;;
version:2.1
email;internet:[EMAIL PROTECTED]
title:System/Network Administrator
fn:Douglas B. Dodson
end:vcard
==============3EA6091F89A90A858EF09622==
------------------------------
From: [EMAIL PROTECTED] (Kaz Kylheku)
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.misc
Subject: Re: Problem with fopen under RedHat 6.2
Reply-To: [EMAIL PROTECTED]
Date: Wed, 20 Sep 2000 19:48:41 GMT
On Wed, 20 Sep 2000 15:12:49 -0400, Doug Dodson <[EMAIL PROTECTED]> wrote:
>This is a multi-part message in MIME format.
>--------------3EA6091F89A90A858EF09622
>Content-Type: text/plain; charset=us-ascii
>Content-Transfer-Encoding: 7bit
Please don't post MIME to Usenet discussion groups. Say, haven't you been
reminded about this about a hundred times already?
>Program terminated with signal 11, Segmentation fault.
>Reading symbols from /lib/libc.so.6...done.
>Reading symbols from /lib/ld-linux.so.2...done.
>#0 0x40074709 in chunk_alloc (ar_ptr=0x40109d60, nb=184) at
>malloc.c:2763
>2763 malloc.c: No such file or directory.
>(gdb) where
>#0 0x40074709 in chunk_alloc (ar_ptr=0x40109d60, nb=184) at
>malloc.c:2763
>#1 0x400745ce in __libc_malloc (bytes=176) at malloc.c:2696
>#2 0x4006d83b in _IO_new_fopen (filename=0xbfff9cdc "w0000002.txt",
> mode=0x8054708 "r") at iofopen.c:42
Your program has corrupted the dynamic memory heap, which fopen() uses in order
to allocate the stream structure. Perhaps your program called fclose() or
free() on the same pointer twice or wrote beyond the boundaries of a dynamic
object. This is not a Linux or glibc issue, but your own buggy programming.
Just because a program dies in the middle of a library function doesn't meant
that the library has a defect.
There exist semi-automated ways to debug for this sort of problem, e.g. by
linking the ElectricFence library to your program. man efence
Also read the C programming FAQ: http://www.eskimo.com/~scs/C-faq/top.html
Especially section 16, and questions 7.19 and 18.2.
Question 7.19
My program is crashing, apparently somewhere down inside malloc, but I
can't see anything wrong with it.
Question 18.2
How can I track down these pesky malloc problems?
--
Any hyperlinks appearing in this article were inserted by the unscrupulous
operators of a Usenet-to-web gateway, without obtaining the proper permission
of the author, who does not endorse any of the linked-to products or services.
------------------------------
From: Serban-Mihai Popescu <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.misc
Subject: Re: Problem with fopen under RedHat 6.2
Date: Wed, 20 Sep 2000 20:42:07 GMT
Doug Dodson wrote:
> fault. This code is being ported from a Solaris machine where it ran
> fine. Here is the output of "gdb sfg core". We are just wondering if
And again, the fact your code worked fine on Sloaris doesn't mean it is
also correct; this is only a consequence of the Sloaris "forgiveness"
w.r.t. incorrect handling of malloc'ed memory (like free'ing twice the
same pointer or using a pointer after it has been freed).
Serban
------------------------------
From: Chuck <[EMAIL PROTECTED]>
Subject: Re: High precision timer needed
Date: Wed, 20 Sep 2000 16:48:51 -0400
Reply-To: [EMAIL PROTECTED]
> I'm looking for a timer function just like times(2), but with higher
> precision.
I'm not sure what you need to do, but have you looked into either
real time linux (RTL) or real time application interface for linux (RTAI)?
They both require kernel modification, but I think you can handle it.
Both can control processes with a precision of ~10 us, and can report
times (if that's what you're looking to do) in ns ranges.
www.rtlinux.org
www.rtai.org
Cheerio-
-Chuck
------------------------------
From: Myke Morgan <[EMAIL PROTECTED]>
Subject: Re: ASM problem building kernel
Date: Wed, 20 Sep 2000 16:17:35 -0700
Paul Kimoto wrote:
<snip>
> >
> > This is the 2.2.14 source.
>
> I don't think so. As far as I can tell, there is no save_kern_fpu or
> i387.h file in the Torvalds/Cox 2.2.{14,15,16,17,18-pre6} kernels. In any
> case, you should be using 2.2.16 or later for security reasons; see the
> release notes at http://www.linux.org.uk/.
>
Well, RedHat does it again I guess :) Thanks for your help.
Unfortunately to develop software for RedHat systems, we want to be as
close to what RedHat ships. As painful as that may be sometimes.
I'll look into getting a standard kernel.
>
> --
> Paul Kimoto
> This message was originally posted in plain text. Any images,
> hyperlinks, or the like shown here have been added without my
> consent, and may be a violation of international copyright law.
--
myke
------------------------------
Date: Thu, 21 Sep 2000 08:30:59 +0800
From: Subhachandra Chandra <[EMAIL PROTECTED]>
Crossposted-To: alt.os.linux,comp.os.linux.misc
Subject: Kernel Module Support: QM_SYMBOLS unknown error 263732004
I keep getting this error whenever I run most of the module utils.
# /sbin/insmod hello.o
insmod: kernel1: QM_SYMBOLS: Unknown error 263732004
# /sbin/ksyms
ksyms: kernel1: QM_SYMBOLS: Unknown error 263732004
I do have kernel support for modules turned on in the config file.
I built the kernel and the module (hello.o - from the guide on modules
at linuxdoc.org) using a cross-compiler for mips on an i386 box. The
kernel version is 2.4.0-test3. The module is part of an 8MB RamDisk
compiled with the kernel using initrd. This is the only module I am
trying to load. The kernel seems to work fine otherwise.
Has anyone seen similar errors before?
Thanks
Chandra
------------------------------
From: Yung-Hsiang Lu <[EMAIL PROTECTED]>
Subject: Re: How to add a system call
Date: 21 Sep 2000 01:25:49 GMT
check out
http://www.linuxdoc.org/LDP/lkmpg/node20.html
for experimenting new system calls
did you check whether printk goes to /var/log/messages?
Cleve <[EMAIL PROTECTED]> wrote:
: Can I add a system call by module? if yes, how can I achieve it?
: Besides, when I use printk in a module. It doesn't have any effect when
: I am using xterm in GNOME. But if I quit xwin and install that module
: again. It works well. Why?
: Thanks,
: Cleve.
--
Sincerely,
Yung-Hsiang Lu
[EMAIL PROTECTED]
------------------------------
From: Yung-Hsiang Lu <[EMAIL PROTECTED]>
Subject: how is a sleeping disk woken up?
Date: 21 Sep 2000 01:29:40 GMT
Hi,
I am curious how a sleeping disk is woken up. When I set the disk to
sleep after being idle for one minute (hdparm -S 12 /dev/hda1), the
disk will automatically wake up when necessary. Which part of the
kernel is responsible for this? I checked the fs/ and drivers/block
directories but did not find anything obvious.
Thanks!
--
Sincerely,
Yung-Hsiang Lu
[EMAIL PROTECTED]
------------------------------
From: "Richard Lim" <[EMAIL PROTECTED]>
Crossposted-To: comp.unix.programmer
Subject: how to send process to background and foreground using a system or lib
function?
Date: Thu, 21 Sep 2000 11:09:22 +0800
how to send process to background and foreground using a system or lib
function?
please advice.
regards,
richard lim
------------------------------
From: [EMAIL PROTECTED] (Derek M. Flynn)
Crossposted-To: comp.unix.programmer
Subject: Re: how to send process to background and foreground using a system or lib
function?
Date: Thu, 21 Sep 2000 03:59:52 GMT
Richard Lim wrote:
> how to send process to background and foreground using a system or lib
> function?
The "right way" to do this is with threads. But if you just want to start
something, then stop it, restart it, etc., you can fork and exec your new
process, and send STOP and CONT signals to it whenever you please.
------------------------------
From: Maciej Golebiewski <[EMAIL PROTECTED]>
Subject: Re: High precision timer needed
Date: Thu, 21 Sep 2000 09:36:14 +0200
Stefor-6 wrote:
>
> I'm looking for a timer function just like times(2), but with higher
> precision.
> As far as I know the kernel only keeps track of how many jiffies a
> process
> has used the processor, but that's not accurate enough. So I was
> thinking
> of augment the task_struct with a field that holds the clock cycle
> count for
> each process.
You can try my patch for getrusage - it does the modification to the
scheduler you were thinking about, and changes the resolution of the
time usage information returned by getrusage from the default (on Intel)
10ms to 1 us.
The sources I put on the web are for 2.2.5, but the modifications to the
kernel are minor so it should be straightforward to modify it for
newer kernels.
http://www.ccrl-nece.technopark.gmd.de/Research_Activities.html
The link to the patch is at the bottom of the page (Software Download).
HTH,
Maciej
------------------------------
From: Graeme Roy <[EMAIL PROTECTED]>
Subject: Re: Memprof -- lack of behavior.
Date: Thu, 21 Sep 2000 09:47:22 +0100
On Wed, 20 Sep 2000, Thaddeus L Olczyk wrote:
> >There are quite a lot of tools, a quick search should give you back tons
> >of them. My favourits are yamd and mpatrol (both are free), of course
> >they caught both leaks.
> >
> > ...
> >
> I hate to be picky, but is there one that can read the symbol tables,
> since I'm not very good at doing that myself :(
I don't know about YAMD, but mpatrol certainly can. It can also make use
of the BFD library to read the line number table in the executable if it
was compiled -g, so that you can have file/line information even if you
didn't include the header file and instead linked directly with the
library. It also has a memory profiler which will summarise the memory
allocations made and the leaks found at the end of execution - quite
similar to mprof by Ben Zorn which is not available on Linux.
Graeme.
------------------------------
** FOR YOUR REFERENCE **
The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:
Internet: [EMAIL PROTECTED]
You can send mail to the entire list (and comp.os.linux.development.system) via:
Internet: [EMAIL PROTECTED]
Linux may be obtained via one of these FTP sites:
ftp.funet.fi pub/Linux
tsx-11.mit.edu pub/linux
sunsite.unc.edu pub/Linux
End of Linux-Development-System Digest
******************************