Linux-Development-Sys Digest #591, Volume #8     Tue, 27 Mar 01 02:13:08 EST

Contents:
  qlogic target mode linux driver  (pepehead)
  Which video API? (Florian Echtler)
  copy_to_user() problem ([EMAIL PROTECTED])
  Re: 2.4.2, loopback, and lockups ("Peter T. Breuer")
  Re: Too many open files error (Micah Cowan)
  ALS 2001 Call for Papers (Becca Sibrack)
  Re: A couple of newbie questions ("Rich")
  Re: pthreads and shared objects ("Lawrence K. Chen, P.Eng.")
  Re: look for a linux software which like the Visual Source Safe(VSS) ("Lawrence K. 
Chen, P.Eng.")
  Re: look for a linux software which like the Visual Source Safe(VSS) (Grant Edwards)
  Re: do {.....} while(0); in macro definitions ([EMAIL PROTECTED])
  Re: 2.4.2, loopback, and lockups ([EMAIL PROTECTED])
  memcpy and strcpy problem! ("Sean Xu")
  Re: kernel problem (Werner =?iso-8859-1?Q?K=FChnert?=)

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

From: pepehead <[EMAIL PROTECTED]>
Subject: qlogic target mode linux driver 
Date: Mon, 26 Mar 2001 10:26:35 -0500
Reply-To: see above

Does anyone know about getting port information for an inititator HBA
in qlogic target mode linux driver ?  I am using the get_port_database
routine supplied by the driver however it seems that with multple
calls to this routine I will stop getting intrps and I stop getting
completions and the hba is hung.

Please help,
Thanks - Stephen
[EMAIL PROTECTED]

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

From: Florian Echtler <[EMAIL PROTECTED]>
Subject: Which video API?
Date: Mon, 26 Mar 2001 17:32:41 +0200

Hello everyone,

I'm currently planning a little program which needs to capture images from
a TV card. Now I'm a little confused about the different video APIs that
exist: AFAIK, this is currently, Video4Linux 1 + 2, the native kernel
functions and Xvideo which comes with XFree 4.0. Now, which one of these
would be appropriate - perhaps Xvideo, as it will possibly last longer
than the rest?

Thanks in advance and
Goodbye, Florian
--
Florian Echtler - [EMAIL PROTECTED]
Skriptenreferat - Fachschaft MPI


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

From: [EMAIL PROTECTED]
Subject: copy_to_user() problem
Date: Mon, 26 Mar 2001 16:36:55 GMT

Hello all,

For those who don't want to read this long text, my main question is:
=====I'm wondering what reasons copy_to_user() has not to finish it's
work-----

I am working in kernel 4.2.2

I have written kernel code that is working pretty stable (no crashes).
But I have this annoying bug I just can't figure out:

My code can talk with userspace (my userspace program), and for a
certain period userspace receives the data without problems.
First userspace asks the kernel how much space to allocate. Then
userspace asks the kernel to copy the info.

Userspace needs to get a database from kernel. This database can only
grow. 
When the database has about 166 entries (database size is then
sizeof(struct epf_dbentry)*166 = 40*166) copy_to_user() returns a
non-zero value. 166 is just the lowest value I have had this problem
on until now, nothing special about it as far as I know.

See bottom for a cut from userspace and kernel code...

These are some facts (I am sure of them):
- userspace allocates the right amount of memory.
- i can print the whole database on the screen in the kernel and the
information doesnt give strange data. Also ofcourse I've checked and
checked to be sure that the allocated kernel memory is enough.
- nr.nentries (--userspace--)== *len (--kernel--) (this makes me be
sure of point 1)
- all memory in the kernel gets allocated with vmalloc()


I am puzzled. This mainly because my kernel doesn't crash, and this
database (flowdb) is looked at and (sometimes) updated everytime a
packet arrives, so all the time.
Also I just don't understand why copy_to_user() doesn't copy the whole
thing. Even if I didn't allocate enough memory then my kernel should
crash, but it doesn't. Except from this problem the kernel is acting
like a good boy.
I'm wondering what reasons copy_to_user() has not to finish its
work...

If my userspace program is causing the problems then I am totally
stunned because nothing special happens there...

*sigh*

Bart

If you are interested, here you can find the userspace program and a
patch vs kernel 4.2.2:
http://users.pandora.be/bart.de.schuymer/brepf/


==============
kernel part
==============

if (copy_to_user(user, flowdb, (*len) * sizeof(struct epf_dbentry)) !=
0){
        printk("copy_db: copytouser BUG\n");
        for (i = 0; i < dbsize; i++) printk("%d ---", 
        flowdb[i].protocol);
        printk("\n");
        return -EFAULT;
}

==============
userspace part
==============

if ( !(db = (struct epf_dbentry *) malloc(nr.nentries * sizeof(struct
epf_dbentry))) )
        print_error("out of memory");// prints msg and exit(0) 

if (( hlp = getsockopt(sockfd, IPPROTO_IP, EPF_SO_GET_DB, db,
&(nr.nentries)))){
        printf("hlp = %d\n");
        print_error("error: hmm, what is wrong??? bug#2");
}


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

From: "Peter T. Breuer" <[EMAIL PROTECTED]>
Subject: Re: 2.4.2, loopback, and lockups
Date: Mon, 26 Mar 2001 18:50:08 +0200

Kent A Vander Velden <[EMAIL PROTECTED]> wrote:
>   Since updating to 2.4.x, I have been experiencing lockups whenever I 
> use the lookback device for mounting iso images.  This on an SMP 

This is not surprising, as loop is broken in 2.4. I believe it's due
for final fixes in 2.4.3.

> machine if that makes any difference.  I have not experimented much
> with this, but wondered if someone had already discovered a solution.

Peter

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

Crossposted-To: comp.os.linux,comp.os.linux.development.apps,comp.os.linux.networking
Subject: Re: Too many open files error
From: Micah Cowan <[EMAIL PROTECTED]>
Date: 26 Mar 2001 09:53:29 -0800

"David K. Means" <[EMAIL PROTECTED]> writes:

> It is probably worth finding out why there are so many open files.
> I recently cleaned out a hacked system, which had exactly this symptom
> because the hacker was a script-kiddie, and my machine didn't fit his
> script exactly.  So bind was eating up lots of sockets.
> 
> So when you get the machine working again, it might be worthwhile to look
> for evidence of hackery:  on my machine it was the existence of
> /dev/.lib/lib/*
> and a missing /etc/hosts.deny.

s/hack/crack/, please.

-Micah

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

From: Becca Sibrack <[EMAIL PROTECTED]>
Subject: ALS 2001 Call for Papers
Date: Mon, 26 Mar 2001 11:39:48 -0800

5th Annual Linux Showcase & Conference (ALS 2001)
November 6-10, 2001
Oakland, CA USA
http://www.linuxshowcase.org

Sponsored by USENIX and the Atlanta Linux Showcase, Inc., 
in cooperation with Linux International

Now in its firth year, the Annual Linux Showcase & Conference 
http://www.linuxshowcase.org continues its remarkable development 
as the premier technical Linux conference, attracting expert talks on 
everything from kernel internals to Internet services, panels 
discussing the state of the Kernel, invited talks presenting 
Linux in the real world, and more. 

And this year, ALS breaks with tradition by moving out of 
Atlanta to Oakland, CA! 

The ALS 2001 Program Committee invites you to contribute your 
ideas, proposals, and papers for tutorials, invited talks program, 
refereed papers track, workshops, work-in-progress reports, and 
symposia tracks. We welcome submissions that address any and 
all issues relating to Linux and the Open Source world. 

The Call for Papers with submission guidelines and suggested 
topics is now available at http://www.linuxshowcase.org

Submissions are due June 5, 2001

Please join us and participate in the premier technical conference 
for Linux enthusiasts and professionals! We look forward to seeing
you in the San Francisco Bay Area in November 2001!

===============================================================
5th Annual Linux Showcase & Conference (ALS 2001) is
is sponsored by USENIX, the Advanced Computing Systems 
Association, and the Atlanta Linux Showcase, in cooperation 
with Linux International.
===============================================================

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

From: "Rich" <[EMAIL PROTECTED]>
Subject: Re: A couple of newbie questions
Date: Mon, 26 Mar 2001 21:41:11 GMT

In article <[EMAIL PROTECTED]>, "Quiney, Philip
[HAL02:HH00:EXCH]" <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> Check out the following link.... http://lxr.linux.no/
> 
> This site cross references the Linux kernel source code. You can do an
> identifier search for __u32 and see what it is defined as and where it
> is referenced.
> 
> I tried this for __u32 - it appears to be definined as 'unsigned int' on
> the Intel platform - there appears to be a platform specific definition
> for each supported architecture.
> 
> Regards
> 
> Phil Q
> 


Thanks, Phil.  Your input is greatly appreciated!
I'm checking out the link as we 'speak'.

Rich

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

From: "Lawrence K. Chen, P.Eng." <[EMAIL PROTECTED]>
Subject: Re: pthreads and shared objects
Date: Mon, 26 Mar 2001 16:41:50 -0500

Try using '-fpic'

I don't remember when or why, but last year I had a problem with -lrt...which
I traced as a problem inside of pthread_create()....

I was using -fPIC, but somewhere I accidentally left it out...and suddenly
everything started working again....later with some experimentation I found
that '-fpic' worked....so that's what I use for my shared libraries.

Liviu Nicoara wrote:
> 
> Hi,
> 
> I am playing with pthreads library and I am stuck with creating a class
> library to wrap some of the pthreads API. Purpose: to have a class
> /classes that wrap pthreads API. The .so library compiles fine but
> pthread_create fails in pthread_allocate_stack (SIGSEGV) when run as
> root. When run as regular user the errno is 1 which is operation not
> permitted.  Any insight about classes exported from .so and pthreads?
> Any obvious (for you) faults?
> Compilation flags for both library and test app are:
> -fPIC -D_REENTRANT
> Link flags:
> -fPIC
> 
> TIA

-- 
   Who: Lawrence Chen, P.Eng.                     Email: [EMAIL PROTECTED]
  What: Software Developer                        Phone: 614-761-7449
 Where: Open Text, BASIS Division                   Fax: 614-761-7269
        5080 Tuttle Crossing Blvd., M/S 7&8         ICQ: 12129673
        Dublin, OH  43016                URL: http://www.opentext.com/basis
 DISCLAIMER: All opinions expressed are mine and *NOT* my employers

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

From: "Lawrence K. Chen, P.Eng." <[EMAIL PROTECTED]>
Subject: Re: look for a linux software which like the Visual Source Safe(VSS)
Date: Mon, 26 Mar 2001 16:49:35 -0500

Do you need something like source safe running on Linux, or just access to a
SourceSafe repository from Linux?

I seem to recall that there was a company that made a remote sourcesafe access
client (for accessing SourceSafe DBs over the Internet....useful for
distributed software companies 8-)....that ran on Solaris and Linux.

www.sourceoffsite.com ???

I think its even graphical...because I seem to recall being asked to install
GTK and stuff on our Sun box for its evaluation.

Leo Naboro wrote:
> 
> goodevening every,i wanna look for a linux software which like the Visual
> Source Safe(VSS)under windows98(NT).it both manage the source codes and
> libs,i know that the CVS is very useful source contol.But our boss
> need the libs contol also...So does anyone tell me how to do it? Thanks!

-- 
   Who: Lawrence Chen, P.Eng.                     Email: [EMAIL PROTECTED]
  What: Software Developer                        Phone: 614-761-7449
 Where: Open Text, BASIS Division                   Fax: 614-761-7269
        5080 Tuttle Crossing Blvd., M/S 7&8         ICQ: 12129673
        Dublin, OH  43016                URL: http://www.opentext.com/basis
 DISCLAIMER: All opinions expressed are mine and *NOT* my employers

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

From: [EMAIL PROTECTED] (Grant Edwards)
Subject: Re: look for a linux software which like the Visual Source Safe(VSS)
Date: Mon, 26 Mar 2001 22:57:47 GMT

In article <[EMAIL PROTECTED]>, Lawrence K. Chen, P.Eng. wrote:

>Do you need something like source safe running on Linux, or
>just access to a SourceSafe repository from Linux?
>
>I seem to recall that there was a company that made a remote
>sourcesafe access client (for accessing SourceSafe DBs over the
>Internet....useful for distributed software companies
>8-)....that ran on Solaris and Linux.
>
>www.sourceoffsite.com ???

http://www.sourcegear.com/SOS

>I think its even graphical...because I seem to recall being
>asked to install GTK and stuff on our Sun box for its
>evaluation.

Yup. I use it quite regularly. The GUI is layed out very much
like the VSS GUI under windows.  It works quite nicely: you
have to run an SOS server app on a Win32 machine somewhere,
then the SOS client runs under Unix.  IIRC, there's a
command-line app also, but I always run it in GUI mode.

It's not free -- you have to buy a license for the server app.

-- 
Grant Edwards                   grante             Yow!  -- In 1962, you could
                                  at               buy a pair of SHARKSKIN
                               visi.com            SLACKS, with a "Continental
                                                   Belt," for $10.99!!

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

From: [EMAIL PROTECTED]
Subject: Re: do {.....} while(0); in macro definitions
Date: Tue, 27 Mar 2001 00:34:38 -0000

To the OP:

This is also a useful C language construct to use "break;" in one or
more places inside a block to escape from that block.  A plain {} block
does not act as a loop layer and "break;" would apply to any containing
loop block.  But with "do {...} while(0)" you can code a "break;" in
the block anywhere to escape from that block to the statement that
follows the block, or in the case of a block that is the _statement_
between "if" and "else", to the statement following the whole if/else
construct (as far as it may be carried out).  It overcomes C's lack
of a block escape statement, but without using gotos which could let
programmers make a mess of things.

One use of such a contruct would be like:

int some_function(...)
{
    do {
        ...
        if (some_condition) break;
        ...
        if (some_condition) break;
        ...
        if (some_condition) break;
        ...
   } while(0);

   /* cleanup code goes here */
   return 0;
}

Which would allow testing a series of conditions to return from the function
in such a way that cleanup code is executed before the return is actually
done, without having to code duplicate cleanup code for each condition in
the main block (usually looks ugly, and for large code can be hard to debug,
although a good compiler will arrange it so there is only one piece of
cleanup code anywaym, if it is all the same, which the above example will
make obvious to C programmer reading it).


On Mon, 26 Mar 2001 02:34:41 -0600 Arthur H. Gold <[EMAIL PROTECTED]> wrote:
| Kiran wrote:
|> 
|> Hi,
|> Why do macros coded in the linux kernel usually expand to:
|> do {......} while(0);
|> form?? why not just :
|> {.....} ??
|> 
|> For eg., quoting a code snippet from spinlock.h,
|> #define spin_lock_irqsave(lock, flags)         do { local_irq_save(flags);\
|>  spin_lock(lock); } while (0)
|> 
|> could've been
|> #define spin_lock_irqsave(lock,flags) {local_irq_save(flags); \
|> spin_lock(lock); }
|> 
| Consider the following code:
| if ( some_condition ) 
|   spin_lock_irqsave( lock, flags );
| else { }
|
|
| If we use the `do ... while (0)' wrapper, we get this (which
| is correct)
|
| if (some_condition)
|   do
|     {
|       local_irq_save (flags);
|       spin_lock (lock);
|     }
|   while (0);
| else
|   {
|   }
|
|
| If we don't....we get this (which isn't)
|  
| if (some_condition)
|   {
|     local_irq_save (flags);
|     spin_lock (lock);
|   }; /* note the spurious `;' */
| else
| {
| }        
|
|
| HTH,
| --ag
| -- 
| Artie Gold, Austin, TX  (finger the cs.utexas.edu account
| for more info)
| mailto:[EMAIL PROTECTED] or mailto:[EMAIL PROTECTED]
| --
| Clone Bernie!

-- 
=================================================================
| Phil Howard - KA9WGN |   Dallas   | http://linuxhomepage.com/ |
| [EMAIL PROTECTED] | Texas, USA | http://phil.ipal.org/     |
=================================================================

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

From: [EMAIL PROTECTED]
Subject: Re: 2.4.2, loopback, and lockups
Date: Tue, 27 Mar 2001 00:37:45 -0000

On Mon, 26 Mar 2001 18:50:08 +0200 Peter T. Breuer <[EMAIL PROTECTED]> wrote:

| Kent A Vander Velden <[EMAIL PROTECTED]> wrote:
|>   Since updating to 2.4.x, I have been experiencing lockups whenever I 
|> use the lookback device for mounting iso images.  This on an SMP 
|
| This is not surprising, as loop is broken in 2.4. I believe it's due
| for final fixes in 2.4.3.

I have had no trouble doing loopback mounting in 2.4.0.  Has this
just been broken somewhere on the way to 2.4.1 or 2.4.2?  So far
I've had no trouble with 2.4.0, but have avoided 2.4.1 because it
changed the way PPP works to one device and I need more than one
PPP device.

-- 
=================================================================
| Phil Howard - KA9WGN |   Dallas   | http://linuxhomepage.com/ |
| [EMAIL PROTECTED] | Texas, USA | http://phil.ipal.org/     |
=================================================================

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

From: "Sean Xu" <[EMAIL PROTECTED]>
Subject: memcpy and strcpy problem!
Date: Tue, 27 Mar 2001 02:37:54 GMT

After

int bigPhysSize = 1024*1024;
char string[16]="0123456789abce";
void *reserved = ioremap(high_memory,bigPhysSize),
memcpy((char*)reserved,string,16);

if(memcmp((char*)reserved,string,16)
  printk(KERN_WARNING " NOT EQUAL\n");

>> The output is "NOT EQUAL", that surprise me!

I tried to use memcpy, memcmp, none of them seems to works in my case. After
writing my own memcpy.. routines. It did worked out.

But just want to make this thing clear, why the memcpy didn't work in this
case?

Because it is high_memeory reserved by user at start up time?!

Please advice!

Sean





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

From: Werner =?iso-8859-1?Q?K=FChnert?= <[EMAIL PROTECTED]>
Subject: Re: kernel problem
Date: Tue, 27 Mar 2001 08:26:08 +0200

Kasper Dupont wrote:

> When compiling the kernel the symbol table is saved in
> a file named System.map.
>
> I don't know if looking up the outputs from the above
> list will give us any clue about what happens.

I don't know either, but You never know.

> The esp value is for sure wrong, I'm not sure if this
> was the value of ESP before or after the failing IRET
> instruction. (assuming that it really was the IRET
> instruction failing.)
>
> Adding printk("%08X\n",*(unsigned long*)regs->eip));
> should print the failing instruction, it might be nice
> to verify that it is really the IRET.

It is an IRETD (0xcf).

> I'm not sure which interrupt is ariving at this point.
> I would expect a timer interrupt, but some error might
> cause another interrupt to arrive.
>
> Inserting printk() statements in all interrupt handlers
> might reveal which one is actually being executed, that
> might be the only step forward.

Can I find these in irq.c ?

> I do find it strange that you only get one single fixup,
> I would have expected a longer list.

One thing that comes in my mind, my system has a hardware watchdog, it generates a NMI 
when
it counts out. But I have to check that and I will try to disable it.

Before the IRETD, serial_console_write is called several times (which seems logically, 
the
banner is printed). I am not sure if the routine with the IRETD is system_call. At 
least I
can find that in System.map right before C0107A11 (which is the address of the IRETD. 
If it
helps, I can supply a trace before the IRETD.

Regards, Werner K�hnert
--

Werner Kuehnert Siemens AG Oesterreich PSE ECT IPN 1
E-Mail: [EMAIL PROTECTED]



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


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

Reply via email to