Linux-Development-Sys Digest #389, Volume #8 Thu, 4 Jan 01 03:13:07 EST
Contents:
Re: Before I go bald... Socket problem!
BUF in LD (David)
Forcing a Core Dump (Marc Schneider)
Re: smp and gcc (Nix)
Re: Error compiling gcc 2.95.2 (Nix)
PrivateICE Linux system level symbolic source debugger ("Klaus Peter Gerlicher")
Re: Library dependencies (Nix)
mounting floppy ("Hung P. Tran")
Re: getpwuid() (mike harris)
Re: mounting floppy (Glitch)
How to write this kind of regular expression (InterFan)
Kernel Non-boot ("mpierce")
Linux system programming trainig (Hiroshi Motoyama)
Re: Library dependencies ("Fruitbat")
Re: Forcing a Core Dump ("S.L. Heggood")
Re: Forcing a Core Dump (Paul Sackun)
Linux macro function copy_to_user(to, from, len). ("Abel Gan")
Re: smp and gcc (Thaddeus L Olczyk)
Re: getpwuid() (Josef Moellers)
Re: mounting floppy (Eric)
Re: How to write this kind of regular expression (Josef Moellers)
GetTickCount() in Linux? ("Nils M. Lunde")
----------------------------------------------------------------------------
From: [EMAIL PROTECTED] ()
Crossposted-To:
alt.os.linux.redhat,comp.os.linux.development.apps,comp.os.linux.networking,linux.dev.apps,linux.dev.net,linux.redhat.devel
Subject: Re: Before I go bald... Socket problem!
Date: Wed, 03 Jan 2001 18:33:06 -0000
In article <[EMAIL PROTECTED]>,
Jem <[EMAIL PROTECTED]> wrote:
>Yeah thanks, as in my reply to ratz, I noticed AF_ROUTE DOES exist but
>none of the others do. I had searched... strangely though although I had
>found this using find, the KDE2 Find Files utility doesn't locate the
>file... Ah well, that's for another discussion, don't actually care much
>about that!
How did you search? I just tried another:
find /usr/include -name '*.h' |xargs grep ETHER_ADDR_LEN
(/usr/include/net/ethernet.h:#define ETHER_ADDR_LEN ETH_ALEN
/* size of ethernet addr */
--
http://www.spinics.net/linux
------------------------------
From: David <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: BUF in LD
Date: Thu, 04 Jan 2001 01:22:26 +0100
Hi. I have installed new XFree 4.0.2 (I have compiled it) with my
graphics card drivers (TNT2, so I have used glx-9_5 ...)
All works well, but when I have compiled my game (in development) I have
found this error (BUG?):
linux:/ELITE/WORKS/GAME # engine
BUG IN DYNAMIC LINKER ld.so: dl-version.c: 210: _dl_check_map_versions:
Assertion `needed != ((void *)0)' failed!
OK. I have two problems:
a) How Solve it.
b) who do I write to?
Thanks,
[EMAIL PROTECTED] wrote:
------------------------------
From: Marc Schneider <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Subject: Forcing a Core Dump
Date: Wed, 03 Jan 2001 22:28:50 GMT
I have a bug which is difficult to debug. I am getting intermitted
Segmentation Fault in my program. If I run the program in a debugger, it
doesn't segfault. I would like to force my program to dump core for all
segfaults. Is there an easy way to do this?
BTW, I'm running RH6.1 if that make a difference.
Marc
------------------------------
From: Nix <$}xinix{[email protected]>
Subject: Re: smp and gcc
Date: 03 Jan 2001 22:50:39 +0000
On 01 Jan 2001, Ronald Cole stated:
> I think there is a confusion. Parallelism is achieved through the use
> of threads, which is a library issue and not a compiler issue.
Not necessarily true. Vectorizing compilers (some were given earlier in
the thread by Pat Shelton) can decompose many common operations
(e.g. iterating over the elements of arrays) into parallel threads.
(Of course, this is never going to be as good as you could get by
discretizing your application into lots of pieces yourself, but it can
be *very* much less work.)
There has been some discussion about doing such optimizations in g95
(the under-construction pre-pre-pre-pre-alpha replacement for G77), but
I don't know if much has come of them (yet).
--
`Umbilical cords are weird squishy rubbery things.
Kinda like clams.' --- Dan Birchall in the Monastery
------------------------------
From: Nix <$}xinix{[email protected]>
Subject: Re: Error compiling gcc 2.95.2
Date: 03 Jan 2001 22:56:24 +0000
On Wed, 03 Jan 2001, Fruitbat gibbered:
> Has anyone successfully applied the glibc 2.2 patch to gcc 2.95.2? I
> have tried but it continually fails.
It certainly *should* work, if you mean the patch by Bruno Haible and
Jakub Jelinek from <http://clisp.cons.org/~haible/gcc-glibc-2.2-compat.diff>.
I have applied it without problems.
What problems are you seeing? `Continually fails' is not terribly
descriptive.
--
`Umbilical cords are weird squishy rubbery things.
Kinda like clams.' --- Dan Birchall in the Monastery
------------------------------
From: "Klaus Peter Gerlicher" <[EMAIL PROTECTED]>
Subject: PrivateICE Linux system level symbolic source debugger
Date: Thu, 4 Jan 2001 00:35:29 +0100
This is a multi-part message in MIME format.
=======_NextPart_000_000C_01C075E6.3D685730
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
PrivateICE Linux system level symbolic source debugger=20
the debugger that will create faster turnaround times when creating =
drivers for the LINUX operating system. Step through source code on a =
live system, stop system with a keystroke at any moment you want, see =
the inner workings of the LINUX kernel, see your hardware in realtime, =
find nasty bugs more easily, no need for printk()'s anymore. It's the =
SoftICE for LINUX. See for yourself, source code and binary is now =
available for the first time on =
http://www.sourceforge.net/projects/pice.=20
Want to help make this a great open source product, mail to =
[EMAIL PROTECTED]
=======_NextPart_000_000C_01C075E6.3D685730
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2920.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV>
<P align=3Dcenter><FONT face=3DArial size=3D2><STRONG><U>PrivateICE =
Linux system level=20
symbolic source debugger </U></STRONG></FONT></P>
<P><FONT face=3DArial size=3D2>the debugger that will create faster =
turnaround times=20
when creating drivers for the LINUX operating system. Step through =
source code=20
on a live system, stop system with a keystroke at any moment you want, =
see the=20
inner workings of the LINUX kernel, see your hardware in realtime, find =
nasty=20
bugs more easily, no need for printk()'s anymore. It's the SoftICE for =
LINUX.=20
See for yourself, </FONT><FONT face=3DArial size=3D2>source code and =
binary is now=20
available for the first time on </FONT><A=20
href=3D"http://www.sourceforge.net/projects/pice."><FONT face=3DArial=20
size=3D2>http://www.sourceforge.net/projects/pice.</FONT></A> </P>
<P>Want to help make this a great open source product, mail to <A=20
href=3D"mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</A></P></DIV>=
</BODY></HTML>
=======_NextPart_000_000C_01C075E6.3D685730==
------------------------------
From: Nix <$}xinix{[email protected]>
Subject: Re: Library dependencies
Date: 03 Jan 2001 23:11:04 +0000
On Wed, 03 Jan 2001, Fruitbat uttered the following:
> Does anyone know of a script or program that can be used to identify
> what programs use a particular library?
>
> I know ldd can be used on an executable file / library to list the
> dependencies for that file / library, but what I need is something
> when given a library name would list what uses the library.
>
> I realise this could probably done with a shell script, using ldd and
> grep and the like. Has someone developed such a script or program? I
> cant develop it myself if one doesn't exist as I am not a programmer
> or script writer, just a humble user interested in his system.
I use this piece of shell script when I need such things (e.g. when some
library that half the world uses suffers a binary-incompatible upgrade):
find / -perm +a+x -type f | xargs file | grep ELF |\
grep -E 'executable|shared object' | cut -d: -f1 | xargs ldd |\
awk 'BEGIN {lastline="";}
/:$/ {lastline=$0;}
/ncurses\.so\.5/ { if (lastline!=$0) { print lastline; } print $0; }'
Carriage returns optional; replace `ncurses\.so\.5' with a regexp that
matches the library name or names you're looking for.
Be warned, this is distinctly not fast, it needs to fork slightly more
than once for every binary on the system; you'll probably want to tee
the results somewhere to look at at leisure.
The above took less than three minutes to write when I needed it.
Shell scripts are wonderful things.
--
`Umbilical cords are weird squishy rubbery things.
Kinda like clams.' --- Dan Birchall in the Monastery
------------------------------
From: "Hung P. Tran" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.setup
Subject: mounting floppy
Date: Thu, 04 Jan 2001 00:46:31 GMT
I have a standard installation (using typical installation)
of Redhat Linux 6.1. I am having problem mounting floppy
drive. I tried:
mount -t msdos /dev/fd0 /mnt/floppy <RETURN>
and get the error: the kernel does NOT recognize /dev/fd0 as
a block device (may be 'insmod driver' ?)
Any idea ? It seems like the regular Redhat installation does
NOT include the floppy driver.
Please advice.
Thank you in advance,
hung
------------------------------
From: mike harris <[EMAIL PROTECTED]>
Subject: Re: getpwuid()
Date: Thu, 04 Jan 2001 00:48:32 GMT
Thanks Peter, but it still doesn't work
i've checked all that...
And.. i've tried tracing the call. But i'm not the best programmer ... and i cant
understand what that code is doing.
The Specific errors that are returned to me are: "passwd: Can not identify you!"
and shutdown: "You don't exist. Go away." (yes i'm serious about that one)
Everyone's help, is still appreciated,
mike
> Michael Harris <[EMAIL PROTECTED]> wrote:
> > I've traced the problem to a function called getpwuid() in the glibc library.
> > It's returning a NULL, instead of "struct passwd *"
>
> > I don't have a clue what the problem is, as the manpages only say that it
> > returns NULL in the event of an error. My configuration seems to be
> > complete, and all the libraries seem to be there.
>
> > Does anybody have any ideas?
>
> Strace the call.
>
> Probably you don't have host.conf, or nsswitch.conf or PAM.
>
> Peter
------------------------------
Date: Wed, 03 Jan 2001 20:11:09 -0500
From: Glitch <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.setup
Subject: Re: mounting floppy
"Hung P. Tran" wrote:
>
> I have a standard installation (using typical installation)
> of Redhat Linux 6.1. I am having problem mounting floppy
> drive. I tried:
>
> mount -t msdos /dev/fd0 /mnt/floppy <RETURN>
>
> and get the error: the kernel does NOT recognize /dev/fd0 as
> a block device (may be 'insmod driver' ?)
>
> Any idea ? It seems like the regular Redhat installation does
> NOT include the floppy driver.
>
> Please advice.
>
> Thank you in advance,
>
> hung
have you done a 'make xconfig' in /usr/src/linux to see if the current
configuration has floppy disk support built in? If not then i'd suggest
giving the kernel support.
u might look in /lib/modules/2.x.xx/ in one of the directories there (i
forget which one) to see if there is already a floppy module and if so
just insmod it.
------------------------------
From: [EMAIL PROTECTED] (InterFan)
Subject: How to write this kind of regular expression
Date: Thu, 04 Jan 2001 02:56:45 GMT
Reply-To: [EMAIL PROTECTED]
I want to substitute part of this kind of string :
HGSSI:MSISDN=msisdn,SS=ss[,BSG=bsg][,FNUM=fnum[,OFA=ofa][,TIME=time]]
string in '[]' is optional.
I want to use regular expression to deal with it. How to do ? thanks.
------------------------------
From: "mpierce" <[EMAIL PROTECTED]>
Subject: Kernel Non-boot
Date: Thu, 04 Jan 2001 04:00:44 GMT
Mandrake 7.2, kernel 2.2.17-21
Compiled new kernel-2.4.0-test12
Compiled & install modules - no runs, no drips, no errors.
Mv bzImage to vmlinuz-2.4.0-test12 to make a boot disk
Kernel size is in the middle of two kernels that boot (cannot use
vmlinuz-2.4.0-0.31mdk as I cannot get PCMCIA module to work)
-rw-r--r-- 1 root root 665029 Oct 5 22:24 vmlinuz-2.2.17-21mdk
-rw-r--r-- 1 root root 768494 Oct 10 21:56 vmlinuz-2.4.0-0.31mdk
-rw-r--r-- 1 root root 702409 Jan 5 01:01 vmlinuz-2.4.0-test12
When I try to boot vmlinuz-2.4.0-test12, it starts as normal and then...
Uncompressing linux ... OK, booting the kernel
System freezes at this point.
I've rebuilt it and tried everything w/o success.
Can anyone help?
Marvin
------------------------------
From: Hiroshi Motoyama <[EMAIL PROTECTED]>
Subject: Linux system programming trainig
Date: Thu, 04 Jan 2001 11:57:58 +0800
Reply-To: [EMAIL PROTECTED]
Hi ,
Anybody knows about linux training (device driver development and
system programming) in Singapore ?
------------------------------
From: "Fruitbat" <[EMAIL PROTECTED]>
Subject: Re: Library dependencies
Date: Thu, 04 Jan 2001 04:36:14 GMT
thanx,
I won't even pretend to understand it, I'll just use it :)
------------------------------
From: "S.L. Heggood" <$[EMAIL PROTECTED]>
Subject: Re: Forcing a Core Dump
Date: Thu, 4 Jan 2001 00:47:44 -0500
Check out the man page on the abort() system call.
-steve-
"Marc Schneider" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> I have a bug which is difficult to debug. I am getting intermitted
> Segmentation Fault in my program. If I run the program in a debugger, it
> doesn't segfault. I would like to force my program to dump core for all
> segfaults. Is there an easy way to do this?
>
> BTW, I'm running RH6.1 if that make a difference.
>
> Marc
------------------------------
From: [EMAIL PROTECTED] (Paul Sackun)
Subject: Re: Forcing a Core Dump
Reply-To: [EMAIL PROTECTED]
Date: Thu, 04 Jan 2001 06:03:25 GMT
In article <[EMAIL PROTECTED]>, Marc Schneider wrote:
>I have a bug which is difficult to debug. I am getting intermitted
>Segmentation Fault in my program. If I run the program in a debugger, it
>doesn't segfault. I would like to force my program to dump core for all
>segfaults. Is there an easy way to do this?
>
>BTW, I'm running RH6.1 if that make a difference.
>
>Marc
I'm running RH 5.2 and segfaults cause a coredump. For a core dump, you have to
have write access to the directory you are in and not have a ulimit that
prevents it. Often root does have this limitation for security reasons. (I
don't know how RH6.1 does it in particular.)
Anyways, you probably just don't have write access to the programs CWD.
Another thing you can do if for some reason RH6.1 doesn't coredump w/ segfaults
is create signal handler for SIGSEGV and have it call abort(3).
HTH.
--
One seldom sees a monument to a committee.
------------------------------
From: "Abel Gan" <[EMAIL PROTECTED]>
Subject: Linux macro function copy_to_user(to, from, len).
Date: Thu, 4 Jan 2001 14:48:21 +0800
**** Post for FREE via your newsreader at post.usenet.com ****
We are working on linux kernel's socket implementation. In particular, we
need
to replace the data within message header's buffer with our own newly
generated
data, and this is done in function inet_sendmsg(...) which is in
ipv4/af_inet.c. Since the data buffer within the message header, struct
msghdr * msg, are in the user space and our newly generated data are in
kernel space,
we can't just directly assign the values but have to use the kernel macro
copy_to_user(to, from, len). We have good reason to believe the killer of
our
extended linux kernel is this very function, it didn't work in the way we
understood, that is, copying len's bytes of data from the kennel area
pointed to by "from" to the user area pointed to by "to". To confirm our
conviction, we
have done the following experiment.
Within function inet_sendmsg in file af_inet.c, just before sending message
header to the tcp level:
sk->prot->sendmsg(sk, msg, size);
we replace all the data in the message header *msg (in user space) with a
character in kernel space like this:
char kchar = 'a';
...
for (i=0; i<msg->msg_iovlen; i++)
for (j=0; j<msg->msg_iov[i].iov_len; j++)
if (copy_to_user((char *)msg->msg_iov[i].iov_base+j, &kchar, 1))
printk("Failed copy!\n");
return sk->prot->sendmsg(sk, msg, size);
...
Should it work, whatever we send using socket, we will receive a string with
all 'a's and never print "Failed copy!". But actually it worked just the
opposite way: the old message is not replaced and for each character
transmitted we saw an output line "Failed copy!". What is wrong!
The perplexed us ask for your comments and help.
Thank you.
Lee Tong, Abel Gan.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
*** Usenet.com - The #1 Usenet Newsgroup Service on The Planet! ***
http://www.usenet.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
------------------------------
From: [EMAIL PROTECTED] (Thaddeus L Olczyk)
Subject: Re: smp and gcc
Date: Thu, 04 Jan 2001 06:42:28 GMT
Reply-To: [EMAIL PROTECTED]
On Fri, 29 Dec 2000 18:56:42 GMT, [EMAIL PROTECTED] (Kaz
Kylheku) wrote:
>On Fri, 29 Dec 2000 19:39:19 +0100, Japie <[EMAIL PROTECTED]> wrote:
>>Hello
>>
>>I have a dual celeron board and I recently build gcc and make on it.
>>They (and other apps) gave me the message that I have a
>>i686-pc-linux-blah,blah.
>>But is it possible to build programs special for smp?
>>I can't find that anyware.
>
>You have to use threads, processes, or else a special compiler that can
>parallelize language-level constructs such as multi-dimensional loops,
>using threads underneath. I don't know of such things being available
>for Linux, and really they are only suitable for number crunching
>applications, rather than arbitrary uses of parallelism. Your best bet
>is to learn how to use threads, or to architect your application
>such that it's divided into multiple processes.
Is there a way of setting affinities in gcc?
------------------------------
From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: getpwuid()
Date: Thu, 04 Jan 2001 08:43:08 +0100
mike harris wrote:
> =
> Thanks Peter, but it still doesn't work
> i've checked all that...
> And.. i've tried tracing the call. But i'm not the best programmer ...=
and i cant
> =
> understand what that code is doing.
> =
> The Specific errors that are returned to me are: "passwd: Can not ident=
ify you!"
> and shutdown: "You don't exist. Go away." (yes i'm serious about that o=
ne)
This error means that you are using a user id which can't be resolved by
getpwuid, i.e. which doesn't exist in whatever database getpwuid looks,
e.g. /etc/passwd.
-- =
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize (T. Pratchett)
------------------------------
From: Eric <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.setup
Subject: Re: mounting floppy
Date: Thu, 04 Jan 2001 08:45:25 +0100
Reply-To: [EMAIL PROTECTED]
Hung P. Tran wrote:
>
> I have a standard installation (using typical installation)
> of Redhat Linux 6.1. I am having problem mounting floppy
> drive. I tried:
>
> mount -t msdos /dev/fd0 /mnt/floppy <RETURN>
>
> and get the error: the kernel does NOT recognize /dev/fd0 as
> a block device (may be 'insmod driver' ?)
>
> Any idea ? It seems like the regular Redhat installation does
> NOT include the floppy driver.
>
ls -l /dev/fd0
should return:
brw-rw---- 1 root floppy 2, 0 May 5 1998 /dev/fd0
Pay specific attention to the 'b' the line starts with and the major and
minor numbers. If this differs, become root and run:
`cd /dev && rm -f fd0 && ./MAKEDEV fd0`
Eric
------------------------------
From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: How to write this kind of regular expression
Date: Thu, 04 Jan 2001 08:45:31 +0100
InterFan wrote:
> =
> I want to substitute part of this kind of string :
> HGSSI:MSISDN=3Dmsisdn,SS=3Dss[,BSG=3Dbsg][,FNUM=3Dfnum[,OFA=3Dofa][,TIM=
E=3Dtime]]
> =
> string in '[]' is optional.
> =
> I want to use regular expression to deal with it. How to do ? thanks.
With such an unspecific question, "use sed" would be my answer.
-- =
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize (T. Pratchett)
------------------------------
From: "Nils M. Lunde" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: GetTickCount() in Linux?
Date: Thu, 4 Jan 2001 09:00:24 +0100
Hi.
I need to know the time used by a certain part of a program.
In MS Windows I use the GetTickCount() function.
This function does not tend to exist in Linux, so I wonder what I should
do!?
I've taken a look at the getrusage() function, but this function does not
seem to count the time actually used by the program;
if I use the sleep() function in the program, for example, this will not
make any difference on the time used.
I've also checked out the gettimeofday() function, but this seems to have a
rather large system overhead + it is a problem when the time used exceeds 24
hours.
The only thing that seems to work is so-called jiffies, but these are only
available in kernel mode.
Isn't there a way to do this in user-mode?
Thanks,
Nils Magne
------------------------------
** 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 by posting to the
comp.os.linux.development.system newsgroup.
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
******************************