klogd broken in 1.13.0?

2008-11-18 Thread Hamish Moffatt
I just switched from busybox 1.11.2 to 1.13.0 for a project and now kernel 
message logging seems a bit busted. It starts ok but then goes wrong.
Application logging seems to work ok still (see the last 5 lines of this
example).

I backed out rev 23583 and now it works again.

Viewing whole files on the busybox ViewCVS seems to be broken too eg
http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_13_stable/sysklogd/klogd.c?rev=23583&view=markup
Diffs work though.

Hamish

Jan  1 00:00:06 elara user.warn kernel: [4.04] VFS: Mounted root (ubifs 
filesystem) readonly.
Jan  1 00:00:06 elara user.info kernel: [4.05] Freeing init memory: 92K 
 
Jan  1 00:00:06 elara user.notice kernel: [5.22] UBIFS: mounted UBI 
device 0, volume 2   
Jan  1 00:00:06 elara user.notice kernel: [5.22] UBIFS: minimal I/O 
unit size:   2048 bytes  
Jan  1 00:00:06 elara user.notice kernel: [5.23] UBIFS: logical 
eraseblock size: 129024 bytes (126 KiB)  
Jan  1 00:00:06 elara user.notice kernel: [5.23] UBIFS: file system 
size:15740928 bytes (15372 KiB, 15 MiB, 122 LEBs)
Jan  1 00:00:06 elara user.notice kernel: [5.24] UBIFS: journal size:   
 774144 bytes (756 KiB, 0 MiB, 6 LEBs)   
Jan  1 00:00:06 elara user.notice kernel: [5.25] UBIFS: data journal 
heads:  1   
Jan  1 00:00:06 elara user.notice kernel: [5.25] UBIFS: default 
compressor:  LZO 
Jan  1 00:00:06 elara user.notice kernel: [5.54] UBIFS: mounted UBI 
device 0, volume 3   
Jan  1 00:00:06 elara user.notice kernel: [5.55] UBIFS: minimal I/O 
unit size:   2048 bytes  
Jan  1 00:00:06 elara user.notice kernel: [5.55] UBIFS: logical 
eraseblock size: 129024 bytes (126 KiB)  
Jan  1 00:00:06 elara user.notice kernel: [5.56] UBIFS: file system 
size:235081728 bytes (229572 KiB, 224 MiB, 1822 LEBs)   
   
Jan  1 00:00:06 elara user.notice kernel: [5.57] UBIFS: journal size:   
 11741184 bytes (11466 KiB, 11 MiB, 91 LEBs) 
Jan  1 00:00:06 elara user.notice kernel: [5.57] UBIFS: data journal 
heads:  1   
Jan  1 00:00:06 elara user.notice kernel: [5.58] UBIFS: default 
compressor:  LZO 
Jan  1 00:00:06 elara user.info kernel: 93] 0x0020-0x0038 : 
"boot-ramdisk"<4>[6.49] europa_fuse: Unknown symbol processor_id
Jan  1 00:00:06 elara user.info kernel: 5>[0.94] 0x007c-0x007e 
: "RedBoot config"<6>[6.52] Calyptech GPIO proc interface loaded
Jan  1 00:00:06 elara user.info kernel: 0.94] 0x007c-0x007e : 
"RedBoot config"<6>[6.67] Registered led device: elara:red:power 
Jan  1 00:00:06 elara user.info kernel: aded<6>[6.71] Registered led 
device: elara:green:power 
Jan  1 00:00:07 elara user.info kernel: 000] Registered led device: 
elara:red:power<4>[7.07] ixp400: module license 'unspecified' taints 
kernel.
Jan  1 00:00:07 elara user.info kernel: .94] 0x007c-0x007e : 
"RedBoot config"<7>[7.43] ixp400: Module init. 
Jan  1 00:00:07 elara user.info kernel: pecified' taints kernel.<6>[
7.67] ixp400_eth: Initializing IXP400 NPE Ethernet driver software v. 1.8   
Jan  1 00:00:07 elara user.info kernel: [7.68] ixp400_eth: CPU clock 
speed (approx) = 532 MHz   
Jan  1 00:00:08 elara user.info kernel: 000] 0x007e-0x007e8000 : "FIS 
directory"<6>[7.83] ixp400_eth: eth1 is using NPEC and the PHY at 
address 1
Jan  1 00:00:08 elara user.info kernel: [7.83] ixp400_eth: eth2 is 
using NPEA and the PHY at address 0 
  
Jan  1 00:00:08 elara user.info kernel: 0x007e8000 : "FIS directory"<4>[
7.87] ixp400_eth: Using MAC address 00:1b:9f:f0:00:01 for port 1
 
Jan  1 00:00:08 elara user.info kernel: at address 1<4>[7.92] 
ixp400_eth: Using MAC address 00:1b:9f:00:00:02 for port 2  
   
Jan  1 00:00:09 elara user.info kernel: 0:01 for port 1<3>[9.12] br0: 
Dropping NETIF_F_UFO since no NETIF_F_HW_CSUM feature. 
Jan  1 00:00:09 elara user.info kernel:  for port 1<6>[9.16] device 
eth0 entered promiscuous mode   
 
Jan  1 00:00:09 elara user.info kernel: o NETIF_F_HW_CSUM feature.<6>[
9.24] device eth1 entered prom

Re: klogd broken in 1.13.0?

2008-11-18 Thread Steve Bennett

I suspect strcpy vs memmove.

Try this patch and let me know if it helps.

Cheers,
Steve

On 19/11/2008, at 2:17 PM, Hamish Moffatt wrote:

I just switched from busybox 1.11.2 to 1.13.0 for a project and now  
kernel

message logging seems a bit busted. It starts ok but then goes wrong.
Application logging seems to work ok still (see the last 5 lines of  
this

example).

I backed out rev 23583 and now it works again.

Viewing whole files on the busybox ViewCVS seems to be broken too eg
http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_13_stable/sysklogd/klogd.c?rev=23583&view=markup
Diffs work though.

Hamish

Jan  1 00:00:06 elara user.warn kernel: [4.04] VFS: Mounted  
root (ubifs filesystem) readonly.
Jan  1 00:00:06 elara user.info kernel: [4.05] Freeing init  
memory: 92K
Jan  1 00:00:06 elara user.notice kernel: [5.22] UBIFS:  
mounted UBI device 0, volume 2
Jan  1 00:00:06 elara user.notice kernel: [5.22] UBIFS:  
minimal I/O unit size:   2048 bytes
Jan  1 00:00:06 elara user.notice kernel: [5.23] UBIFS:  
logical eraseblock size: 129024 bytes (126 KiB)
Jan  1 00:00:06 elara user.notice kernel: [5.23] UBIFS: file  
system size:15740928 bytes (15372 KiB, 15 MiB, 122 LEBs)
Jan  1 00:00:06 elara user.notice kernel: [5.24] UBIFS:  
journal size:774144 bytes (756 KiB, 0 MiB, 6 LEBs)
Jan  1 00:00:06 elara user.notice kernel: [5.25] UBIFS: data  
journal heads:  1
Jan  1 00:00:06 elara user.notice kernel: [5.25] UBIFS:  
default compressor:  LZO
Jan  1 00:00:06 elara user.notice kernel: [5.54] UBIFS:  
mounted UBI device 0, volume 3
Jan  1 00:00:06 elara user.notice kernel: [5.55] UBIFS:  
minimal I/O unit size:   2048 bytes
Jan  1 00:00:06 elara user.notice kernel: [5.55] UBIFS:  
logical eraseblock size: 129024 bytes (126 KiB)
Jan  1 00:00:06 elara user.notice kernel: [5.56] UBIFS: file  
system size:235081728 bytes (229572 KiB, 224 MiB, 1822 LEBs)
Jan  1 00:00:06 elara user.notice kernel: [5.57] UBIFS:  
journal size:11741184 bytes (11466 KiB, 11 MiB, 91 LEBs)
Jan  1 00:00:06 elara user.notice kernel: [5.57] UBIFS: data  
journal heads:  1
Jan  1 00:00:06 elara user.notice kernel: [5.58] UBIFS:  
default compressor:  LZO
Jan  1 00:00:06 elara user.info kernel: 93]  
0x0020-0x0038 : "boot-ramdisk"<4>[6.49] europa_fuse:  
Unknown symbol processor_id
Jan  1 00:00:06 elara user.info kernel: 5>[0.94]  
0x007c-0x007e : "RedBoot config"<6>[6.52] Calyptech  
GPIO proc interface loaded
Jan  1 00:00:06 elara user.info kernel: 0.94]  
0x007c-0x007e : "RedBoot config"<6>[6.67] Registered  
led device: elara:red:power
Jan  1 00:00:06 elara user.info kernel: aded<6>[6.71]  
Registered led device: elara:green:power
Jan  1 00:00:07 elara user.info kernel: 000] Registered led device:  
elara:red:power<4>[7.07] ixp400: module license  
'unspecified' taints kernel.
Jan  1 00:00:07 elara user.info kernel: .94]  
0x007c-0x007e : "RedBoot config"<7>[7.43] ixp400:  
Module init.
Jan  1 00:00:07 elara user.info kernel: pecified' taints  
kernel.<6>[7.67] ixp400_eth: Initializing IXP400 NPE  
Ethernet driver software v. 1.8
Jan  1 00:00:07 elara user.info kernel: [7.68] ixp400_eth:  
CPU clock speed (approx) = 532 MHz
Jan  1 00:00:08 elara user.info kernel: 000] 0x007e-0x007e8000 :  
"FIS directory"<6>[7.83] ixp400_eth: eth1 is using NPEC and  
the PHY at address 1
Jan  1 00:00:08 elara user.info kernel: [7.83] ixp400_eth:  
eth2 is using NPEA and the PHY at address 0
Jan  1 00:00:08 elara user.info kernel: 0x007e8000 : "FIS  
directory"<4>[7.87] ixp400_eth: Using MAC address 00:1b: 
9f:f0:00:01 for port 1
Jan  1 00:00:08 elara user.info kernel: at address  
1<4>[7.92] ixp400_eth: Using MAC address 00:1b:9f:00:00:02  
for port 2
Jan  1 00:00:09 elara user.info kernel: 0:01 for port  
1<3>[9.12] br0: Dropping NETIF_F_UFO since no  
NETIF_F_HW_CSUM feature.
Jan  1 00:00:09 elara user.info kernel:  for port 1<6>[9.16]  
device eth0 entered promiscuous mode
Jan  1 00:00:09 elara user.info kernel: o NETIF_F_HW_CSUM  
feature.<6>[9.24] device eth1 entered promiscuous mode

Jan  1 00:00:10 elara user.notice rc: Using IP address 192.168.3.2
Jan  1 00:00:11 elara daemon.info dnsmasq[864]: started, version  
2.45 cachesize 150
Jan  1 00:00:11 elara daemon.info dnsmasq[864]: compile time  
options: no-IPv6 GNU-getopt no-ISC-leasefile no-DBus no-I18N TFTP

Jan  1 00:00:11 elara daemon.info dnsmasq[864]: cleared cache
Jan  1 00:00:11 elara auth.warn portmap[867]: user rpc not found,  
reverting to user bin

--
Hamish Moffatt VK3SB <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
___
busybox mailing list
busybox@busybox.net
http://busybox.net/c

Re: klogd broken in 1.13.0?

2008-11-18 Thread Denys Vlasenko
On Wednesday 19 November 2008 05:17, Hamish Moffatt wrote:
> I just switched from busybox 1.11.2 to 1.13.0 for a project and now kernel 
> message logging seems a bit busted. It starts ok but then goes wrong.
> Application logging seems to work ok still (see the last 5 lines of this
> example).
> 
> I backed out rev 23583 and now it works again.

Does it help if you just add this one line?

/* "2 -- Read from the log." */
n = klogctl(2, log_buffer + used, KLOGD_LOGBUF_SIZE-1 - used);
if (n < 0) {
if (errno == EINTR)
continue;
syslog(LOG_ERR, "klogd: error %d in klogctl(2): %m",
errno);
break;
}
+   log_buffer[used + n] = '\0';


> Viewing whole files on the busybox ViewCVS seems to be broken too eg
> http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_13_stable/sysklogd/klogd.c?rev=23583&view=markup

Look at trunk, not branches/busybox_1_13_stable:

http://busybox.net/cgi-bin/viewcvs.cgi/trunk/busybox/sysklogd/klogd.c?rev=23583&view=markup

--
vda
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: klogd broken in 1.13.0?

2008-11-19 Thread Hamish Moffatt
On Wed, Nov 19, 2008 at 08:45:53AM +0100, Denys Vlasenko wrote:
> On Wednesday 19 November 2008 05:17, Hamish Moffatt wrote:
> > I just switched from busybox 1.11.2 to 1.13.0 for a project and now kernel 
> > message logging seems a bit busted. It starts ok but then goes wrong.
> > Application logging seems to work ok still (see the last 5 lines of this
> > example).
> > 
> > I backed out rev 23583 and now it works again.
> 
> Does it help if you just add this one line?
> 
> /* "2 -- Read from the log." */
> n = klogctl(2, log_buffer + used, KLOGD_LOGBUF_SIZE-1 - used);
> if (n < 0) {
> if (errno == EINTR)
> continue;
> syslog(LOG_ERR, "klogd: error %d in klogctl(2): %m",
> errno);
> break;
> }
> +   log_buffer[used + n] = '\0';

Yes that works.

> > http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_13_stable/sysklogd/klogd.c?rev=23583&view=markup
> Look at trunk, not branches/busybox_1_13_stable:
> http://busybox.net/cgi-bin/viewcvs.cgi/trunk/busybox/sysklogd/klogd.c?rev=23583&view=markup

Looking at branches should work though?


thanks
Hamish
-- 
Hamish Moffatt VK3SB <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: klogd broken in 1.13.0?

2008-11-19 Thread Denys Vlasenko
On Thursday 20 November 2008 00:41, Hamish Moffatt wrote:
> On Wed, Nov 19, 2008 at 08:45:53AM +0100, Denys Vlasenko wrote:
> > Does it help if you just add this one line?
> > 
> > /* "2 -- Read from the log." */
> > n = klogctl(2, log_buffer + used, KLOGD_LOGBUF_SIZE-1 - 
> > used);
> > if (n < 0) {
> > if (errno == EINTR)
> > continue;
> > syslog(LOG_ERR, "klogd: error %d in klogctl(2): %m",
> > errno);
> > break;
> > }
> > +   log_buffer[used + n] = '\0';
> 
> Yes that works.

Minimal fix is here:

http://busybox.net/downloads/fixes-1.13.0/busybox-1.13.0-klogd.patch

and svn has a bit bigger fix (or shall I say "smaller" -
code has shrank) is in svn.

Can you test svn version?

> > > http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_13_stable/sysklogd/klogd.c?rev=23583&view=markup
> > Look at trunk, not branches/busybox_1_13_stable:
> > http://busybox.net/cgi-bin/viewcvs.cgi/trunk/busybox/sysklogd/klogd.c?rev=23583&view=markup
> 
> Looking at branches should work though?

Frankly, I don't know...
--
vda
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: klogd broken in 1.13.0?

2008-11-19 Thread Hamish Moffatt
On Thu, Nov 20, 2008 at 12:48:50AM +0100, Denys Vlasenko wrote:
> On Thursday 20 November 2008 00:41, Hamish Moffatt wrote:
> > On Wed, Nov 19, 2008 at 08:45:53AM +0100, Denys Vlasenko wrote:
> > > Does it help if you just add this one line?
> > > 
> > > /* "2 -- Read from the log." */
> > > n = klogctl(2, log_buffer + used, KLOGD_LOGBUF_SIZE-1 - 
> > > used);
> > > if (n < 0) {
> > > if (errno == EINTR)
> > > continue;
> > > syslog(LOG_ERR, "klogd: error %d in klogctl(2): 
> > > %m",
> > > errno);
> > > break;
> > > }
> > > +   log_buffer[used + n] = '\0';
> > 
> > Yes that works.
> 
> Minimal fix is here:
> 
> http://busybox.net/downloads/fixes-1.13.0/busybox-1.13.0-klogd.patch

It's working.

> and svn has a bit bigger fix (or shall I say "smaller" -
> code has shrank) is in svn.
> 
> Can you test svn version?

That works too.

thanks,
Hamish
-- 
Hamish Moffatt VK3SB <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox