Linux-Development-Sys Digest #113, Volume #8     Wed, 30 Aug 00 19:13:15 EDT

Contents:
  Re: BOOK: Any good books on Client/Server Design Architectures (CeePlsPls)
  Re: Detecting applications faults (Kaz Kylheku)
  Terminal Emulator ("Reginald")
  Re: open a file in kernel space (Grant Edwards)
  Re: Detecting applications faults (Szabolcs Csetey)
  sleep in driver ([EMAIL PROTECTED])
  Linux thread problem? (Edward Lee)
  How to disable "screen saver"? ([EMAIL PROTECTED])
  Re: How to disable "screen saver"? (Rick Ellis)
  Re: HELP REQUEST - MPC860T Linux Development ("Rich C")
  Re: purify and memory managers ("Paul D. Smith")
  newbie version question ([EMAIL PROTECTED])
  client connect() fails to see SYN ACK ("Dave Rhodes")
  Re: Detecting applications faults (Rosimildo da Silva)
  Re: purify and memory managers (Kaz Kylheku)

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

From: [EMAIL PROTECTED] (CeePlsPls)
Subject: Re: BOOK: Any good books on Client/Server Design Architectures
Reply-To: [EMAIL PROTECTED]
Date: Wed, 30 Aug 2000 15:18:09 GMT

Thanx, I will look in to it.

On Fri, 25 Aug 2000 11:12:31 -0600, "D. Stimits" <[EMAIL PROTECTED]>
wrote:

>CeePlsPls wrote:
>> 
>> Thanx
>
>What kind of client/server, web page apps, SQL, general custom network
>apps, distributed apps, so on? Are you interested in a particular
>language for it, or just in general?
>
>Something you might be interested in if you do OOP is the subject of
>design patterns. One good book, based primarily in C++, is:
>"Design Patterns, Elements of Reusable Object-Oriented Software",
>by several authors, Erich Gamma, et al., forward by Grady Booch.
>
>Although the book isn't about client/server, you'll find that patterns
>which are extremely useful and likely to be part of your particular
>situation are described there.


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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: Detecting applications faults
Reply-To: [EMAIL PROTECTED]
Date: Wed, 30 Aug 2000 15:14:06 GMT

On Wed, 30 Aug 2000 11:06:27 GMT, Rosimildo da Silva <[EMAIL PROTECTED]>
wrote:
>Hi,
>
>Is there any mechanism under Linux to detect when an
>application, Daemon, etc that caused a core dump.
>
>
>Windows NT has a mechanism called "Application Error Debug"
>that automatically calls a debug to handle the crash.
>The default one installed is "Dr Watson". 
>
>
>Is there anything similar under Linux ?

A process could simply trap the fatal signal and fork and exec the debugger in
the handler for that signal. That's probably very similar to what NT does: 
I'm guessing that it catches the exception at the top of the thread, and runs
the debugger specified in the registry.

Anyway, Linux core dumps are much more useful than the output that Dr. Watson
logs to a file.  Dr. Watson is like oops-tracing for user space, which doesn't
make sense in this decade.

-- 
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: "Reginald" <[EMAIL PROTECTED]>
Subject: Terminal Emulator
Date: Wed, 30 Aug 2000 15:25:53 GMT

I am new to Linux. I am used to using Procomm Plus for Windows.  I need Wyse
50 terminal emulation capability to work with our network.  Does anyone know
where I can get an emulator for Linux that will do this?  Or can someone
explain to me how to do this?



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

From: [EMAIL PROTECTED] (Grant Edwards)
Subject: Re: open a file in kernel space
Date: Wed, 30 Aug 2000 15:52:55 GMT

In article <[EMAIL PROTECTED]>, Andy Jeffries wrote:
>> Just use open, read, close on it as you might in user-space. Don't try
>> to use  fopen, fread, etc because they dont exist.
>
>Are you sure this works OK?

An awful lot of pretty smart people have had to use other methods to get
data from a file into a kernel module (having a daemon running in user-space
is the usual method).

I'd be really surprised if all those people went to such lengths for no
reason.

I haven't actually tried open/read/close from kernel-space because I've
always read that you can't, so I use a daemon calling ioctl() to transfer
configuration data to a kernel module.

-- 
Grant Edwards                   grante             Yow!  NANCY!! Why is
                                  at               everything RED?!
                               visi.com            

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

From: Szabolcs Csetey <[EMAIL PROTECTED]>
Subject: Re: Detecting applications faults
Date: Wed, 30 Aug 2000 16:22:24 GMT

  Rosimildo da Silva <[EMAIL PROTECTED]> wrote:
> But, I'd like to write an utility that detects that an application
> crashed and sends a notification ( e-mail ) to some admin.

#!/bin/sh
<your app here> &
wait
echo "my app crashed" | mail <your_email_address>

Feel free to improve it ;) but I'm quite sure tons of stuff are out
there


Sent via Deja.com http://www.deja.com/
Before you buy.

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

From: [EMAIL PROTECTED]
Subject: sleep in driver
Date: Wed, 30 Aug 2000 16:46:33 GMT

Hi
 I tried to implement the sleep using jiffies as given in Rubini text.
It doesn't compile in 2.2.x kernel.

so i changed the code to
        ulJiffyForTimeout = jiffies + 50 * HZ;  // sleep for 0.5 seconds
        current->state = TASK_INTERRUPTIBLE;
        schedule_timeout(ulJiffyForTimeout);
        schedule();
        current->timeout = 0;

1.is this code right?
2. Should I use interruptible_sleep_on instead of schedule? what is the
difference?

regards
jeseem
mailto:[EMAIL PROTECTED]


Sent via Deja.com http://www.deja.com/
Before you buy.

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

From: Edward Lee <[EMAIL PROTECTED]>
Subject: Linux thread problem?
Date: Mon, 28 Aug 2000 11:34:39 -0700

I am playing (hacking) with the NIST mpeg2player, but I am running into
some minor problems.  Can someone give me some hints to dig into?

The player works fine on a Dual Pentium II 350 (usng MMX) at 90% CPU
usages.  However, the sound is broken-up on a K6-2 500 (using MMX and
3Dnow) at less tha 50% CPU usages.  How can I force the sound decoder to
use more CPU?  Does it sound like a threading problem?


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

From: [EMAIL PROTECTED]
Subject: How to disable "screen saver"?
Date: Wed, 30 Aug 2000 18:35:07 GMT



I think the default setting is screen saver enabled after I installed
the RedHat 6.0.  When I leave the system for a while, the sceen will be
blank.
The problem is now I am running my test driver which will cause a trap
into kdb after a long time later say 5 hours.  But, at that time I can
not wake up my screen by knocking keyboard or moving mouse.

Does anybody know how to disable the feature of screen saver or some
kind of that?  I don't want my screen to be blank anyway.

Thanks for your kindly help.

- Sam


Sent via Deja.com http://www.deja.com/
Before you buy.

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

From: [EMAIL PROTECTED] (Rick Ellis)
Subject: Re: How to disable "screen saver"?
Date: 30 Aug 2000 19:18:46 GMT

In article <8ojk4p$ho$[EMAIL PROTECTED]>,  <[EMAIL PROTECTED]> wrote:

>I think the default setting is screen saver enabled after I installed
>the RedHat 6.0.  When I leave the system for a while, the sceen will be
>blank.
>The problem is now I am running my test driver which will cause a trap
>into kdb after a long time later say 5 hours.  But, at that time I can
>not wake up my screen by knocking keyboard or moving mouse.
>
>Does anybody know how to disable the feature of screen saver or some
>kind of that?  I don't want my screen to be blank anyway.

man setterm

--
http://www.fnet.net/~ellis/photo/linux.html

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

From: "Rich C" <[EMAIL PROTECTED]>
Crossposted-To: 
alt.os.linux.corel,alt.os.linux.mandrake,alt.os.linux.slackware,comp.os.linux.advocacy,comp.os.linux.m68k,comp.os.linux.powerpc
Subject: Re: HELP REQUEST - MPC860T Linux Development
Date: Wed, 30 Aug 2000 16:45:26 -0400

Start here:

http://www.rtlinux.org/rtlinux.new/index.html

This is the RT-Linux website. RT-Linux is an extension to Linux which
permits hard real time threads to run on x86, ppc, and alpha (I'm not sure
if your specific target processor is covered; it may be close to the ppc
version if you need to develop one.) It also supports SMP.

There are links to documentation on that site, as well as a FAQ:
http://www.rtlinux.org/rtlinux.new/documents/faq.html. You can also find a
list of current projects using RT-Linux, as well as drivers for common
boards.

There are actually two branches of hard Real Time Linux: the original
RT-Linux, developed at FSMLabs by Victor Yodaiken and others, and a spinoff
called RTAI developed by Paulo Mantegazza and others. This version only runs
on x86 though, so wouldn't be much use to you now. RT-Linux tends to be more
concerned with stability and small size, while RTAI tends to be more
concerned with features that are contained in other [commercial] RTOSes.

As far as using RT-Linux in an embedded system, start here:

http://www.embedded.com/97/fe39710.htm

There is not much as far as ethernet or TCP/IP being run from the real time
side, as they are assumed to be not real time. (Standard TCP/IP/ethernet is
NOT real time, but it CAN be if you manage the protocol and control HOW and
WHEN packets get sent out on the network.) If you want to collaborate, I
believe there are others who are interested in TCP/IP and/or ethernet from
the real time side. Join the mailing list and put out some feelers.

As far as my own project is concerned, we are using a proprietary networking
protocol, so I am not interested in real time ethernet communications at
this time.

I don't know what (if any) Windows development tools there are, other than
GCC, or how practical a Windows development platform is for Linux and
RT-Linux. I would recommend getting a Linux system in either x86 or
preferably ppc, and developing on that. You can debug the real time side
using extensions for GDB, and the RT_Linux system calls are pretty
independent of processor type, I believe, so migration from, say, an x86
development system to a ppc target should be trivial.

Good luck with your project.
--
Rich C.
"Because light travels faster than sound, many people appear to be
intelligent, until you hear them speak."

Jeff Gentry <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> I am working on a new development effort based on
> the Motorola MPC860T PowerQUICC. I want to use
> embedded Linux with hard real-time capabilities. I would
> also like it to be based on a distribution that will support
> the internal Ethernet physical layer on the chip. I will need
> cross development tools since my host runs
> Windows 95/98/NT and the target will be a
> Motorola FADS board.
>
> I've searched a lot of sites and read a lot of documentation
> over the last week. If anyone has a suggestion or is working
> on a similar development I would appreciate the feedback.
>
> Thanks,
>
> Linux Newbie
>
>
>
>



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

From: "Paul D. Smith" <[EMAIL PROTECTED]>
Subject: Re: purify and memory managers
Date: 30 Aug 2000 17:14:20 -0400
Reply-To: [EMAIL PROTECTED]

%% [EMAIL PROTECTED] (James R. Van Zandt) writes:

  jrvz> In article <[EMAIL PROTECTED]>,
  jrvz> Paul D. Smith <[EMAIL PROTECTED]> wrote:
  >> There are a few tools available on Linux for C; I'm not sure about C++.
  >> You can use dmalloc, which is an old standard.  Also, there are patches
  >> to GCC to allow it to do array bounds checking, which can be useful.
  >> 
  >> None of these are as easy to use as Purify; since Purify instruments
  >> your object code you only need to _link_ with it; all the .o's, etc. can
  >> be compiled normally.  Dmalloc et. al. require you to recompile all your
  >> files to get the best coverage (only very basic coverage is available by
  >> just linking the dmalloc library).

  jrvz> Electric Fence (efence) works without relinking, by putting a
  jrvz> special shared library at the beginning of the relevant search
  jrvz> path.

Yep, that's cool on systems that support it.  It doesn't catch all the
different situations that a tool like Purify, which instruments the
actual object code, can though.

Of course, instrumenting the object code is a tricky business and makes
the tool very difficult to port to new architectures... so...

-- 
===============================================================================
 Paul D. Smith <[EMAIL PROTECTED]>         Network Management Development
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
===============================================================================
   These are my opinions---Nortel Networks takes no responsibility for them.

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

From: [EMAIL PROTECTED]
Subject: newbie version question
Date: Wed, 30 Aug 2000 21:40:36 GMT

What do I do if I have a module compiled under 2.2.16 and I need it to
exist under
2.2.13 but the 2.2.13 system doesn't have source?


Sent via Deja.com http://www.deja.com/
Before you buy.

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

From: "Dave Rhodes" <[EMAIL PROTECTED]>
Subject: client connect() fails to see SYN ACK
Date: Wed, 30 Aug 2000 18:13:18 -0400

Hi Developers-

I am trying to develop an advanced server application that can manipulate
IP packets prior to being sent for a TCP connection. From a prior posting,
Andi Kleen told me that I would have to use a AF_PACKET socket along with
ipchains blocking to avoid the internal TCP/IP from seeing the packet and
responding. This was certainly a big help and improved things, but now I
must develop my own TCP which is what I am trying to do. There is still
something wrong, here are the facts:

* On the client, a typical client approach is used, socket(AF_INET,
SOCK_STREAM, 0)
  along with a connect() call using the server IP/and custom port # (above
50000).
* On the server side, if I use the system's socket/bind/listen/accept calls,
  the connection is made, this verifies that the client is working (I
think).
* I am using a non-blocking socket(AF_PACKET, SOCK_DGRAM, htons(ETH_P_ALL))
  as the basis for the server. This seems to work on the 'lo' interface too?
* The client sends the SYN and I respond with a SYN ACK but it seems that
the
  client never sees this as it follows later with a SYN with the same
sequence
  number again (the ipchains did work to block the normal TCP processing on
  the server).
* I am making up the server's SYN number using rand seeded with process id
  and time, I don't think that I have access to the system syn generator,
  but since it is blocked from seeing these packets I don't think that I
need
  to coordinate with the local system, right?
* I am sending the response to the same interface that I got the recvfrom,
  and the same undesired behavior occurs when the client and server are on
the
  same machine (using the 'lo' interface) or remote using 'eth0'.
* I _think_ that all my IP and TCP checksums are right, I check my outgoing
  packet with the same code used to screen incoming packets for correctness.
  The ack # is +1 from the recv'd, the ports are right etc.

I have done the following to try to figure out why the client doesn't see my
response:

* I have used tcpdump, iptraf, and even snoop on a LAN connected solaris
machine
  and carefully gone through the packets bit by bit ... and compared with
the
  'correct' packets that are sent with the built in system calls.
Everything,
  including the TCP options, MSS, tstamps, wscale, etc. seems right. All of
  these tools 'see' the packet either on the lo or eth0 interface as I
expect
  to see it.
* I have gone through the linux 2.2 source code to try and see what might
  prevent the (client) tcp_connect call from working
  (in net/ipv4/tcp_{,output,input}.c) and elsewhere. There is a comment in
one
  of these files to the effect that "unfortunately ... TCP magic is used..."
  but I couldn't trace that out exactly.

Here are the only things that I think could be the problem, but I am not
sure:

* ARP/RARP is done by the system prior to the system's accept call, but the
  ethernet addresses I am using on the outgoing packet seems right (and this
  wouldn't affect the lo loop back anyway, right?).
* the tcp checksums is wrong (the IP checksum is checked by snoop), this
would
  cause the packet to be dropped by the client before getting to the user
code,
  but i really think that its right (I even checked it using a known good
packet
  from the system to make sure I get the same check).

Anyway, does anyone have an idea about what might be wrong? Especially about
things that I didn't think about? Is there other reasons that the client
would
drop an incoming SYN ACK packet?

Much indebted,
dave




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

From: Rosimildo da Silva <[EMAIL PROTECTED]>
Subject: Re: Detecting applications faults
Date: Wed, 30 Aug 2000 22:49:45 GMT

First of all,

Thanks to everyone that posted an answer here.

more comments below


Josef Moellers wrote:
> 
> > Of course you can get it to do anything you want, log to system logs, email,
> > etc...
> 
> Your technique only applies to a shell.
> I guess, what Rosimildo is after is a technique to supervise any
> application, not necessarily the ones he has written himself.
> 


True. I'd ilke to have the OS monitoring all applications running,
and let me know if something went wrong with one of them.

I have implemented similar program for windows, you can find
more info about it here:

http://www.connecttel.com

It is called GPF Saver, and it is a replacement for Dr.Watson.
I am studying if I can support such program under Linux.


I am looking for a service on Linux similar to the Structured 
Exception Handler of Windows NT( Win 2000 ).

In a nutshell it works like that:


When an application raises a fault ( e.g. SIGABRT, SIGFPE, SIGSEGV,
SIGTRAP, SIGIOT),
something similar to a coredump, Windows NT does one of the following:

 a) if the application is running uder a debugger, it passes the
exception to the
    debugger; end of it.

 b) if not, it raises what they call "fisrt chance exception", and if
the application
    has a handler installed, and handles the exception, ok it is ready
to continue
    if the application decides to do so, otherwise...


 c) if the application does not have a handler installed, Windows NT
looks at some
    key in the register, and if there is an "Application Error Debug -
AED" installed,
    it passes the exception to it. The default AED is Dr.Watson or a
simple one that
    puts a message box describing that the application generated an
illegal 
    operation, blah, blah.


I am not looking for solutions with shell scripts, adding code to
applications, etc.


My take at this point is that Linux does not have such a mechanism. My
best bet is
probably write something as you mentioned below.


Anyway, thanks. This has been very informative for me.



> > Dave.
> >
> > Ps. The SIGNAL for coredump is SIGSEGV
> 
> There is no "SIGNAL for coredump". There are signals (e.g. SIGABRT,
> SIGFPE, SIGSEGV, SIGTRAP, SIGIOT) which will generate a core dump if not
> caught or ignored. See signal(7) for details.
> 
> What you might do is write a wrapper around an application you'd like to
> monitor which forks and execs the application and waits for the
> application to finish. It then picks up the exitstatus (using wait(2))
> and analyses the exitstatus. I can vaguely remember that the exitstatus
> contains a flag which indicates whether a core dump was written or not.
> Unfortunately, I cannot find this. Perhaps others can fill in.
> 
> --
> Josef M�llers (Pinguinpfleger bei FSC)


Regards,
-- 
Rosimildo da Silva            [EMAIL PROTECTED] 
ConnectTel, Inc.              Austin, TX -- USA      
Phone : 512-338-1111          Fax : 512-918-0449     
Mobile: 512-632-7579                                 
Company Page: http://www.connecttel.com              
Home Page: http://members.xoom.com/rosimildo/

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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: purify and memory managers
Reply-To: [EMAIL PROTECTED]
Date: Wed, 30 Aug 2000 22:57:01 GMT

On 30 Aug 2000 17:14:20 -0400, Paul D. Smith <[EMAIL PROTECTED]> wrote:
>  jrvz> Electric Fence (efence) works without relinking, by putting a
>  jrvz> special shared library at the beginning of the relevant search
>  jrvz> path.
>
>Yep, that's cool on systems that support it.  It doesn't catch all the
>different situations that a tool like Purify, which instruments the
>actual object code, can though.
>
>Of course, instrumenting the object code is a tricky business and makes
>the tool very difficult to port to new architectures... so...

There is a bounds checking patch for GCC, which instrument the intermediate
code rather than the object code.  Bounds checking GCC is a good tool, except
that it doesn't support C++, I have no clue how the threading support is, if
any, and it won't work in the straightforward way with with code that uses
setjmp and longjmp (the workaround is to put setjmp and longjmp
code into an unchecked module).

Bounds checking GCC can do something that is probably out of the reach of
Purify; it can detect the bad pointer arithmetic that generates an invalid
pointer. Thus it can find obscure portability problems, like code which
increments a pointer out of bounds and then back within bounds.

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

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


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