Linux-Development-Sys Digest #240, Volume #8 Sat, 28 Oct 00 14:13:21 EDT
Contents:
Re: advice needed on process hierarchies (Lew Pitcher)
[Q] malloc() in signal handler ("����ö")
2.4-pre6/8 crashes, USB/webcam/video4linux problem? ([EMAIL PROTECTED])
Re: [Q] malloc() in signal handler (Nick Maclaren)
Re: Acer CD-rewriter (Kasper Dupont)
Re: using /linuxrc (Peter Pointner)
Re: Multiple groups per file (Chris J/#6)
Re: Acer CD-rewriter (Willie)
Genereting interrupt ("niko")
Re: rebooting linux without physikal reset (Kasper Dupont)
Re: mounted dos partition (Kasper Dupont)
Re: can an Eth driver bug affect X-Server? (Kasper Dupont)
Re: can an Eth driver bug affect X-Server? (Mike McDonald)
Kernel API (Mazlan Mat)
Re: rebooting linux without physikal reset (Philip Armstrong)
Re: [Q] malloc() in signal handler (Philip Armstrong)
g++ compiler with templates ("Michael Kooiman")
Re: udp bind and sendto problem ([EMAIL PROTECTED])
----------------------------------------------------------------------------
From: Lew Pitcher <[EMAIL PROTECTED]>
Subject: Re: advice needed on process hierarchies
Date: Fri, 27 Oct 2000 20:59:41 -0400
Nix wrote:
>
> [EMAIL PROTECTED] (Alexander Viro) writes:
>
> > In article <8t342a$9v7$[EMAIL PROTECTED]>,
> > Richard Lim <[EMAIL PROTECTED]> wrote:
> > >Advice needed on the following:
> >
> > [snip the homework assignment]
> >
> > >please advice on the solution.
> > >I am not able to derive a solution for this one.
> > >Is there a simple algorithms to follow to generate the C code to create the
> > >process hierarchy of any kind.
> >
> > comp.unix.do.my.homework is -> that way. Alternatively, you could try
> > to read the manpage of fork() and think for a couple of minutes.
>
> It's a bloody useless assignment, too; nobody calls fork() and then
> keeps going down the same path they left,
Not true, but the common use of fork() also includes exec()...
However, the code to create a daemon uses a fork() _without_ an exec(),
and does "keep going down the same path they left"
> so this assignment isn't even
> teaching a common idiom.
>
> I diagnose `Crap Course Syndrome'... although compared to the C course I
> saw once that suggested using chars rather than ints wherever possible
> because `there are fewer bits to manipulate so it is faster'...
No comment
> Most training courses are just GIGO in action, I think.
No comment
> --
> `Normally, we don't do people's homework around here, but Venice
> is a very beautiful city, so I'll make a small exception.'
> --- Robert Redelmeier compromises his principles
--
Lew Pitcher
Master Codewright and JOAT-in-training
------------------------------
From: "����ö" <[EMAIL PROTECTED]>
Subject: [Q] malloc() in signal handler
Date: Sat, 28 Oct 2000 19:20:19 +0900
Can malloc() be safely called inside signal handler function?.
In GNU C Library reference manual, this book say that it's safe,
because SIGNAL is disabled in malloc of GNU system.
But sometimes I got segmentation fault when I call malloc inside
signal handler. my handler function is like below.
--
void handler()
{
ptr = malloc(10); <-- SEGV occured here. ASSERT didn't called.
ASSERT( ptr != NULL, "alloc failed");
}
--
As you see, SEGV is occured inside malloc functions.
Is the manual wrong? or something am I wrong?. and tell me
the way to safely use malloc() inside handler function.
------------------------------
From: [EMAIL PROTECTED]
Crossposted-To: comp.os.linux.setup,comp.os.linux.x,comp.os.linux.hardware
Subject: 2.4-pre6/8 crashes, USB/webcam/video4linux problem?
Date: 28 Oct 2000 10:38:52 GMT
Hi folks! I recently bought a Philips Vesta Pro USB webcam. I
downloaded the drivers (kernel modules) for Linux from
www.smcc.demon.nl/webcam/
but I get only one picture from the cam, then Linux crashes(freezes)
totally. (sorry for all the cross-posting, but I am (almost) desperate
now...)
I have read the FAQ, searched Usenet and the web and I also just emailed
the author of the webcam driver for Linux. I thought it could be useful
to forward my email to some Linux newsgroups in case someone here knows
a solution. By the way, does anyone know when kernel 2.4-pre10 comes out?
The driver programmer recommends using version pre6 since pre9 has buggy
USB code, but he also says that he heard pre10 has fixed the problems in
pre9. And no, I would rather not revert back to the 2.2.* kernel tree
and do backpatches... Well, here comes the email with all the info:
===========
Hi! I have recently bought a Philips Vesta Pro webcam and
I am trying to make it function under Linux (it works in
WinBloat 98). The details are below, but to summarize, I
can get one image from the cam using camstream or xawtv, then
the system freezes up totally and I have to reboot using
the reset button. I have searched the info on your site, Usenet,
the web, but cannot solve this. Maybe you can help?
My system: RedHat (6.2?), KDE, kernels 2.4-pre6 (also tried pre8
with the same result), version 2.4.0 test 6 of your webcam modules.
HW: Celeron 450A on an Abit BH6 (BX chipset) mobo, 128MB RAM,
Matrox G400 32MB with TV out. My version of XFree is the default,
i.e. not XFree 4.*, if that is important.
I modprobe videodev, audio, your usb-pwc, usb-uhci, no error
messages.
The LED on the cam lights up when modprobing usb-uhci.
If i do a cat /dev/video, the system freezes totally.
My video device files look like this:
==========================
[ale@hlecter /tmp]$ ls /dev/vi*
lrwxrwxrwx 1 root root 6 Jun 13 22:54 /dev/video ->
video0
crw------- 1 ale root 81, 0 Jan 28 2000 /dev/video0
crw------- 1 ale root 81, 1 Jan 28 2000 /dev/video1
===================================
lsmod listing:
[root@hlecter usb]# lsmod
Module Size Used by
usb-pwc-5.06-p6-up 164448 0
usb-uhci 22960 0 (unused)
audio 41088 0 (unused)
usbcore 30144 0 [usb-pwc-5.06-p6-up usb-uhci audio]
videodev 4736 1 [usb-pwc-5.06-p6-up]
===================================
caminfo output:
Detected 1 Video4Linux devices.
VideoDevice supports Framerate setting.
CVideoDevice::Open(/dev/video0, 1): using select() and using mmap(). Initial size
(352x288)
Device node : /dev/video0
Name of device : Philips 680 webcam
Minimum size : 128x96
Current size : 352x288
Maximum size : 640x480
CVideoDevice::Close(): last close.
Segmentation fault (core dumped)
OK, thanks in advance!
/Erik Alap��
------------------------------
From: [EMAIL PROTECTED] (Nick Maclaren)
Subject: Re: [Q] malloc() in signal handler
Date: 28 Oct 2000 11:44:28 GMT
In article <8te9df$loc$[EMAIL PROTECTED]>,
����ö <[EMAIL PROTECTED]> wrote:
>Can malloc() be safely called inside signal handler function?.
>In GNU C Library reference manual, this book say that it's safe,
>because SIGNAL is disabled in malloc of GNU system.
>
>But sometimes I got segmentation fault when I call malloc inside
>signal handler. my handler function is like below.
>
>--
>void handler()
>{
> ptr = malloc(10); <-- SEGV occured here. ASSERT didn't called.
> ASSERT( ptr != NULL, "alloc failed");
>}
>--
>
>As you see, SEGV is occured inside malloc functions.
>Is the manual wrong? or something am I wrong?. and tell me
>the way to safely use malloc() inside handler function.
No. You can't do ANYTHING significant inside a signal handler safely.
That is what ISO C and POSIX say, and regrettably it corresponds with
the miserable state of most implementations. GNU is one of the more
signal-friendly, but even it is not safe. The techniques for making
it safe were well-known 25 years ago, but got forgotten when the
UNIX etc. revolution threw away the experience of previous decades.
The problem has little to do with your signal handler, and little
more to do with malloc, but a great deal to do with what was going
on when the signal occurred. I could go into horrible detail about
the problem, though I am no expert on the GNU language system and
library.
It is largely (though not perfectly) soluble, and I have done so
once and been a consultant on another project that did so. Neither
were for Unix, but the principles are the same. As far as I know,
no Unix system is much better than GNU in this respect.
Regards,
Nick Maclaren,
University of Cambridge Computing Service,
New Museums Site, Pembroke Street, Cambridge CB2 3QG, England.
Email: [EMAIL PROTECTED]
Tel.: +44 1223 334761 Fax: +44 1223 334679
------------------------------
From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: Acer CD-rewriter
Date: Sat, 28 Oct 2000 13:54:54 +0200
Willie wrote:
>
> I am getting the message buffer underrun while trying to copy a disc. I
> have no idea what this is caused from. The re-writer was working fine in
> another case but will not copy after changing cases. It says not able to
> read fast enough. Any ideas would be appreciated. Thanks Willie
>
> --
> Posted via CNET Help.com
> http://www.help.com/
I find the question a little bit difficult to understand.
Asuming i understood it correctly here is the answer:
Copying directly from one CD to another is quite risky,
instead you should copy the CD into a file on your
harddisk and then write this image onto the CD. You can
also try writing at a lower speed, if you are using
cdrecord try giving a "speed=1" argument, I don't know
about other recording programs.
--
Kasper Dupont
------------------------------
From: Peter Pointner <[EMAIL PROTECTED]>
Subject: Re: using /linuxrc
Date: 28 Oct 2000 10:05:21 +0200
[EMAIL PROTECTED] wrote:
> On 26 Oct 2000 23:40:02 +0200 Peter Pointner <[EMAIL PROTECTED]> wrote:
> |> Why do you need to have inetd start before init starts? Just curious.
> |> IWSTM that you can just start everything from init if you are already
> |> mounted on the final / filesystem. I'll be using /linuxrc to build
> |> that / filesystem.
> |
> | Because init never starts. :-)
> | It is an embedded system, I use the initial ramdisk as final file system,
> | and linuxrc never ends. I don't need init, but I do need inetd.
> The /linuxrc doesn't start as PID 1. The kernel starts a new process to
> run /linuxrc from, with PID 1 waiting for it to end. If /linuxrc then
> executes init, won't init be running as some other PID?
My /linuxrc does not execute init. init never gets started, I simply don't
need it for this embedded system.
Peter
------------------------------
From: [EMAIL PROTECTED] (Chris J/#6)
Subject: Re: Multiple groups per file
Reply-To: [EMAIL PROTECTED]
Date: 28 Oct 2000 13:58:17 +0100
>
>'Scuse my ignorance, but why would you want multiple groups
>per file? Can't you just create new groups that are the
>appropriate union sets of users? I don't know if /etc/group
>will accept group names to make this easier. (groups of groups)
>
>-- Robert
Well we've got a groups-of-groups setup, however to my knowledge
/etc/group won't accept groups in the users list (someone correct me if
I'm wrong :)
Why? Well its a corporate file server, and each user is in a group
appropriate to a department (development, typing, management, admin,
...), and there are about 8 departmental groups. When managing projects
there are some directories we'd like typing to have read-write access
to but others just read, some where everyone should write, some where
only two departments should write etc etc...you can see the state it
could get to...think of the number of combinations of 8 groups as an
extreme (yet unrealistic admittedly) example.
After a while, as it is we have about 5 group amalgamations, and it ain't
pretty (~50 users a group). I'd use ACL except that the ACL project for
Linux says "we don't know if its SMP safe ...". Unfortuantly we have an
SMP machine, and I'd rather not risk the machine (we do have backups, but
if the ACL patch knocks the machine out, a lot of people can't work, and
it'll take a day to get back up).
So...we have an untidy mess of group amalgamations. I can see the reason
for multiple groups on a file, but currently the only practical way is
ACL's, and they aren't ready for production machines yet...
Chris...
--
Chris Johnson \ "If not for me then, do it for yourself. If not
[EMAIL PROTECTED] \ for then do it for the world." -- Stevie Nicks
www.nccnet.co.uk/~sixie/ ~---------------------------------------+
Redclaw chat - http://redclaw.org.uk - telnet redclaw.org.uk 2000 \______
------------------------------
From: Willie <[EMAIL PROTECTED]>
Subject: Re: Acer CD-rewriter
Date: Sat, 28 Oct 2000 14:30:04 -0000
Kasper Dupont wrote:
>
> Willie wrote:
> >
> > I am getting the message buffer underrun while trying to copy a disc. I
> > have no idea what this is caused from. The re-writer was working fine
in
> > another case but will not copy after changing cases. It says not able
to
> > read fast enough. Any ideas would be appreciated. Thanks Willie
> >
> > --
> > Posted via CNET Help.com
> > http://www.help.com/
>
> I find the question a little bit difficult to understand.
> Asuming i understood it correctly here is the answer:
>
> Copying directly from one CD to another is quite risky,
> instead you should copy the CD into a file on your
> harddisk and then write this image onto the CD. You can
> also try writing at a lower speed, if you are using
> cdrecord try giving a "speed=1" argument, I don't know
> about other recording programs.
>
> --
> Kasper Dupont
--
Posted via CNET Help.com
http://www.help.com/
------------------------------
Reply-To: "niko" <[EMAIL PROTECTED]>
From: "niko" <[EMAIL PROTECTED]>
Subject: Genereting interrupt
Date: Sat, 28 Oct 2000 14:39:05 GMT
Hello All !
I need generate some interrupts.
And I want to know are there any functions like MS$ geninterrupt(), int86(),
.... etc
BR,
niko
------------------------------
From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: rebooting linux without physikal reset
Date: Sat, 28 Oct 2000 18:03:31 +0200
Daniel Goergen wrote:
>
> Is it possible to reboot linux without letting the computer make a
> physical reset?
> (I have to store data in RAM (we have no FS) before und read it after
> the reboot)
I think, what you want is something like LOADLIN runing
under Linux. I think it would be possible, but I don't
think anyone has made it yet.
--
Kasper Dupont
------------------------------
From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: mounted dos partition
Date: Sat, 28 Oct 2000 18:15:45 +0200
Raymond Mroz wrote:
>
> Hello,
>
> We are running a Linux OS in a product and are required to access a FAT32
> filesystem. This is set up to mount in the fstab file. My question is
> this: If the product is repeatedly and ungracefully shutdown, can the FAT32
> filesystem which is being mounted (and ungracefully unmounted) become
> corrupted over time. Are there any other problems which may arise?
>
> Thanks
>
> Raymond Mroz
Most filesystems including ext2, fat12, fat16
and presumably fat32 can get correupted if
the system is not shut down cleanly.
Normally the solution used is to run a program
detecting and correcting the problem at next
bootup.
Such a program is used both under recent
Windows versions and Linux. Some Linux
distributions only includes a program for
doing this on ext2 filesystems.
You need a program for doing this
verification on a fat32 system. And you need
to enable this verification in the fstab file.
The most often seen error on fat12 and fat16
is lost clusters, there might be others on
fat32.
--
Kasper Dupont
------------------------------
From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: can an Eth driver bug affect X-Server?
Date: Sat, 28 Oct 2000 18:21:39 +0200
[EMAIL PROTECTED] wrote:
>
> Hello,
> I am writing a driver for an Ethernet card (for x86 arch, testing on
> Kernel 2.2.14). When I leave an app in the GUI terminal, exercising
> this driver, running overnight, eventually the
>
> /etc/X11/X (-->/usr/X11R6/bin/XF86_SVGA)
>
> crashes and the GUI env exits.
>
> Could this be due to my driver bug, or should I report dutifully this
> error to the X developers, as requested?
>
> Thank you,
>
> Mark Galecki
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Since the driver is runing in kernel mode a bug
can have _any_ effect. The following information
could help locating the bug: Does the system
work after the bug occured or is a reboot necesarry?
What output does the X server write, what does
/var/log/messages have to say?
--
Kasper Dupont
------------------------------
Reply-To: [EMAIL PROTECTED]
From: [EMAIL PROTECTED] (Mike McDonald)
Subject: Re: can an Eth driver bug affect X-Server?
Date: Sat, 28 Oct 2000 17:07:45 GMT
In article <[EMAIL PROTECTED]>,
Kasper Dupont <[EMAIL PROTECTED]> writes:
> [EMAIL PROTECTED] wrote:
>>
>> Hello,
>> I am writing a driver for an Ethernet card (for x86 arch, testing on
>> Kernel 2.2.14). When I leave an app in the GUI terminal, exercising
>> this driver, running overnight, eventually the
>>
>> /etc/X11/X (-->/usr/X11R6/bin/XF86_SVGA)
>>
>> crashes and the GUI env exits.
>>
>> Could this be due to my driver bug, or should I report dutifully this
>> error to the X developers, as requested?
>>
>> Thank you,
>>
>> Mark Galecki
>>
>> Sent via Deja.com http://www.deja.com/
>> Before you buy.
>
> Since the driver is runing in kernel mode a bug
> can have _any_ effect. The following information
> could help locating the bug: Does the system
> work after the bug occured or is a reboot necesarry?
> What output does the X server write, what does
> /var/log/messages have to say?
>
If the driver was passing corrupted packets to the X server, a crash is very
likely. X assumes a reliable byte stream. If your driver isn't providing that,
then all bets are off.
Mike McDonald
[EMAIL PROTECTED]
------------------------------
From: Mazlan Mat <[EMAIL PROTECTED]>
Subject: Kernel API
Date: Sun, 29 Oct 2000 01:27:29 +0800
Hello there
If i use one of the kernel include file, what flag shoud i use to
compile the
code. In my case i'm using pci.h
Thanks
------------------------------
From: [EMAIL PROTECTED] (Philip Armstrong)
Subject: Re: rebooting linux without physikal reset
Date: 28 Oct 2000 18:13:28 +0100
In article <[EMAIL PROTECTED]>,
Kasper Dupont <[EMAIL PROTECTED]> wrote:
>Daniel Goergen wrote:
>> Is it possible to reboot linux without letting the computer make a
>> physical reset?
>> (I have to store data in RAM (we have no FS) before und read it after
>> the reboot)
>I think, what you want is something like LOADLIN runing
>under Linux. I think it would be possible, but I don't
>think anyone has made it yet.
Its possible that the two-kernel monte available from
http://www.scyld.com/ might do what you want...
Phil
--
http://www.kantaka.co.uk/ .oOo. public key: http://www.kantaka.co.uk/gpg.txt
------------------------------
From: [EMAIL PROTECTED] (Philip Armstrong)
Crossposted-To: comp.arch
Subject: Re: [Q] malloc() in signal handler
Date: 28 Oct 2000 18:12:11 +0100
In article <8tee6s$a86$[EMAIL PROTECTED]>,
Nick Maclaren <[EMAIL PROTECTED]> wrote:
>No. You can't do ANYTHING significant inside a signal handler safely.
ouch.
>That is what ISO C and POSIX say, and regrettably it corresponds with
>the miserable state of most implementations. GNU is one of the more
>signal-friendly, but even it is not safe. The techniques for making
>it safe were well-known 25 years ago, but got forgotten when the
>UNIX etc. revolution threw away the experience of previous decades.
Yurk. A little reading reveals that you can't call *any* function
safely in a signal handler. Which I guess makes sense. You get bitten
by re-entrancy problems. eg If you get a signal when you're in the
middle of a malloc() then calling malloc() in your signal handler is
almost guaranteed to corrupt your heap.
So would you have time to expand on how signals can be made safe? Or
point to a suitable on line resource? Maybe this thread should shift
to comp.arch...folowups set.
Phil
--
http://www.kantaka.co.uk/ .oOo. public key: http://www.kantaka.co.uk/gpg.txt
------------------------------
From: "Michael Kooiman" <[EMAIL PROTECTED]>
Subject: g++ compiler with templates
Date: Sat, 28 Oct 2000 19:47:54 +0200
Hi,
I'm writing a C++ text/based program on Caldera linux.
I'm getting trouble when trying to compile the source code and having a
general template function
in it.
The function is a friend of the class.
Like:
template<class Type>
ostream& operator<<(ostream& stream, Array<T>& array)
{
for (int i=0; i<array.getSize(); i++)
stream << array[i]; // ofcourse overloaded the subscript
operator in the Array class.
return stream;
}
I get the message while compiling:
Using template without type. .. and some more.
Is there a special commandline option to turn on template support on of the
compiler ?
if anyone knows more, i'd appreciate some help here.
Best regards,
Michael
'You're never fully dressed, until you wear a smile'
[EMAIL PROTECTED]
www.softwareengineer.demon.nl
------------------------------
From: [EMAIL PROTECTED]
Subject: Re: udp bind and sendto problem
Date: Sat, 28 Oct 2000 17:44:40 GMT
sorry i forgot to include that "little detail"
errno is set to 22 which is EINVAL, im pretty sure.
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] () wrote:
> In article <8tcbuj$ssf$[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
wrote:
>
> >success = sendto(fd, message, message_length, 0,
> > &saddr, sizeof(saddr);
> >// success returns -1.
>
> What is errno set to at this point?
>
> --
> http://www.spinics.net/linux
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
** 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
******************************