* bug in asm-ppc/div64.h
@ 2003-03-11 11:05 Bastien Nocera
2003-03-11 14:21 ` Debugging Giuliano Pochini
0 siblings, 1 reply; 8+ messages in thread
From: Bastien Nocera @ 2003-03-11 11:05 UTC (permalink / raw)
To: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 885 bytes --]
Hello,
While chasing a date bug in smbfs with Urban Widmark, it so happened
that we stumbled across a bug in do_div on PPC 32bit, ie. it doesn't
work.
I attached a test case, provided by Urban. do_div is used in quite a few
places like vsprintf, the matrox fb code, etc.
When running on x86:
now: 1047238073
adjusted: 24edd64059e100
/ 10000000: 3df4e80a
1039460362
Check the run on PPC. It's wrong by quite a scale.
Any ideas on how to solve this properly ?
Cheers
--
/Bastien Nocera
http://www.redhat.com
Perfection is reached, not when there is no longer anything to add, but
when there is no longer anything to take away.
Antoine de Saint-Exupery
--
/Bastien Nocera
http://hadess.net
#2 0x4205a2cc in printf ("Oh my %s\n", preferred_deity) from
/lib/i686/libc.so.6 printf ("Oh my %s\n", preferred_deity);
Segmentation fault
[-- Attachment #2: smbfs-time.c --]
[-- Type: text/x-c, Size: 550 bytes --]
#include <stdio.h>
#include <time.h>
#include <asm/types.h>
#include <asm/div64.h>
typedef __u64 u64;
#define NTFS_TIME_OFFSET ((u64)(369*365 + 89) * 24 * 3600 * 10000000)
static time_t
smb_ntutc2unixutc(u64 ntutc)
{
u64 t = ntutc - NTFS_TIME_OFFSET;
printf("adjusted: %Lx\n", t);
do_div(t, 10000000);
printf("/ 10000000: %Lx\n", t);
return (time_t)t;
}
int main()
{
time_t t;
t = time(NULL);
printf("now: %ld\n", t);
t = smb_ntutc2unixutc(0x01c29fb515986100LL);
printf("%ld\n", t);
}
^ permalink raw reply [flat|nested] 8+ messages in thread* Debugging
2003-03-11 11:05 bug in asm-ppc/div64.h Bastien Nocera
@ 2003-03-11 14:21 ` Giuliano Pochini
2003-03-11 19:28 ` Debugging Olaf Hering
0 siblings, 1 reply; 8+ messages in thread
From: Giuliano Pochini @ 2003-03-11 14:21 UTC (permalink / raw)
To: linuxppc-dev
Does xmon work ? When something oopses I see the xmon prompt, but
I can't type anything - machine completely freezed. SysReq commands
also are disabled and I must hit the hard reset button.
I disabled xmon so oops messages show up on the console and in the
logs, but I have problems with them too. ksymoops spits a lot of
warnings about non-matching addresses, etc. and the function where
the oops occurred is always "may not be reliable". To locate the
bug I put a lot of printk in my driver and - murphy's surprise -
oopses do not have a backtrace anymore, just one unresolvable
address. #:-6
I'm using 2.4.21p4 on a blue G3. I recompiled Kernel, modules, ALSA
to be sure System.map is the right one.
Bye.
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Debugging
2003-03-11 14:21 ` Debugging Giuliano Pochini
@ 2003-03-11 19:28 ` Olaf Hering
2003-03-13 8:28 ` Debugging Giuliano Pochini
0 siblings, 1 reply; 8+ messages in thread
From: Olaf Hering @ 2003-03-11 19:28 UTC (permalink / raw)
To: Giuliano Pochini; +Cc: linuxppc-dev
On Tue, Mar 11, Giuliano Pochini wrote:
> I'm using 2.4.21p4 on a blue G3. I recompiled Kernel, modules, ALSA
> to be sure System.map is the right one.
Get an ADB keyboard and use that for xmon.
--
A: No.
Q: Should I include quotations after my reply?
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Debugging
2003-03-11 19:28 ` Debugging Olaf Hering
@ 2003-03-13 8:28 ` Giuliano Pochini
2003-03-13 8:52 ` Debugging Olaf Hering
0 siblings, 1 reply; 8+ messages in thread
From: Giuliano Pochini @ 2003-03-13 8:28 UTC (permalink / raw)
To: Olaf Hering; +Cc: linuxppc-dev
On 11-Mar-2003 Olaf Hering wrote:
>
> On Tue, Mar 11, Giuliano Pochini wrote:
>
>> I'm using 2.4.21p4 on a blue G3. I recompiled Kernel, modules, ALSA
>> to be sure System.map is the right one.
>
> Get an ADB keyboard and use that for xmon.
:( I sold it a few months ago. Can macs without ADB run xmon ?
Bye.
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Debugging
2003-03-13 8:28 ` Debugging Giuliano Pochini
@ 2003-03-13 8:52 ` Olaf Hering
0 siblings, 0 replies; 8+ messages in thread
From: Olaf Hering @ 2003-03-13 8:52 UTC (permalink / raw)
To: Giuliano Pochini; +Cc: linuxppc-dev
On Thu, Mar 13, Giuliano Pochini wrote:
>
> On 11-Mar-2003 Olaf Hering wrote:
> >
> > On Tue, Mar 11, Giuliano Pochini wrote:
> >
> >> I'm using 2.4.21p4 on a blue G3. I recompiled Kernel, modules, ALSA
> >> to be sure System.map is the right one.
> >
> > Get an ADB keyboard and use that for xmon.
>
> :( I sold it a few months ago. Can macs without ADB run xmon ?
Via Firewire maybe, but your onboard pcilynx controller ist not supported.
--
A: No.
Q: Should I include quotations after my reply?
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug in asm-ppc/div64.h
@ 2003-03-11 11:03 Bastien Nocera
2003-03-11 11:04 ` Paul Mackerras
0 siblings, 1 reply; 8+ messages in thread
From: Bastien Nocera @ 2003-03-11 11:03 UTC (permalink / raw)
To: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 706 bytes --]
Hello,
While chasing a date bug in smbfs with Urban Widmark, it so happened
that we stumbled across a bug in do_div on PPC 32bit, ie. it doesn't
work.
I attached a test case, provided by Urban. do_div is used in quite a few
places like vsprintf, the matrox fb code, etc.
When running on x86:
now: 1047238073
adjusted: 24edd64059e100
/ 10000000: 3df4e80a
1039460362
Check the run on PPC. It's wrong by quite a scale.
Any ideas on how to solve this properly ?
Cheers
--
/Bastien Nocera
http://www.redhat.com
Perfection is reached, not when there is no longer anything to add, but
when there is no longer anything to take away.
Antoine de Saint-Exupery
[-- Attachment #2: smbfs-time.c --]
[-- Type: text/x-c, Size: 550 bytes --]
#include <stdio.h>
#include <time.h>
#include <asm/types.h>
#include <asm/div64.h>
typedef __u64 u64;
#define NTFS_TIME_OFFSET ((u64)(369*365 + 89) * 24 * 3600 * 10000000)
static time_t
smb_ntutc2unixutc(u64 ntutc)
{
u64 t = ntutc - NTFS_TIME_OFFSET;
printf("adjusted: %Lx\n", t);
do_div(t, 10000000);
printf("/ 10000000: %Lx\n", t);
return (time_t)t;
}
int main()
{
time_t t;
t = time(NULL);
printf("now: %ld\n", t);
t = smb_ntutc2unixutc(0x01c29fb515986100LL);
printf("%ld\n", t);
}
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: bug in asm-ppc/div64.h
2003-03-11 11:03 bug in asm-ppc/div64.h Bastien Nocera
@ 2003-03-11 11:04 ` Paul Mackerras
2003-03-11 11:23 ` Bastien Nocera
0 siblings, 1 reply; 8+ messages in thread
From: Paul Mackerras @ 2003-03-11 11:04 UTC (permalink / raw)
To: Bastien Nocera; +Cc: linuxppc-dev
Bastien Nocera writes:
> While chasing a date bug in smbfs with Urban Widmark, it so happened
> that we stumbled across a bug in do_div on PPC 32bit, ie. it doesn't
> work.
Grab a copy of include/asm-ppc/div64.h and arch/ppc/lib/div64.S from
a 2.5 tree.
Paul.
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: bug in asm-ppc/div64.h
2003-03-11 11:04 ` Paul Mackerras
@ 2003-03-11 11:23 ` Bastien Nocera
0 siblings, 0 replies; 8+ messages in thread
From: Bastien Nocera @ 2003-03-11 11:23 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
Hi Paul,
On Tue, 2003-03-11 at 11:04, Paul Mackerras wrote:
>
> Bastien Nocera writes:
>
> > While chasing a date bug in smbfs with Urban Widmark, it so happened
> > that we stumbled across a bug in do_div on PPC 32bit, ie. it doesn't
> > work.
>
> Grab a copy of include/asm-ppc/div64.h and arch/ppc/lib/div64.S from
> a 2.5 tree.
Ben just pointed me to these files. I'll give it a try. Are there any
plans to backport these ? All my files on an SMB share appear with the
wrong dates because of that bug.
Cheers
PS: And sorry about the spam, and badly signed mails...
--
/Bastien Nocera
http://hadess.net
#2 0x4205a2cc in printf ("Oh my %s\n", preferred_deity) from
/lib/i686/libc.so.6 printf ("Oh my %s\n", preferred_deity);
Segmentation fault
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2003-03-13 8:52 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-11 11:05 bug in asm-ppc/div64.h Bastien Nocera
2003-03-11 14:21 ` Debugging Giuliano Pochini
2003-03-11 19:28 ` Debugging Olaf Hering
2003-03-13 8:28 ` Debugging Giuliano Pochini
2003-03-13 8:52 ` Debugging Olaf Hering
-- strict thread matches above, loose matches on Subject: below --
2003-03-11 11:03 bug in asm-ppc/div64.h Bastien Nocera
2003-03-11 11:04 ` Paul Mackerras
2003-03-11 11:23 ` Bastien Nocera
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).