Linux-Development-Sys Digest #273, Volume #8 Sun, 12 Nov 00 14:13:07 EST
Contents:
Re: Socket accept signedness in G++ (Kaz Kylheku)
Re: Socket accept signedness in G++ (Kaz Kylheku)
No swap activity. ("Patrick \"The King of Finchland\" Finch")
Re: Most popular Linux development environment(s)? Graphical? ("Bear_Man")
ntpd hung my system... (Wouter Verhelst)
Re: ntpd hung my system... (Wouter Verhelst)
Re: Most popular Linux development environment(s)? Graphical? ([EMAIL PROTECTED])
Re: Raw block device interface ([EMAIL PROTECTED])
Re: No swap activity. (Paul Kimoto)
Re: No swap activity. (Todd Knarr)
Re: No swap activity. (Wouter Verhelst)
----------------------------------------------------------------------------
From: [EMAIL PROTECTED] (Kaz Kylheku)
Crossposted-To: comp.os.linux.development
Subject: Re: Socket accept signedness in G++
Reply-To: [EMAIL PROTECTED]
Date: Sun, 12 Nov 2000 04:43:59 GMT
On 12 Nov 2000 00:33:08 GMT, Juergen Heinzl <[EMAIL PROTECTED]>
wrote:
>In article <[EMAIL PROTECTED]>, Kaz Kylheku wrote:
>>On 11 Nov 2000 00:10:47 GMT, Juergen Heinzl <[EMAIL PROTECTED]>
>>wrote:
>>>In article <[EMAIL PROTECTED]>, Kaz Kylheku wrote:
>>>>On Fri, 10 Nov 2000 18:22:02 +0000, Christoper McClan <[EMAIL PROTECTED]>
>>>>wrote:
>>>>>
>>>>>I'm doing some fairly standard socket programming, and one piece of
>>>>>code contains the line :
>>>>>
>>>>>client_sockfd = accept(server_sockfd,(struct sockaddr *)&client_address\
>>>>>, &client_len);
>>>>>
>>>>>The variables and such are defined as you would expect. It compiles
>>>>>fine with gcc, but when compiling with g++, I get the following error :
>>>>
>>>>If by ``compile fine'' you mean ``I get a few warnings related to ANSI C
>>>>constraint rule violations, but I will ignore them''. ;)
>>>>
>>>>>server.c: In function `int main()':
>>>>>server.c:40: passing `int *' as argument 3 of `accept(int, sockaddr *\
>>>>>, socklen_t *)' changes signedness
>>>>>
>>>>>(Obviously I have inserted the '\' character).
>>>>>
>>>>>Any ideas?
>>>>
>>>>Yes, you must pass a ``socklen_t *'' value as the third argument. The Single
>>>>UNIX specification has introduced this absurd ``socklen_t'' type which
>>>>represents the length of an address, and required that it must be some unsigned
>>>>type, thus breaking all legacy code which uses the type int.
>>>[-]
>>>I've seen machines where socklen_t can be 4 *or* 8 byte, depending on
>>>how you compile the code and for reasons.
>>
>>Or, more likely, the type int can be 4 or 8 bytes, with socklent_t probably
>>having to be defined so that its size stays the same for the ABI? Is
>>that what you are thinking of?
>[-]
>
>I'm thinking of not caring what size socklen_t is compared to the size
>of an int and no, it does not need to have the same size.
>
>Using int and thinking it'd be okay is an assumptions -- computers are
>stupid though, they don't like assumptions.
Then why don't we have a typedef for POSIX file descriptors instead of using
int? Why don't we have an argcount_t symbol for argc in the main() function?
The answer is that for some things you just don't need to create useless,
phony abstractions.
If you want to represent the size of an object, C gives you a type: size_t.
It would have made sense to use a pointer to size_t as the third parameter of
accept() rather than inventing yet another way to specify sizes.
Here is a question: why is it okay to use an ``int *'' in the interface
of pthread_attr_getschedpolicy? Why doesn't it suffer from the same ailment
that accept() was diagnosed with, and thus require the same cure?
>>>socklen_t isn't that absurd even though people love to say so (gracefully
>>>ignoring Linus' opinion regarding socklen_t here, yep).
>>
>>It's absurd because
>>
>>- the standard requires it to be unsigned, whereas all traditional UNIX
>> code uses the type int. Without that requirement, implementors could just
>> typedef int socklen_t, should they wish to do so.
>[-]
>Never mind, so we ought to use K&R C because ANSI or C99 breaks traditional
>code ?
ANSI C and C99 plug holes in useful ways. For example C99 no longer allows
implicit function declarations, and implicit int. This breaks legacy programs
which are of a dubious quality. And note that these features were made
obsolescent first! Whereas I'm not aware that the change to accept's interface
was preceded by an obsolescence phase; it was just dumped on programmers.
There is nothing dubious about using ``int *'' as the third parameter of
accept(). It's a perfectly safe, well-understood interface that was granted and
then gratuitously broken, probably because some vendor had some stupid problem
and wanted to make it everyone else's.
>>- you don't need a big honking typedef to represent the length of something
>> that is unlikely to ever reach a two digit figure in the forseeable future.
>[-]
>I don't care what size socklen_t is of in an actual implementation, really.
Equally, I don't care what the size of int is on an actual implementation. But
I know that if I declare one of these puppies, I can call
pthread_attr_getschedparam to store something in it and it will work
in all kinds of POSIX environments.
>>- As a source level construct, it does nothing for binary compatibility. E.g.
>> 32 bit *binary* applications, perhaps compiled even before socklen_t
>> existed, running over a 64 bit library and kernel.
>[-]
>A 32 bit binary may be compiled to use a 64 bit socklen_t -- there goes
>your "int is fine" in new code.
If that 32 bit binary uses int *, then it won't necessarily compile because
of the interface change.
I'm talking about old binaries that are *not* recompiled, and which
therefore depend on the old ABI of accept, pthread_attr_getschedparam
and other functions, which use pointers to 32 bit objects.
If these binaries can continue to function, then so can newly written code
which makes the same assumption. Thus a compiler switch can be provided to
support this new code, or new builds of old code: the switch makes int 32 bits
wide, and links in the appropriate library whose accept() and
pthread_attr_getschedparam() store a 4 byte object through the int *.
Without that compiler switch, int is made 64 bits wide, and again
an appropriate library is linked in which these functions store
an 8 byte object.
Why would I want to vary the representation of socklen_t independently
of which ABI I'm using, and why don't I get that flexibility with
every single type that the library uses?
``I want the new ABI, but give me a switch to use the struct termios layout
from the old ABI, please. Oh and make socklen_t new, but struct sockaddr_in
old.''. ;)
This sort of mixing and matching is absurd.
>>- It's just a hack for brain-damaged code that assumes sizeof(int) == 4,
>> and must be translated with a special compiler mode which makes the
>> compiler incompatible with any library interface that uses naked int,
>> or at least pointers thereto.
>[-]
>There's a lot of traditional code that assumes sizeof(int) to be 4 I dare
>say but I do agree, it's brain damaged code but okay, it's the way it is
>and tons of new code are being written along that line every day.
But socklen_t will not solve the vast majority of problems that that code
will have. The assumptions on sizeof(int) == 4 are quite likely elsewhere,
not in innocent, previously perfectly corret code which does this:
int len;
/*...*/
accept(/*...*/, &len);
If int changes to 64 bit, this can be recompiled. Once compiled, either way,
the binary code has a frozen assumption about the size that the library must
meet so long as that binary continues to be supported. In a migration from one
ABI to another, the source level construct socklen_t won't solve the issue of
having to support binaries that use either of two ABI's.
>> A better solution to that is to provide a whole set of 32 bit legacy
>> libraries, perhaps derived from earlier versions of the OS,
>> and not bother maintaining them. When compiling in the brain-damaged mode,
>> those obsolescent libraries are used. Eventually they are removed
>> and everyone has to learn to program without dependencies on sizeof (int).
>[-]
>You don't need such libraries on systems that support versioning like
>Solaris or Linux nowadays, so problem solved as far as old binaries are
>concerned. At least for some time into the future, that is.
Well, you'd have to version a heck of a lot of symbols and end up with a
bloated library. You will find that the GNU libc developers, for instance, are
quite resistant to adding any new versioned symbols. It is done only when
absolutely necessary. I remember submitting one patch not long ago, upon which
was told to fix it to use spare bits in an existing struct member rather than
extend it with a new member and add versioning to a couple of functions.
Versioning adds bloat because you have both versions of the same function in
the same module. Unless they are rearranged in the linker, you degrade the
locality of reference; more pages of the resulting have to be faulted in.
Moreover, if both versions of the function are in the same codebase, things get
messy. Every type is declared twice for each ABI. I suspect that symbol
versioning isn't really suitable for wholesale ABI migration.
------------------------------
From: [EMAIL PROTECTED] (Kaz Kylheku)
Crossposted-To: comp.os.linux.development
Subject: Re: Socket accept signedness in G++
Reply-To: [EMAIL PROTECTED]
Date: Sun, 12 Nov 2000 04:45:45 GMT
On 12 Nov 2000 00:33:14 GMT, Juergen Heinzl <[EMAIL PROTECTED]>
wrote:
>Sorry, but if one cannot give it a value then socklen_t would not
>be usable at all. I've written code using socklen_t not only on
>Linux and can assure you giving it a value using sizeof() always
>compiled and worked like a charm.
Why wouldn't it? Name one C integral type, signed or unsigned, (other than a
bitfield) which cannot represent the size of a network address. Your choice of
network, but it has to exist. ;)
------------------------------
From: "Patrick \"The King of Finchland\" Finch" <[EMAIL PROTECTED]>
Subject: No swap activity.
Date: Sun, 12 Nov 2000 02:01:10 -0800
Howdy all
Well, heres the problem
My linux box won't swap. This is actually getting me kinda worried.
Anyway, here is the history.
Hardware--
Compaq Proliant 2500R
512 M RAM
3 9.1 gig scsi drives (the hot pluggables)
no "internal" storage
Dual PPro 200
no hot spare yet.....
2.4.0-test10
software RAID 5
/ and /boot are on one disk, taking up 256 M of space.
I have the other two disks configured with a 256 M swap partition each. In
the fstab they are set as
/dev/sdc6 swap swap defaults,pri=1 0 0
/dev/sdb6 swap swap defaults,pri=1 0 0
Now, no matter what I can't get this box to utilize any swap.
I tried creating a swap file in /tmp, but it wouldn't swap to that
either.....
The logs don't seem to say anything, though I am not sure what to look for.
However, i suspect this has been causing some system crashes. I had apache
configured with the MaxClients = 120, then I realized that this machine
wasn't swapping, and 120 instances of apache would use up all of it's
memory...
anyway, have any of you ever seen a problem like this?
I would be very happy if the machine would just swap when it has to....
Thanks
pat
------------------------------
From: "Bear_Man" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Most popular Linux development environment(s)? Graphical?
Date: Sun, 12 Nov 2000 06:12:50 -0500
Where can I obtain a copy KDevelop? How much does it cost?
I am considering writting a very large application for the mental health
industry, and one of the platforms I would like my software to run on is
Linux.
Thanks
Kevin
"Charles Doty" <[EMAIL PROTECTED]> wrote in message
news:8ucp7i$1fuj3$[EMAIL PROTECTED]...
> > I'm thinking of switching from mac to Linux. If I did, what programming
> > setup would I likely find myself using? Gnu? Is there anything with a
> > graphical interface, esp. for the debugger, as in Codewarrior, where you
> > see a window containg your code and you can clearly mark breakpoints and
> > follow the program counter steping through your code? With windows for
> > variables, stack tracing, etc.?
>
> I just started using KDevelop (1.2), and am very happy with it. I've
> programmed under Codewarrior, and MSDev environments. KDevelop is very
close
> to these..
> You're also not limited to KDE applications. And, yep the debugger in
> integrated into the IDE..
>
> Switching to KDevelop was a lot like switching from MSDev 4.x to MSDev
> 5.0(6.0)
>
> Once KDevelop has searchable documentation for X Windows, it'll be an
> excellent environment.
>
>
> --
> * Kokopeli:
> * ...when he left, the crops were plentiful and all the women were
pregnant.
>
>
>
------------------------------
From: Wouter Verhelst <[EMAIL PROTECTED]>
Subject: ntpd hung my system...
Date: Sun, 12 Nov 2000 12:03:21 GMT
Seems a little bit odd, but...
I am running a self-compiled linux-kernel on my masq-gateway. On this gateway,
along a number of other applications, there is also ntpd. However, when I
first tried to boot my system after compiling my kernel, it just sat there,
doing nothing -- not even replying to a ping or something similar.
A bit of experimenting with my system (I compiled another kernel, this time
including Virtual Console support ;-) showed that it hung right after ntpd was
started. At that moment, I got no response anymore -- at all. No reply to the
keyboard, no reply to pings, just nothing. My first idea was that something
went wrong after the last reboot (I had a forced reboot because of a power
failure), so I copied ntpd to a save place and let apt-get remove and then
install it.
I was surprised that the problem still existed. I thought that I probably
forgot to compile something in my kernel, and that ntpd was waiting for
a timeout to occur. But I've let my system running for about 24 hours, and
there's still no change, which makes me think that this is a kernel-bug.
That's what brings me to you guys. I do not have the knowledge to hunt down
this bug, especially not since there's no information at all -- no panic or
oops, I just get no reaction anymore. However, I think this may be a security
issue (It's not because ntpd is ran as root, that no other application can
hang this system the same way...)
I'll upload the .config I used to compile my kernel, to give you guys at
at least a starting point. If there's more information to be needed, let
me know.
Or if this is an issue already widely known, let me know too ;-)
BTW: The system is a Cyrix 486 DLC, while the kernel version I run is a 2.2.17
------------------------------
From: Wouter Verhelst <[EMAIL PROTECTED]>
Subject: Re: ntpd hung my system...
Date: Sun, 12 Nov 2000 12:09:12 GMT
> I'll upload the .config I used ...
I just realized that I forgot to tell *where* I would upload them ;-)
You can find it here: users.pandora.be/wouter.verhelst/.config
------------------------------
From: [EMAIL PROTECTED]
Subject: Re: Most popular Linux development environment(s)? Graphical?
Crossposted-To: comp.os.linux.development.apps
Date: Sun, 12 Nov 2000 15:43:59 GMT
"Bear_Man" <[EMAIL PROTECTED]> writes:
> Where can I obtain a copy KDevelop? How much does it cost?
The "home site" for it is <http://www.kdevelop.org/>, and as it is
released under the GNU GPL, there is not forcibly any cost you _have_
to pay.
On the other hand, there are obviously costs to its production, at
least vis-a-vis the expenditure of developers' time. If you wish to
help sponsor its development, see the KDevelop "Sponsor Page" at
<http://www.kdevelop.org/index.html?filename=sponsors.html>.
--
(concatenate 'string "cbbrowne" "@hex.net")
<http://www.ntlug.org/~cbbrowne/lsf.html>
Rules of the Evil Overlord #8. "After I kidnap the beautiful
princess, we will be married immediately in a quiet civil ceremony,
not a lavish spectacle in three weeks' time during which the final
phase of my plan will be carried out." <http://www.eviloverlord.com/>
------------------------------
From: [EMAIL PROTECTED]
Subject: Re: Raw block device interface
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.misc
Date: Sun, 12 Nov 2000 15:47:26 GMT
Ronald Cole <[EMAIL PROTECTED]> writes:
> Manoj Patil <[EMAIL PROTECTED]> writes:
> > Is raw interface available in linux for block devices ?
>
> I think you mean: "Is a character device available for hard drives"?
I think the way it was said was reasonably well-put.
> > I have a partition and need to access it through a raw interface.
> > Basically the aim of my program is to bypass the buffer cache and be
> > assured that every read/write operation results into disk activity.
>
> I fancied a post where it seemed that someone was able to do it with
> RedHat 7.0. I didn't see it in the docs and I haven't had time to
> look into it yet, but Stephen Tweedie's raw disk I/O may be there.
Here are some pretty relevant links:
<http://lwn.net/1999/0729/a/sct-raw.html>
<ftp://ftp.linux.org.uk/pub/linux/sct/fs/profiling/sard-0.6.tar.gz>
<http://howto.tucows.com/man/man8/raw.8.html>
--
(concatenate 'string "cbbrowne" "@hex.net") <http://www.ntlug.org/~cbbrowne/>
Rules of the Evil Overlord #130. "All members of my Legions of Terror
will have professionally tailored uniforms. If the hero knocks a
soldier unconscious and steals the uniform, the poor fit will give him
away." <http://www.eviloverlord.com/>
------------------------------
From: [EMAIL PROTECTED] (Paul Kimoto)
Subject: Re: No swap activity.
Date: 12 Nov 2000 11:02:11 -0500
Reply-To: [EMAIL PROTECTED]
In article <8ulp6j$74j7$[EMAIL PROTECTED]>,
Patrick \"The King of Finchland\" Finch wrote:
> My linux box won't swap. This is actually getting me kinda worried.
> Anyway, here is the history.
>
> Hardware--
> Compaq Proliant 2500R
> 512 M RAM
> 3 9.1 gig scsi drives (the hot pluggables)
> no "internal" storage
> Dual PPro 200
> no hot spare yet.....
> 2.4.0-test10
(Hmm, 2.4.* doesn't seem to swap quite as much as 2.2.*.)
> software RAID 5
>
> / and /boot are on one disk, taking up 256 M of space.
> I have the other two disks configured with a 256 M swap partition each. In
> the fstab they are set as
> /dev/sdc6 swap swap defaults,pri=1 0 0
> /dev/sdb6 swap swap defaults,pri=1 0 0
Shouldn't there be a second column (mount point) saying something like
"none"?
> Now, no matter what I can't get this box to utilize any swap.
What does /proc/swaps tell you?
--
Paul Kimoto
This message was originally posted on Usenet 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.
------------------------------
From: Todd Knarr <[EMAIL PROTECTED]>
Subject: Re: No swap activity.
Date: 12 Nov 2000 18:42:05 GMT
In comp.os.linux.development.system <[EMAIL PROTECTED]> Paul
Kimoto <[EMAIL PROTECTED]> wrote:
>> /dev/sdc6 swap swap defaults,pri=1 0 0
>> /dev/sdb6 swap swap defaults,pri=1 0 0
> Shouldn't there be a second column (mount point) saying something like
> "none"?
Nope. His file matches mine, save that where he's got "defaults" on the
lines, I've got "sw". That shouldn't make a difference.
--
All I want out of the Universe is 10 minutes with the source code and
a quick recompile.
-- unknown
------------------------------
From: [EMAIL PROTECTED] (Wouter Verhelst)
Subject: Re: No swap activity.
Date: Sun, 12 Nov 2000 18:54:32 GMT
In article <8ulp6j$74j7$[EMAIL PROTECTED]>,
"Patrick \"The King of Finchland\" Finch" <[EMAIL PROTECTED]> writes:
> Howdy all
>
> Well, heres the problem
>
> My linux box won't swap. This is actually getting me kinda worried.
> Anyway, here is the history.
>
> Hardware--
> Compaq Proliant 2500R
> 512 M RAM
> 3 9.1 gig scsi drives (the hot pluggables)
Wild guess:
Is it possible that swapspace needs to be on disks that are *NOT* hot
pluggable?
I wouldn't know, I don't have hot pluggable hardware ;-)
<snip>
HTH, HAND
--
wouter punt verhelst op advalvas in Belgi�
7:53pm up 5:57, 2 users, load average: 1.03, 1.06, 1.13
Voor een vertaling van Documentation/Configure.help naar het Nederlands:
http://users.pandora.be/wouter.verhelst/configure.html
"You don't go out and kick a mad dog. If you have a mad dog with rabies, you
take a gun and shoot him."
-- Pat Robertson, TV Evangelist, about Muammar Kadhafy
------------------------------
** 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
******************************