Linux-Development-Sys Digest #280, Volume #6     Thu, 14 Jan 99 22:14:13 EST

Contents:
  bizarre program behavior (Craig Mautner)
  Re: glibc and utmp/wtmp ("Niels Andersen")
  Re: - deprecated - why? ("Frank T. Lofaro")
  Re: Making reliable profilings under linux !!!! (Bryan Hackney)
  Re: disheartened gnome developer ([EMAIL PROTECTED])
  Re: Anti-Linux FUD (Larry T. Bastard)
  Re: Registry for Linux - Bad idea (Stefan Monnier)
  Re: Why no core file? (Maciej Golebiewski)
  Re: Acessing binary file from the code without open(argv[0] ..) (Alan Curry)
  Re: Memory allocated by libc fns (Andreas Jaeger)
  Re: disheartened gnome developer ("Duncan Rose")
  Re: disheartened gnome developer ("Duncan Rose")
  Re: How to run Windows Applications on Linux (Jim Richardson)
  Re: Obtaining MAC address from remote computer (Paul Flinders)

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

From: Craig Mautner <[EMAIL PROTECTED]>
Crossposted-To: alt.os.linux,linux.dev.c-programming
Subject: bizarre program behavior
Date: Thu, 14 Jan 1999 10:53:26 -0800

This may not be the right group(s) to post to, but I hope you can point
me in the right direction or to the right group. Thanks in advance.

The simulation program (written in C) that I use for my research
recently started doing bad things. (I'm probably writing off the end of
an array but I've ruled out uninitialized pointers and exhausted myself
trying to find out where else.) The failure is that tanh() returns NaN
when passed -4.4375. It runs correctly the first six times through and
then fails at exactly the same place on the seventh pass. Using gdb I
have narrowed it down to a single machine instruction (fldl). If I add a
single line of code above the problem call, the problem goes away (at
least it moves to somewhere where I can't detect it).

Below is an ***annotated*** gdb session first showing the the correct
behavior then showing the failing behavior. To display the contents of
the top of the fpu stack I use the gdb "call" facility to run
printDouble() which I wrote since I can't figure out how to get gdb to
dump the floating point registers. The source and assembly for
printDouble() is at the end of this email.


***Stopped at 0x400bb73a just prior to pushing value onto fpu stack***
(gdb)
0x400bb73a in ?? ()
2: x/i $eip  0x400bb73a: fldl   0xffffda40(%edx)

***What's in $edx?***
(gdb) p/x $edx
$5 = 0x400c9658

***calculate location in memory that will be loaded***
(gdb) p/x $edx+0xffffda40
$7 = 0x400c7098

***look there and find floating point 1.0 (0x3ff00000...0)***
(gdb) x/10xg 0x400c7098
0x400c7098: 0x3ff0000000000000 0xb8aa3b295c17f0bc
0x400c70a8: 0x0000000000003fff 0x0000000043500000
0x400c70b8: 0x0000000043500000 0x0000000000000000
0x400c70c8: 0x0000000000000000 0x3fd28f5c28f5c28f
0x400c70d8: 0x3ff0000000000000 0x3ff0000000000000

***Use printDouble to display top of stack before instruction***
(gdb) call printDouble(0)
value = 13

***Execute the push instruction (fldl ...)***
(gdb) stepi
0x400bb740 in ?? ()
2: x/i $eip  0x400bb740: fscale

***Check the top of stack and find the fldl worked correctly***
(gdb) call printDouble(0)
value = 1

Now the trace six iterations later when it fails:


***Stopped at 0x400bb73a prior to pushing value onto fpu stack (fldl)***

(gdb)
0x400bb73a in ?? ()
2: x/i $eip  0x400bb73a: fldl   0xffffda40(%edx)

***Check $edx and find it is the same (good)***
(gdb) p/x $edx
$8 = 0x400c9658

***look at the location and find floating point 1.0 still***
(gdb) x/10xg 0x400c7098
0x400c7098: 0x3ff0000000000000 0xb8aa3b295c17f0bc
0x400c70a8: 0x0000000000003fff 0x0000000043500000
0x400c70b8: 0x0000000043500000 0x0000000000000000
0x400c70c8: 0x0000000000000000 0x3fd28f5c28f5c28f
0x400c70d8: 0x3ff0000000000000 0x3ff0000000000000

***Use printDouble to display top of stack before fldl instruction***
(gdb) call printDouble(0)
value = 13

***Execute the push (fldl ...)***
(gdb) stepi
0x400bb740 in ?? ()
2: x/i $eip  0x400bb740: fscale

!!!Check the top of fpu stack after fldl and find it screwed up!!!
(gdb) call printDouble(0)
value = NaN

I've compared the opcodes when it works correctly and incorrectly and
they are the same. I've also put a break into printDouble() to look
directly at the floating point value and found that the value for NaN is
0xfff8000000000000.

I have no idea how a Pentium II can load different values when
everything seems to be the same. Can someone please clue me in as to
where to look next?

thanks for any help,
-Craig

*****Source for printDouble()********
void
printDouble( double x )
{
    asm( "fstl 0x8(%ebp)" ); /* copy top of fp stack to arg x */
    printf( "value = %g\n", x );
}

*****Assembly generated for printDouble()********
0x805bfd0 <printDouble>: pushl  %ebp
0x805bfd1 <printDouble+1>: movl   %esp,%ebp
0x805bfd3 <printDouble+3>: fstl   0x8(%ebp)
0x805bfd6 <printDouble+6>: pushl  0xc(%ebp)
0x805bfd9 <printDouble+9>: pushl  0x8(%ebp)
0x805bfdc <printDouble+12>: pushl  $0x8063e7d
0x805bfe1 <printDouble+17>: call   0x804911c <printf>
0x805bfe6 <printDouble+22>: addl   $0xc,%esp
0x805bfe9 <printDouble+25>: movl   %ebp,%esp
0x805bfeb <printDouble+27>: popl   %ebp
0x805bfec <printDouble+28>: ret





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

From: "Niels Andersen" <[EMAIL PROTECTED]>
Subject: Re: glibc and utmp/wtmp
Date: Thu, 14 Jan 1999 21:34:48 +0100

>>I recently upgraded to glibc-2.0.6.
>>I have also started building my system programs to use the library.
>>After building and installing sh-utils-1.16 I have noticed that
>>"users" and "who" don't work (they run but give no output).
>>Does anyone know how I can get this working again?
>Compile all programmes that do read / write to utmp / wtmp ... sysvinit,
>xterm, rxvt, the shadow password package, ...


I'm having troubles with utmp too. w, users, top etc. don't work. (There
must be an FAQ or HOWTO about this...) I have no idea why they suddenly
don't work. I THINK my glibc is ver 2.0.7 (how do I check that?).

I really need some more exact help on how to compile these programs, and
which programs it is.
I'm currently running RedHat 5.1, planning to upgrade to 5.2 soon. Would
that solve my problem?

Please help! Some links to docs about it should be enough...

/Niels Andersen



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

From: "Frank T. Lofaro" <[EMAIL PROTECTED]>
Subject: Re: - deprecated - why?
Date: 14 Jan 1999 06:07:48 GMT

In <[EMAIL PROTECTED]> on Wed, 13 Jan 1999 12:55:59 +0100, Josef Moellers 
<[EMAIL PROTECTED]> wrote in comp.os.linux.development.system:
>Steve Carter wrote:
>> 
>> [originally posted to comp.os.linux.development.apps oops!]
>> 
>> Why in the world does linux tell me off for typing
>> 
>> ps -e
>> 
>> when it knows full well what I mean, other unices require the minus, and
>> the minus is required or at least permitted by just about every other
>> command.

>The manual says this is "because in the future, a `-' will  be  used to 
>indicate Unix98-standard command-line arguments, while no `-' will
>indicate the current ``extended BSD'' style of command line arguments."

Please tell me the Unix98 standard for ps options is not the same as
System V! Please!

System V ps is hard to deal with, annoying, and missing key
functionality. The BSD ps is so much nicer. ps on Solaris can cause
headaches.

What the heck is Unix98, anyway?

How is it diffrent than POSIX, X/OPEN, FIPS, etc?


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

From: Bryan Hackney <[EMAIL PROTECTED]>
Subject: Re: Making reliable profilings under linux !!!!
Date: Thu, 14 Jan 1999 01:45:04 -0600
Reply-To: [EMAIL PROTECTED]

I use a delta TSC function for this purpose. It's do-it-yourself
profiling sort of.

The "rdtsc" instruction returns CPU ticks (on a Pentium).

inline unsigned long long drdtsc( ) {
        static unsigned long long llLast;
        unsigned long long llNow, llRet;
        __asm__ __volatile__ ( "rdtsc" : "=&A" (llNow) : );
        llRet = llNow - llLast;
        llLast = llNow;
        return llRet;
}



Pedro Ribeiro wrote:
> 
> I'm trying to profile a program under linux but, because all of my functions
...
> 
> --
> 
> []---------------------------------------------------------------[]
>   Pedro Ribeiro
>   Online: http://www.isel.pt/~pribeiro/
>   IRC(PTnet) Nick: PAntMaR
>   e-Mail: Personal:  [EMAIL PROTECTED]
>           Admin:     [EMAIL PROTECTED]
> []---------------------------------------------------------------[]

-- 
Bryan Hackney / BHC / bhackneyatexpress-news.net
*
* Failure teaches only what not to do next time.
*
* Would you trust your mission-critical computing to a company
* that sells stuffed toys?

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

From: [EMAIL PROTECTED]
Crossposted-To: comp.os.linux.advocacy,comp.os.linux.development.apps,comp.os.linux.x
Subject: Re: disheartened gnome developer
Date: Thu, 14 Jan 1999 20:22:42 GMT

Mikko Rauhala writes:
> You, as the copyright holder, are afaik in a way bound by the license
> (having to supply source to a release already made by you under the GPL,
> for example),...

Not true.  Distributing binaries of a work of which you are sole author
under the GPL and then refusing to distribute source would be rather
stupid, but entirely legal.  Doing so would not infringe anyone's
copyright.
-- 
John Hasler                This posting is in the public domain.
[EMAIL PROTECTED]            Do with it what you will.
Dancing Horse Hill         Make money from it if you can; I don't mind.
Elmwood, Wisconsin         Do not send email advertisements to this address.

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

From: [EMAIL PROTECTED] (Larry T. Bastard)
Crossposted-To: 
alt.destroy.microsoft,comp.os.linux.advocacy,comp.os.os2.advocacy,alt.conspiracy.microsoft
Subject: Re: Anti-Linux FUD
Reply-To: [EMAIL PROTECTED]
Date: Thu, 14 Jan 1999 07:45:32 GMT

Bill Anderson <[EMAIL PROTECTED]> wrote:

>Spiros Ioannou wrote:
>> 
>> Sam J. Bowling ([EMAIL PROTECTED]) wrote:
>> : Stefaan A Eeckels wrote:
>> :
>> : <munch>
>> :
>> : > The PC belongs to Microsoft (it always did, since IBM
>> : > decided to use MS-DOS).
>> :
>> : Bull!
>> Microsoft is good, without hell paradise wouldn't exist and if it did we
>> wouldn't be able to tell the difference.
>
>Ahhh, but paradise would exist even though we would not know it.
>I would venture to say that a paradise would not exist as long as one knew
>about hell.


and what does MS run through??
Why were they sued by SunSoft???
Because bill gates is a crack headed, stealer of ideas.
do you kind of wonder where he came up with the look of windows?
STOLEN!! you should know from apples, and whats with that windows 98
crash during a Comodex demo???? Cause MS cant do anything correctly,
and the programmers are to stupid to understand the if statements they
make.

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

From: Stefan Monnier 
<[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Registry for Linux - Bad idea
Date: 14 Jan 1999 18:38:01 -0500

In article <[EMAIL PROTECTED]>,
John R. Campbell <[EMAIL PROTECTED]> wrote:
> If we embed registry information into either the executables
> or data files, we can more easily maintain synchronicity.

And how do you plan on accomodating different configurations per user
and/or per machine (while sharing the executable over the network) ?


        Stefan

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

From: Maciej Golebiewski <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Why no core file?
Date: Thu, 14 Jan 1999 10:10:09 +0100

BL wrote:
> 
> when my app crashes, I don't get a core file.

[deletia]

> is there some env var that I need to set (etc) to allow symbolic debugging; at
> least at post-mortum level?
> 

I don't know how to force it to produce a core file, but maybe
it would help you, if in gdb, immediately after your program 
crashes, you could say "where" to print stack frames
(so that you will see in which function it died).

Hope this helps.

Maciej

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

Crossposted-To: comp.os.linux.development.apps,comp.os.linux.misc
Subject: Re: Acessing binary file from the code without open(argv[0] ..)
From: [EMAIL PROTECTED] (Alan Curry)
Date: Thu, 14 Jan 1999 09:14:19 GMT

In article <[EMAIL PROTECTED]>,
Pedro Ribeiro <[EMAIL PROTECTED]> wrote:
>Can anyone tell-me how can i access the binary file i'm executing from the
>code under Linux (without open(argv[0], ...) ???

How about open("/proc/self/exe", ...)

>
>It should be any way to know the addresses where the binfile was paged an
>simply access them with a pointer no ??

Hmmm.

open("/proc/self/maps", ...

Or

sprintf(buf, "objdump -h /proc/%d/exe", (int)getpid());
fp=popen(buf);

-- 
Alan Curry    |Declaration of   | _../\. ./\.._     ____.    ____.
[EMAIL PROTECTED]|bigotries (should| [    | |    ]    /    _>  /    _>
==============+save some time): |  \__/   \__/     \___:    \___:
 Linux,vim,trn,GPL,zsh,qmail,^H | "Screw you guys, I'm going home" -- Cartman

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

From: Andreas Jaeger <[EMAIL PROTECTED]>
Subject: Re: Memory allocated by libc fns
Date: 14 Jan 1999 10:03:06 +0100

>>>>> Kedar Dhamdhere writes:

 > Hi,
 >    When using libc wrappers for syscalls like readdir ( struct
 >    dirent *readdir(struct DIR *) , this library call allocates some
 >    memory for the struct dirent it returns . My question is , who
 >    frees this memory and how ?  I tried to free it using libc
 >    function free(void *) but it segfaults.

RTFM.  `info readdir' will give:
 - Function: struct dirent * readdir (DIR *DIRSTREAM)
     This function reads the next entry from the directory.  It normally
     returns a pointer to a structure containing information about the
     file.  This structure is statically allocated and can be rewritten
     by a subsequent call.

In other words: since it's not allocated, you shouldn't free it!

Andreas
-- 
 Andreas Jaeger   [EMAIL PROTECTED]    [EMAIL PROTECTED]
  for pgp-key finger [EMAIL PROTECTED]

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

From: "Duncan Rose" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.advocacy,comp.os.linux.development.apps,comp.os.linux.x
Subject: Re: disheartened gnome developer
Date: 14 Jan 1999 10:40:57 GMT


For some reason, my newsreader doesn't seem able to thread all these
Re: disheartened.... messages, so this discussion is being fragmented
(for me, at least). Apologies for my earlier posting of today, which is
answered
(mainly) by Steve below.

On a more general note, are the Linux lib sources GPL or LGPL? (I'm not
currently sitting at my Linux box, since I'm in work... :( )

If they're GPL I'd guess that the RH software is a derivative work, and
therefore
RH is bound by the terms of the GPL.

I think I need to say here.... I am NOT trying to argue that RH
specifically is
bound by the terms of the GPL in the context of this thread. I'm trying to
improve my understanding of the licenses we distribute our code under.
Replace "RH config tool" with any other GPLed app you wish.

So, I am happy to accept that RH is not bound by GPL in this instance, but
would still like to improve my knowlege of Linux licensing issues :)

        -Duncan

steve mcadams <[EMAIL PROTECTED]> wrote in article
<[EMAIL PROTECTED]>...
> [Snipped for brevity, quoted material marked with ">"]
> On 13 Jan 1999 11:22:55 GMT, "Duncan Rose" <[EMAIL PROTECTED]>
> wrote:
> 
> >I don't think you are right. According to the GPL, under which terms the
RH
> >software you're talking about is distributed, if the existing (freely
> >available)
> >source is used to build the new version, the new version must be GPLed
> >too (in my understanding -- correct me if I'm wrong).
> 
> In general yes, but there is an exception in the case of the authoring
> copyright holder, who can do anything s/he/it wants with any new
> version of the code, including selling proprietary licenses to the
> code or all rights to the code.  As long as it doesn't contain any
> other GPL code that they have not received a license to distribute in
> this way.
> 
> >The only way I can see RH releasing a proprietary version is if they
> >TOTALLY
> >rewrite the app, using NONE of their existing (GPLed) source. They
> >certainly
> >could not release the existing app under a different license. (Maybe
> >technically
> >they could, but it would be pointless as already mentioned by the
poster).
> 
> For the code they originated, if it was not based on GPL code, they
> could sell proprietary licenses to the code, which would not be
> pointless because it would allow commercial applications to use their
> code which they chose to release under the GPL.  It would not affect
> you or me in any way, unless we decided to buy one of these commercial
> applications because it was so swell.  -steve
> --------------------------------------------------------
> Tools for programmers: http://www.codetools.com/showcase
> 

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

From: "Duncan Rose" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.advocacy,comp.os.linux.development.apps,comp.os.linux.x
Subject: Re: disheartened gnome developer
Date: 14 Jan 1999 10:48:16 GMT



[EMAIL PROTECTED] wrote in article <[EMAIL PROTECTED]>...
> Duncan Rose writes:

--->8--- snip --->8---

> 
> They certainly could, as long as they own all the code.
> 
> > Do I have an incorrect understanding of the GPL here?
> 
> You have an incorrect understanding of copyright.
> -- 
> John Hasler                This posting is in the public domain.
> [EMAIL PROTECTED]                  Do with it what you will.
> Dancing Horse Hill         Make money from it if you can; I don't mind.
> Elmwood, Wisconsin         Do not send email advertisements to this
address.
> 

Interesting .sig. Do you hold the copyright on it? Are you giving away your
rights
under copyright law for the contents of your posting by attaching the .sig
as you
have?

Interesting parallels here I would say :)

        -Duncan

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

From: [EMAIL PROTECTED] (Jim Richardson)
Crossposted-To: 
comp.os.linux.advocacy,comp.os.linux.development,comp.os.linux.development.apps
Subject: Re: How to run Windows Applications on Linux
Date: 15 Jan 1999 02:17:24 GMT
Reply-To: [EMAIL PROTECTED]

On 13 Jan 1999 03:25:46 +0100, 
 Jens Kristian S�gaard  
 <[EMAIL PROTECTED]> brought forth the following words...:

>[EMAIL PROTECTED] (Brett W. McCoy) writes:
>
>> > Santa's making a list.  If You could have any piece of software ported
>> > to Linux, other than Microsoft's what would it be?
>> PageMaker or CorelDRAW!
>
>I've successfully run PageMaker on Linux using WINE. Try it ;-)
>
>
>-- 
>Jens Kristian S�gaard,
>[EMAIL PROTECTED]

I for one have been unsuccessful in getting wine to do anything, I am sure
that there is something, somewhere, I am doing wrong. I can't
even get it to play tictactoe... Getting wine up to play the few games I 
use in windows, would enable me to delete windows entirely from the disk.
 (back to to the docs...)

-- 
Jim Richardson
        Anarchist, pagan and proud of it
WWW.eskimo.com/~warlock
        Linux, because life's too short for a buggy OS.


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

From: Paul Flinders <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.networking
Subject: Re: Obtaining MAC address from remote computer
Date: 14 Jan 1999 12:31:39 +0000


"Sander Pilon" <[EMAIL PROTECTED]> writes:

> Maybe I should've mentioned I want to do this in C on a per-packet basis.
> 
> A packet arrived on eth0, I'm going to forward it to eth1 and I have to
> insert a new MAC
> address.

Mmmm... what _exactly_ are you up to??

If you're bridging I think the usual algorithm is to maintain a table
of MAC address/interface pairs so you know which interface to send a
packet out of.  If you see an packet with a destination mac address
which you don't know a specific interface for forward it to all, you
don't need to look beyond the ethernet header.

If you're proxy arping or routing you use the network (eg IP) address
and ARP.

However the kernel supports bridging, routing and proxy arp quite
well.

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


** 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
******************************

Reply via email to