Subject: Linux-Development Digest #152
From: Digestifier <Linux-Development-Request@senator-bedfellow.MIT.EDU>
To: Linux-Development@senator-bedfellow.MIT.EDU
Reply-To: Linux-Development@senator-bedfellow.MIT.EDU
Date:     Sun, 10 Oct 93 00:13:10 EDT

Linux-Development Digest #152, Volume #1         Sun, 10 Oct 93 00:13:10 EDT

Contents:
  NO QUESTIONS HERE PLEASE / RTF FAQ (Re: -m486 doing nothing?) (Ian Jackson)
  Re: GCC and structure field alignment (Fergus James HENDERSON)
  Setting up Linux (Pete Deuel)
  Re: possible bug in virtual console switching (Curt L. Olson (Admin))
  gcc on Linux acts wierdly compared to SUN (Dhaliwal Bikram Singh)
  Re: Setting up Linux (Byron A Jeff)
  Re: Linux Slowly Dying Off? (The Fool)
  Re: Shm extension to X (Helmut Geyer)
  Re: CFC/CFI: XSysadmin (Kevin Fluet)
  Re: NO QUESTIONS HERE PLEASE / RTF FAQ (Re: -m486 doing nothing?) (Stefan Lukka)
  Re: gcc on Linux acts wierdly compared to SUN (Dhaliwal Bikram Singh)
  Re: NO QUESTIONS HERE PLEASE / RTF FAQ (Re: -m486 doing nothing?) (rich@mulvey.com)

----------------------------------------------------------------------------

From: iwj10@cus.cam.ac.uk (Ian Jackson)
Subject: NO QUESTIONS HERE PLEASE / RTF FAQ (Re: -m486 doing nothing?)
Date: Sat, 9 Oct 1993 16:13:23 GMT

In article <CEKnos.7Hy@sparc15.cs.cuhk.hk>,
Savio Lam <lam836@cs.cuhk.hk> wrote:
>        I just got POV-Ray 2.0 source from sunsite.unc.edu and compiled
>with '-O2 -m486'. I compared the binaries I compiled with the ones that
>come with the binary distribution (which are supposed to be compiled
>without using -m486) but found that they are the same! So I recompiled
>with only '-O2' and compared these with the ones I compiled early with
>'-O2 -m486' and they are the same! I tried with selection 1.5 and found
>the same result. Is there something wrong?

This is answered in the FAQ, Q5.3, and should not have been posted
here anyway.

Please DO NOT POST QUESTIONS TO THIS GROUP and READ THE FAQ AND THE
HOWTOS BEFORE POSTING.

>##############################################################################
>#                                 |        _                                 #
># ------------------------------- |      _| |_                               #
># Lam Lai Yin, Savio              |     |_   _|                              #
>#                                 |       | |                                #
># Internet: lam836@cs.cuhk.hk     |     /     \     Can't live with DOS?     #
># Department of Computer Science  |    |  DOS  |                             #
># Chinese University of Hong Kong |    |       |    Try Linux...             #
># ------------------------------- |    |       |                             #
>#                                 |  ^^^^^^^^^^^^^                           #
>##############################################################################

This signature is WAY over the top.  Please go and read
news.announce.newusers.  Your signature should be 4 lines or
(preferably) less; large graphics are a bad idea.

-- 
Ian Jackson, at home  <ijackson@nyx.cs.du.edu> or <iwj10@cus.cam.ac.uk>
PGP2 public key available on server.  Urgent email: <iwj10@phx.cam.ac.uk>
2 Lexington Close, Cambridge, CB4 3LS, England;  phone: +44 223 64238

------------------------------

From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON)
Subject: Re: GCC and structure field alignment
Date: Sat, 9 Oct 1993 17:40:31 GMT

bazyar@mrcnext.cso.uiuc.edu (Jawaid Bazyar) writes:

>I'm trying to create the following structure:
>
>struct foo {
>  unsigned char a; // 1 byte
>  unsigned b : 4; // 4 bits
>  unsigned c : 4; // 4 bits
>  unsigned long d; // 4 bytes
>}
>
>For a total of 6 bytes. Unfortunately, gcc is insisting on aligning
>the various fields to at least two bytes (a and b/c are being aligned
>on word boundaries, I believe).

I suspect that d is being aligned to a 4-byte boundary.
Try the following:
        struct foo {
          unsigned char a; // 1 byte
          unsigned b : 4; // 4 bits
          unsigned c : 4; // 4 bits
          unsigned long d __attribute__((packed)); // 4 bytes, not aligned
        }

>This wouldn't be a big deal if THE GCC MANPAGE LISTED THE 80X86 OPTIONS
>FOR GCC!! 

From the gcc manpage:

     WARNING
          The information in this man page is an extract from the full
          documentation of the GNU C compiler, and is limited to the
          meaning of the options.  This man page is not kept up to
          date except when volunteers want to maintain it.

          For complete and current documentation, refer to the Info
          file `gcc' or the manual Using and Porting GNU CC (for
          version 2.0).  Both are made from the Texinfo source file
          gcc.texinfo.

__attribute__ is quite well documented in the gcc info file.

-- 
Fergus Henderson                     fjh@munta.cs.mu.OZ.AU

------------------------------

From: deuelpm@craft.camp.clarkson.edu (Pete Deuel)
Subject: Setting up Linux
Date: Sat, 9 Oct 1993 17:34:46 GMT

        I have some research that I'd like to do in a Unix environment.
Linux seems the perfect choice.  Basically, I need the PC computer I have
to mimic a workstation; that is, I'll need X-windows, network connection,
and so forth...  and of course, like in any other Unix environment, I'll
need a C compiler...

        Some questions (PLEASE point me at a FAQ if appropriate):

        1. Who are the developers of Linux?  What is different about
these "distributers" and what is their role?  (Basically, if I have 
troubles, I need a guru to hold my hand and give me guidance.)

        2.  For the workstation/server I want to set up, what would make
up a "kit"?  That is, give me a grocery list of stuff I need to find on
the net...  Where to get this "Xfree86" and so forth...  (I prefer going
to the source for this stuff, rather than a commonly frequented hub
(like wuarchive).)


        Please E-mail or post answers (E-mail preferred, as I can't
always depend on our news expiration date).


AdThanksVance,


Pete
deuelpm@craft.camp.clarkson.edu

--
=====================================
deuelpm@craft.camp.clarkson.edu
=====================================
"*Regret* is a rough sheet to sleep on."  -Herman Brooks

------------------------------

From: clolson@me.umn.edu (Curt L. Olson (Admin))
Subject: Re: possible bug in virtual console switching
Date: Sat, 9 Oct 1993 18:59:09 GMT

rxg@cci.com (Rob Getter) writes:

>I have .99p13 with gcc 2.4.5 and the latest shared libraries, (not alpha)
>when I run startx (Xfree86 1.3) Xwindows comes up fine, but if I switch
>to another virtual console (using alt-ctrl-f?) sometimes typing on the
>keyboard gives me confusing results. some keys do nothing, others do something
>every other keypress, and others beep. If I switch to another text VC and
>back, it is back to normal. I don't know whether this is in .99p12 since I
>jumped from .99p11 to .99p13.
>Rob Getter

I have basically the same software configuration (from Slackware 1.03) and
am experiencing the exact same symptoms ...  It is not a terrible problem,
but obviously something is not quite right.

Curt.
--
Curtis Olson                                            clolson@me.umn.edu

Eliminate theft:  the government can't stand the competition.        .
Try Linux ... if you own a [34]86.  If you own a mac ... :(      \__[0]__/

------------------------------

From: a228dhal@cdf.toronto.edu (Dhaliwal Bikram Singh)
Subject: gcc on Linux acts wierdly compared to SUN
Date: Sat, 9 Oct 1993 19:09:02 GMT

I am doing a program that requires heavy use of linked lists.  We
are running gcc on our SUN IPC's at school, I have had no problems
compiling and getting expected results from this setup.  Except it is
when I try to compile the same program at home that I get results that
I can't figure out.

ie: a call of the function
FindTwoSmallest(node **p);

in the program is call it by : FindTwoSmallest(&node)

it should respond by printing the elements of the data structure
like the version on the Sun did, however it looks to me like it actually
printing the memory addresses in decimal.  

I am sorry that I am not that descriptive, I can't get cut and paste
to work between my xterm and the program I am using to log onto the 
schools computer (minicom in an xterm, another question).

Should I upgrade my version of gcc?  It is the distribution that came
with the 99pl10 release (I think).
. 


-- 
========================
a228dhal@cdf.toronto.edu
Bikram Dhaliwal
(416) 845-4567

------------------------------

From: byron@cc.gatech.edu (Byron A Jeff)
Subject: Re: Setting up Linux
Date: Sat, 9 Oct 1993 20:14:05 GMT

In article <deuelpm.750188086@craft.camp.clarkson.edu>,
Pete Deuel <deuelpm@craft.camp.clarkson.edu> wrote:
>       I have some research that I'd like to do in a Unix environment.
>Linux seems the perfect choice.  Basically, I need the PC computer I have
>to mimic a workstation; that is, I'll need X-windows, network connection,
>and so forth...  and of course, like in any other Unix environment, I'll
>need a C compiler...

Linux does all of these. No problem.

>
>       Some questions (PLEASE point me at a FAQ if appropriate):
>
>       1. Who are the developers of Linux?  What is different about
>these "distributers" and what is their role?  (Basically, if I have 
>troubles, I need a guru to hold my hand and give me guidance.)

The net is the best resource for this. Generally when you post just like you
did someone will come up with an answer. Of course long time intimate hand
holding will probably cost ;-)

>
>       2.  For the workstation/server I want to set up, what would make
>up a "kit"?  That is, give me a grocery list of stuff I need to find on
>the net...  Where to get this "Xfree86" and so forth...  (I prefer going
>to the source for this stuff, rather than a commonly frequented hub
>(like wuarchive).)

Best bet is to get a distribution. Generally it'll have everything you need.
These are the five major distributions:

1) Slackware - my favorite: at ftp.cdrom.com:/pub/linux/slackware Look for 
   version 1.0.4
2) MCC - from the Manchester Computing Center. Basic solid dist. 
3) TAMU - From Texas A&M University
4) Debian - Yet to be released. Supposed to be very good.
5) SLS - From Softlanding Software. Found at tsx-11.mit.edu and sunsite.unc.edu
   among places. Latest version is 1.0.3.

Any other suggestions folks?

BAJ
---
Another random extraction from the mental bit stream of...
Byron A. Jeff - PhD student operating in parallel!
Georgia Tech, Atlanta GA 30332   Internet: byron@cc.gatech.edu

------------------------------

Crossposted-To: comp.os.linux.help,comp.os.linux.misc
From: ahughes@jarthur.claremont.edu (The Fool)
Subject: Re: Linux Slowly Dying Off?
Date: Sat, 9 Oct 1993 21:02:52 GMT

In article <28q60cINN77h@no-names.nerdc.ufl.edu> kem@prl.ufl.edu (Kelly Murray) writes:
>In article <CE97LL.4zL@spudge.lonestar.org>, johnm@spudge.lonestar.org (John Munsch) writes:
>|> [ In the interests of bandwidth, I summerize JohnMunsch article as saying:]
>|> [Lots of good, well written prose about how Linux is another Unix, and needs major
>|> [improvements to become useful to end-users.]
>|> [And the expected reaction to this criticism:]
>|>
>|> Anyone reading the above may well say, "Geez, that's not Unix.  If you don't
>|> like the way Linux is today then go run Windows 3.1 or wait for Windows 4.0
>|> if you have to have multitasking and 32 in a reasonable memory area."
>|> 
>|> "Unix is about choice and if you want a choice of 13 different window managers
>|> for your GUI then you aren't going to get that from "any color so long as it's
>|> black" Windows.  If you want to be totally restricted in the way that
>|> everything works, looks, etc. go pick a commercial operating system."
>|> 
>|> I think that would miss the point terribly.  Unix is powerful and neat.
>|> Unfortunately very few will ever get to use this neat FREE system outside of
>|> the few who are up to setting up and administrating a current Unix system.  A
>|> number that pales when compared to the 25 million Windows licenses that will
>|> soon be out there.
>|> 
>
>I agree with you 100% on your observations and comments.
>I would also add that Linux folks will say you are free to build your
>own Linux package that is a system like you want.  Why hasn't someone done it?
>It has no benefit for the people who would develop it. 
>It would only benefit naive end-users, who are seen by many Linux people as 
>a lower form of life.  Such end-user software is developing by paid programmers
>who would rather spend their time doing something else.
>
>Linux was developed by hackers for use by hackers. 
>If others find it useful, then they are lucky. 
>
I don't agree. Linux is useful to anyone who want's it's power and is willing
to take the time to learn. I'm hardly a Unix guru, but I find Linux vastly
superior to any other option I've yet seen.
There are plenty of people on the net who are willing to give their time and
effort to help people figure out their problems.
In fact, Matt's Linux Installation Guide would be enough for most people. I
found it very complete, and suspect it would be enough to get most end user's
up and running.

                                The Fool
                                    ;-)

------------------------------

From: geyer@polyhymnia.iwr.uni-heidelberg.de (Helmut Geyer)
Subject: Re: Shm extension to X
Date: Sat, 9 Oct 93 23:51:41 GMT

Olaf Schlueter (olaf@tpki.toppoint.de) wrote:
:>stokes@Erc.MsState.Edu (Michael Stokes) writes:

:>>The version I have has it (at least the header data is there in
:>>/usr/include/X11/extensions). I haven't tried to link to it, but 
:>>I bet it works.
:>>--
:>>All men have to understand their limitations...C.Eastwood

:>The XFree 1.3 server doesn't claim to have MIT-SHM in its extension
:>list (try xdpyinfo). The header data is there, but the functions are
:>not in libXext.a.

That is right. In the README.Linux file (installed in /usr/X386/lib/X11/etc)
it is mentioned that the MIT-SHM extensions work but are not compiled in because 
the c Library did not support it at that time. XFree86-2.0 will include the
MIT-SHM extensions. Unless you want to compile XFree86-1.3 with the MIT-SHM 
enabled (can be done in mit/config/site.def) you will have to wait for 2.0
to use it.

        Helmut

==============================================================================
Helmut Geyer                              geyer@kalliope.iwr.uni-heidelberg.de

------------------------------

Crossposted-To: comp.os.linux
From: user1@valis.ampr.ab.ca (Kevin Fluet)
Subject: Re: CFC/CFI: XSysadmin
Date: Sat, 9 Oct 1993 23:20:37 GMT

In <1993Oct7.022534.613@bhhome.ci.net> bill@bhhome.ci.net (Bill Heiser) writes:
>will@oliver (Michael Will) writes:

>>I would like to make a LinuxConfigurationtool for
>>      - usermaintainement (incl. shadow-support)
>>      - uucp
>>      - smail
>>      - cnews / tin
>>      - internet
>>      - cron
>>      - printers

>I for one don't like using tools like that for sysadmin work .. I prefer
>to edit the files manually so I can see what is really being done.  But
>I agree there may be a "market" for such a tool.

Absolutely.  I was just thinking today that I would really love some sort of
graphical program to manage users (although, I would prefer something
text-based).  

-- Kevin

======================================================================
Kevin Fluet         Call V.A.L.I.S. Public Access Linux  (403)478-1281
kevin or user1@valis.ampr.ab.ca             Telnet, FTP, Usenet, Email
fluet@ee.ualberta.ca          Ask me about Linux, the FREE Unix clone!

------------------------------

From: slukka@nyx.cs.du.edu (Stefan Lukka)
Subject: Re: NO QUESTIONS HERE PLEASE / RTF FAQ (Re: -m486 doing nothing?)
Reply-To: /dev/null@nyx.cs.du.edu
Date: 10 Oct 93 02:12:39 GMT

In article <1993Oct9.161323.3288.chiark.ijackson@nyx.cs.du.edu> iwj10@cus.cam.ac.uk (Ian Jackson) writes:
>In article <CEKnos.7Hy@sparc15.cs.cuhk.hk>,
>Savio Lam <lam836@cs.cuhk.hk> wrote:
>>        I just got POV-Ray 2.0 source from sunsite.unc.edu and compiled
>>with '-O2 -m486'. I compared the binaries I compiled with the ones that
>>come with the binary distribution (which are supposed to be compiled
>>without using -m486) but found that they are the same! So I recompiled
>>with only '-O2' and compared these with the ones I compiled early with
>>'-O2 -m486' and they are the same! I tried with selection 1.5 and found
>>the same result. Is there something wrong?
>
>This is answered in the FAQ, Q5.3, and should not have been posted
>here anyway.
>
>Please DO NOT POST QUESTIONS TO THIS GROUP and READ THE FAQ AND THE
>HOWTOS BEFORE POSTING.
>

How about you SHUT THE F*CK UP AND GET LOST? It isn't enough to put
your moronic hourly "READ THIS" posts in my kill file, now I have to
listen to more of your net.cop crap as well? GO GET A LIFE and stop
harrasing people!

Stefan J Lukka /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\


------------------------------

From: a228dhal@cdf.toronto.edu (Dhaliwal Bikram Singh)
Subject: Re: gcc on Linux acts wierdly compared to SUN
Date: Sun, 10 Oct 1993 03:10:55 GMT

In article <1993Oct9.190902.28392@cdf.toronto.edu> a228dhal@cdf.toronto.edu (Dhaliwal Bikram Singh) writes:
Below is a summary of the follow-ups that I received after
posting my problem on this newsgroup.  I hope that it might
help others.  I would like to thank all those who thought about
the problem and mailed me about some possible solutions.
(It works now, it seems that free() on the Sun and on Linux
work differently on heap management, I guess heap management
is a OS specific job).


>I am doing a program that requires heavy use of linked lists.  We
>are running gcc on our SUN IPC's at school, I have had no problems
>compiling and getting expected results from this setup.  Except it is
>when I try to compile the same program at home that I get results that
>I can't figure out.
>
>ie: a call of the function
>FindTwoSmallest(node **p);
>
>in the program is call it by : FindTwoSmallest(&node)
>
>it should respond by printing the elements of the data structure
>like the version on the Sun did, however it looks to me like it actually
>printing the memory addresses in decimal.  
>
>I am sorry that I am not that descriptive, I can't get cut and paste
>to work between my xterm and the program I am using to log onto the 
>schools computer (minicom in an xterm, another question).
>
>Should I upgrade my version of gcc?  It is the distribution that came
>with the 99pl10 release (I think).



From jarthur.Claremont.EDU!bgribble Sat Oct  9 18:59:27 1993

> to pointer then you must pass the address of structure.  Actually it is
> my fault for not giving the fact that node is:
> NODE *node;

Ah.  This was not clear. 

> so to pass the address of the node pointer :
> FindTwoSmallest(&node);
> 
> then inside function FindTwoSmallest(node **p){
> printf("p->freq\n",(*p)->freq);
> 
> now instead of printing the actual numbers (just ints) it prints
> what looks to me like memory addresses in decimal.
> 
> This works on the Sun's gcc, but not on with the gcc on my home Linux machine.

I can't trace your problem with certainty, since I can't see your code.
But I would look very very hard at your own code to make sure that this is
not a user error.  While it is possible that Linux gcc has some bug that Sun
gcc does not, I would put the chance of encountering a bug at the level of
this program (i.e. exercising very basic features of the language, no
operating-system dependent stuff, etc.) to be far less than 10^-6.  If there
was something wrong with Linux gcc and structures, all that c++ code I write
every day on Linux would have some problems, and it just doesn't.

The symptoms you describe (basically, the program works when the moon is in
one phase and not when it is in another) are classic symptoms of memory
allocation errors.  I.e., you may have declared a pointer and then
dereferenced it without pointing it at a valid data structure first.  Or you
return a pointer to a variable that goes out of scope.  Like --

int main(int argc, char *argv[]) {

  NODE *node;
  node->freq = 10;   /* this is an error */

}

or 

int main(int argc, char *argv[]) {

  NODE *node;

  Initialize(&node);
  node->freq = 10;   /* this is an error ...*/

}
void Initialize(NODE **node) {

  NODE newnode;

  *node = &newnode;  /* since newnode goes away when you leave function */
  
  return;
}

> Thanks for any input.

Hope I have helped. 

From pollux.cs.uga.edu!hal Sat Oct  9 22:07:06 1993

In article <1993Oct9.190902.28392@cdf.toronto.edu> you write:
>I am doing a program that requires heavy use of linked lists.  We
>are running gcc on our SUN IPC's at school, I have had no problems
>compiling and getting expected results from this setup.  Except it is
>when I try to compile the same program at home that I get results that
>I can't figure out.
>
>ie: a call of the function
>FindTwoSmallest(node **p);
>
>in the program is call it by : FindTwoSmallest(&node)
>
>it should respond by printing the elements of the data structure
>like the version on the Sun did, however it looks to me like it actually
>printing the memory addresses in decimal.  
>
>I am sorry that I am not that descriptive, I can't get cut and paste
>to work between my xterm and the program I am using to log onto the 
>schools computer (minicom in an xterm, another question).
>
>Should I upgrade my version of gcc?  It is the distribution that came
>with the 99pl10 release (I think).
>.
>
>
>-- 
>------------------------
>a228dhal@cdf.toronto.edu
>Bikram Dhaliwal
>(416) 845-4567


You really don't give much to go on, but I'd like to advise
you of a potential problem with a program such as yours which
must use malloc()/free() a great deal.  The Sun malloc/free
routines are very forgiving in that if you free an address
that has already been free'd or was never malloc'd in the
first place, the heap is usually not corrupted.  Linux
(or linux-libc, actually) is very unforgiving in this respect.

These problems usually result in a seg fault, however.

You might want to run your program with mtrace(), and then
use the mtrace.awk script to make sure that your program
is behaving properly.  Or you might want to look into the
Purify (tm) clone called Checker (I haven't had time to try
that one).

======================================================================
 Hal N. Brooks     Voice: (706) 546-7792     Internet: hal@cs.uga.edu
======================================================================

-- 
========================
a228dhal@cdf.toronto.edu
Bikram Dhaliwal
(416) 845-4567

------------------------------

From: rich@mulvey.com
Subject: Re: NO QUESTIONS HERE PLEASE / RTF FAQ (Re: -m486 doing nothing?)
Date: Sun, 10 Oct 1993 03:24:15 GMT

Stefan Lukka (slukka@nyx.cs.du.edu) wrote:
: In article <1993Oct9.161323.3288.chiark.ijackson@nyx.cs.du.edu> iwj10@cus.cam.ac.uk (Ian Jackson) writes:
: >In article <CEKnos.7Hy@sparc15.cs.cuhk.hk>,
: >Savio Lam <lam836@cs.cuhk.hk> wrote:
: >>        I just got POV-Ray 2.0 source from sunsite.unc.edu and compiled
: >>with '-O2 -m486'. I compared the binaries I compiled with the ones that
: >>come with the binary distribution (which are supposed to be compiled
: >>without using -m486) but found that they are the same! So I recompiled
: >>with only '-O2' and compared these with the ones I compiled early with
: >>'-O2 -m486' and they are the same! I tried with selection 1.5 and found
: >>the same result. Is there something wrong?
: >
: >This is answered in the FAQ, Q5.3, and should not have been posted
: >here anyway.
: >
: >Please DO NOT POST QUESTIONS TO THIS GROUP and READ THE FAQ AND THE
: >HOWTOS BEFORE POSTING.
: >

: How about you SHUT THE F*CK UP AND GET LOST? It isn't enough to put
: your moronic hourly "READ THIS" posts in my kill file, now I have to
: listen to more of your net.cop crap as well? GO GET A LIFE and stop
: harrasing people!

   Ahhh... just what I like to see on the net - insightful, calm,
rational discussion.  It restores my faith in humanity when I see
intelligent posts like the one above.

- Rich

-- 
Rich Mulvey                 Amateur Radio: N2VDS              Rochester, NY
rich@mulvey.com         "Ignorance should be painful."

------------------------------


** 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: Linux-Development-Request@NEWS-DIGESTS.MIT.EDU

You can send mail to the entire list (and comp.os.linux.development) via:

    Internet: Linux-Development@NEWS-DIGESTS.MIT.EDU

Linux may be obtained via one of these FTP sites:
    nic.funet.fi				pub/OS/Linux
    tsx-11.mit.edu				pub/linux
    sunsite.unc.edu				pub/Linux

End of Linux-Development Digest
******************************
