Re: ud segfault (was: When will the amd64 port be stable?)

2004-12-12 Thread Ron Johnson
On Sun, 2004-12-12 at 05:18 +, Steve McIntyre wrote:
 David Liontooth [EMAIL PROTECTED] wrote:
 Goswin von Brederlow wrote:
[snip]
 
 The reason for this becomes clear once you turn on warnings in the
 compilation:
 
 gcc -DPACKAGE=\ud\ -DVERSION=\0.7.1\ -DSTDC_HEADERS=1 -DHAVE_UNISTD_H=1 
 -DRETSIGTYPE=void -DHAVE_GETHOSTNAME=1  -I. -I.  -g -O2 -Wall -W -c ud.c
 ud.c: In function `get_kernel_version':
 ud.c:150: warning: implicit declaration of function `ctime'
 ud.c:150: warning: format argument is not a pointer (arg 3)
 
 ctime is returning a pointer rather than an int. Simply adding
 #include time.h to the top of the ud.c source file fixes this
 bug. Prototypes are there for a reason!
 
 Turning on warnings also highlights other silly coding bugs, but I'll
 leave those for other people.

Hey, let's start a flame war about the unnecessary use of C in
non-core functionality!!!

-- 
-
Ron Johnson, Jr.
Jefferson, LA USA
PGP Key ID 8834C06B I prefer encrypted mail.

Adventure is a sign of incompetence
Stephanson, great polar explorer



signature.asc
Description: This is a digitally signed message part


Re: ud segfault (was: When will the amd64 port be stable?)

2004-12-12 Thread Steve McIntyre
[EMAIL PROTECTED] wrote:
On Sun, 2004-12-12 at 05:18 +, Steve McIntyre wrote:
 
 The reason for this becomes clear once you turn on warnings in the
 compilation:
 
 gcc -DPACKAGE=\ud\ -DVERSION=\0.7.1\ -DSTDC_HEADERS=1
-DHAVE_UNISTD_H=1 -DRETSIGTYPE=void -DHAVE_GETHOSTNAME=1  -I. -I. 
-g -O2 -Wall -W -c ud.c
 ud.c: In function `get_kernel_version':
 ud.c:150: warning: implicit declaration of function `ctime'
 ud.c:150: warning: format argument is not a pointer (arg 3)
 
 ctime is returning a pointer rather than an int. Simply adding
 #include time.h to the top of the ud.c source file fixes this
 bug. Prototypes are there for a reason!
 
 Turning on warnings also highlights other silly coding bugs, but I'll
 leave those for other people.

Hey, let's start a flame war about the unnecessary use of C in
non-core functionality!!!

I agree with you, actually. ud is a perfect example of an app where C
is very much the Wrong Thing. From scanning the source, I'd replace it
with a small shell/perl/python script running out cron if I cared
enough for what it does...

-- 
Steve McIntyre, Cambridge, UK.[EMAIL PROTECTED]
We don't need no education.
We don't need no thought control.




Re: ud segfault (was: When will the amd64 port be stable?)

2004-12-12 Thread Ron Johnson
On Sun, 2004-12-12 at 12:39 +, Steve McIntyre wrote:
 [EMAIL PROTECTED] wrote:
 On Sun, 2004-12-12 at 05:18 +, Steve McIntyre wrote:
[snip]
  Turning on warnings also highlights other silly coding bugs, but I'll
  leave those for other people.
 
 Hey, let's start a flame war about the unnecessary use of C in
 non-core functionality!!!
 
 I agree with you, actually. ud is a perfect example of an app where C
 is very much the Wrong Thing. From scanning the source, I'd replace it
 with a small shell/perl/python script running out cron if I cared
 enough for what it does...

At one time, back in my Mandrake days, I had such a python script,
that got daemonized at boot.  Then, every 5 seconds, it updated a
record file.  If you ran it in --client mode, it dumped the 
record of uptimes, by either date or longest uptime.

Got lost in the conversion to Debian, back before Woody, though.

-- 
-
Ron Johnson, Jr.
Jefferson, LA USA
PGP Key ID 8834C06B I prefer encrypted mail.

But a much bigger business is selling anti-spam software. This
is a billion dollar market, and it is rapidly growing. Any simple
and effective solution against spam would defeat revenues and
drive several companies into bankrupt, would make consultants
jobless. ... Have a single, simple, and permanent solution to the
problem and - boom - this billion dollar market is dead. That's
one of the reasons why people are expected to live with spam.
They have to live with it to make them buy anti-spam software.
Content filters are perfect products to keep this market alive.
Hadmut Danisch



signature.asc
Description: This is a digitally signed message part


Re: ud segfault (was: When will the amd64 port be stable?)

2004-12-11 Thread Steve McIntyre
David Liontooth [EMAIL PROTECTED] wrote:
Goswin von Brederlow wrote:

And now the same with -f please. I didn't see a segfault in the starce
and it is probably its child that dies.

You can also compile the ud with debug infos and run it in gdb.

MfG
Goswin
  

Hi Goswin,

So this is not behavior others are seeing? 
I have the pleasure of sending you a thousand EBADF reports below -- 
you're likely only interested in the last few lines:

OK, so I'm bored. I've just looked at the bug and found the
problem. ud's source is quite ugly, suggesting a novice author. I can
recreate the bug quite readily here, and it's crashing down below a
sprintf() call:

(gdb) bt
#0  0x002a956e9980 in strlen () from /lib/libc.so.6
#1  0x002a956b7c75 in vfprintf () from /lib/libc.so.6
#2  0x002a956d6ec5 in vsprintf () from /lib/libc.so.6
#3  0x002a956be50a in sprintf () from /lib/libc.so.6
#4  0x00401340 in get_kernel_version (kernel_version=0x7fb544 
running Linux 2.6.9, IsCurrent=0) at ud.c:150
#5  0x004020c5 in main (argc=1, argv=0x7fb540) at ud.c:822

The reason for this becomes clear once you turn on warnings in the
compilation:

gcc -DPACKAGE=\ud\ -DVERSION=\0.7.1\ -DSTDC_HEADERS=1 -DHAVE_UNISTD_H=1 
-DRETSIGTYPE=void -DHAVE_GETHOSTNAME=1  -I. -I.  -g -O2 -Wall -W -c ud.c
ud.c: In function `get_kernel_version':
ud.c:150: warning: implicit declaration of function `ctime'
ud.c:150: warning: format argument is not a pointer (arg 3)

ctime is returning a pointer rather than an int. Simply adding
#include time.h to the top of the ud.c source file fixes this
bug. Prototypes are there for a reason!

Turning on warnings also highlights other silly coding bugs, but I'll
leave those for other people.

-- 
Steve McIntyre, Cambridge, UK.[EMAIL PROTECTED]
There's no sensation to compare with this
Suspended animation, A state of bliss