Skip to contentSkip to conversation

2.6.16-rc3 macromedia flash regression...

PATCH Ernst Herzberg 3 participants 8 messages Feb 17, 2006 VFS

lore
Share & tools
lore
#0 lore raw

.... or not regession, that's the question.

2.6.16-rc2 works without problems.

With -rc3 a .swf that opens a ip connection back to the server takes ages to load. strace shows that the player hangs for long times in select().

Digging through the changelog brings up

commit 643a654540579b0dcc7a206a4a7475276a41aff0

Author: Andrew Morton <[email protected]>
Date:   Sat Feb 11 17:55:52 2006 -0800

[PATCH] select: fix returned timeval

Reverting the patch partial like

fs/select.c 2006-02-17 04:44:00.000000000 +0100 renamed from fs/select.c 2006-02-17 04:35:10.000000000 +0100 +0 -2
@@ -404,8 +404,6 @@ asmlinkage long sys_select(int n, fd_set
                        goto sticky;
                rtv.tv_usec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ));
                rtv.tv_sec = timeout;
-               if (timeval_compare(&rtv, &tv) < 0)
-                       rtv = tv;
                if (copy_to_user(tvp, &rtv, sizeof(rtv))) {
 sticky:
                        /*
@@ -471,8 +469,6 @@ asmlinkage long sys_pselect7(int n, fd_s
                rts.tv_nsec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)) 

*

                                                1000;
                rts.tv_sec = timeout;
-               if (timespec_compare(&rts, &ts) < 0)
-                       rts = ts;
                if (copy_to_user(tsp, &rts, sizeof(rts))) {
 sticky:
                        /*

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

fixed that, the player works again in normal speed.

The player is the newest from macromedia (7.0.61.0, gentoo ebuild), binary only of course:( Reading the patch and the documentation of select() i think the player is buggy... but works until 2.6.16-rc3

So what is your opinion? I think, macromedia should fix the player...

Thanks

<earny/>

#1 lore raw
Quoted 8 lines · Ernst Herzberg

.... or not regession, that's the question.

2.6.16-rc2 works without problems.

With -rc3 a .swf that opens a ip connection back to the server takes ages to load. strace shows that the player hangs for long times in select().

Quoted 7 lines

Digging through the changelog brings up

commit 643a654540579b0dcc7a206a4a7475276a41aff0
Author: Andrew Morton <[email protected]>
Date: Sat Feb 11 17:55:52 2006 -0800

[PATCH] select: fix returned timeval

Thanks for working that out.

Are you able to send along the relevant parts of the strace output, so we see the select() inputs and outputs?

#2 lore raw
Quoted 15 lines · Andrew Morton
Quoted 14 lines · Ernst Herzberg

.... or not regession, that's the question.

2.6.16-rc2 works without problems.

With -rc3 a .swf that opens a ip connection back to the server takes
ages to load. strace shows that the player hangs for long times in select().

Digging through the changelog brings up

commit 643a654540579b0dcc7a206a4a7475276a41aff0
Author: Andrew Morton <[email protected]>
Date: Sat Feb 11 17:55:52 2006 -0800

Quoted 6 lines
Quoted 1 line

[PATCH] select: fix returned timeval

Thanks for working that out.

Are you able to send along the relevant parts of the strace output, so we see the select() inputs and outputs?

The straces are available at

http://dev.net4u.de/~earny/flash_regression/

If someone want to debug this by itself should contact me private, i will then setup an URL with the problematic swf.

Thanks

<earny/>

#3 lore raw
In reply to Ernst Herzberg
Quoted 8 lines · Ernst Herzberg

.... or not regession, that's the question.

2.6.16-rc2 works without problems.

With -rc3 a .swf that opens a ip connection back to the server takes ages to load. strace shows that the player hangs for long times in select().

Quoted 7 lines

Digging through the changelog brings up

commit 643a654540579b0dcc7a206a4a7475276a41aff0
Author: Andrew Morton <[email protected]>
Date: Sat Feb 11 17:55:52 2006 -0800

[PATCH] select: fix returned timeval

y'know, when I sent that patch out to reviewers I said "Could you guys please double-check this like hawks? Especially the handy-dandy new timespec/timeval comparison functions. I invariably screw that sort of thing up."

Does this help?

fs/select.c renamed from fs/select.c~select-time-comparison-fixes +3 -3
diff -puN fs/select.c~select-time-comparison-fixes fs/select.c
@@ -404,7 +404,7 @@ asmlinkage long sys_select(int n, fd_set
 			goto sticky;
 		rtv.tv_usec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ));
 		rtv.tv_sec = timeout;
-		if (timeval_compare(&rtv, &tv) < 0)
+		if (timeval_compare(&rtv, &tv) >= 0)
 			rtv = tv;
 		if (copy_to_user(tvp, &rtv, sizeof(rtv))) {
 sticky:
@@ -471,7 +471,7 @@ asmlinkage long sys_pselect7(int n, fd_s
 		rts.tv_nsec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)) *
 						1000;
 		rts.tv_sec = timeout;
-		if (timespec_compare(&rts, &ts) < 0)
+		if (timespec_compare(&rts, &ts) >= 0)
 			rts = ts;
 		if (copy_to_user(tsp, &rts, sizeof(rts))) {
 sticky:
@@ -775,7 +775,7 @@ asmlinkage long sys_ppoll(struct pollfd 
 		rts.tv_nsec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)) *
 						1000;
 		rts.tv_sec = timeout;
-		if (timespec_compare(&rts, &ts) < 0)
+		if (timespec_compare(&rts, &ts) >= 0)
 			rts = ts;
 		if (copy_to_user(tsp, &rts, sizeof(rts))) {
 		sticky:
fs/compat.c renamed from fs/compat.c~select-time-comparison-fixes +3 -3
diff -puN fs/compat.c~select-time-comparison-fixes fs/compat.c
@@ -1757,7 +1757,7 @@ asmlinkage long compat_sys_select(int n,
 			goto sticky;
 		rtv.tv_usec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ));
 		rtv.tv_sec = timeout;
-		if (compat_timeval_compare(&rtv, &tv) < 0)
+		if (compat_timeval_compare(&rtv, &tv) >= 0)
 			rtv = tv;
 		if (copy_to_user(tvp, &rtv, sizeof(rtv))) {
 sticky:
@@ -1834,7 +1834,7 @@ asmlinkage long compat_sys_pselect7(int 
 			rts.tv_sec++;
 			rts.tv_nsec -= NSEC_PER_SEC;
 		}
-		if (compat_timespec_compare(&rts, &ts) < 0)
+		if (compat_timespec_compare(&rts, &ts) >= 0)
 			rts = ts;
 		copy_to_user(tsp, &rts, sizeof(rts));
 	}
@@ -1934,7 +1934,7 @@ asmlinkage long compat_sys_ppoll(struct 
 		rts.tv_nsec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)) *
 					1000;
 		rts.tv_sec = timeout;
-		if (compat_timespec_compare(&rts, &ts) < 0)
+		if (compat_timespec_compare(&rts, &ts) >= 0)
 			rts = ts;
 		if (copy_to_user(tsp, &rts, sizeof(rts))) {
 sticky:

_

#4 lore raw
Quoted 87 lines · Andrew Morton
Quoted 8 lines · Ernst Herzberg

.... or not regession, that's the question.

2.6.16-rc2 works without problems.

With -rc3 a .swf that opens a ip connection back to the server takes
ages to load. strace shows that the player hangs for long times in select().

Quoted 7 lines

Digging through the changelog brings up

commit 643a654540579b0dcc7a206a4a7475276a41aff0
Author: Andrew Morton <[email protected]>
Date: Sat Feb 11 17:55:52 2006 -0800

[PATCH] select: fix returned timeval

y'know, when I sent that patch out to reviewers I said "Could you guys please double-check this like hawks? Especially the handy-dandy new timespec/timeval comparison functions. I invariably screw that sort of thing up."

Does this help?

diff -puN fs/select.c~select-time-comparison-fixes fs/select.c
--- devel/fs/select.c~select-time-comparison-fixes 2006-02-16
23:17:54.000000000 -0800 +++ devel-akpm/fs/select.c 2006-02-16
23:19:21.000000000 -0800

fs/select.c renamed from fs/select.c~select-time-comparison-fixes +3 -3
@@ -404,7 +404,7 @@ asmlinkage long sys_select(int n, fd_set
 			goto sticky;
 		rtv.tv_usec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ));
 		rtv.tv_sec = timeout;
-		if (timeval_compare(&rtv, &tv) < 0)
+		if (timeval_compare(&rtv, &tv) >= 0)
 			rtv = tv;
 		if (copy_to_user(tvp, &rtv, sizeof(rtv))) {
 sticky:
@@ -471,7 +471,7 @@ asmlinkage long sys_pselect7(int n, fd_s
 		rts.tv_nsec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)) *
 						1000;
 		rts.tv_sec = timeout;
-		if (timespec_compare(&rts, &ts) < 0)
+		if (timespec_compare(&rts, &ts) >= 0)
 			rts = ts;
 		if (copy_to_user(tsp, &rts, sizeof(rts))) {
 sticky:
@@ -775,7 +775,7 @@ asmlinkage long sys_ppoll(struct pollfd
 		rts.tv_nsec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)) *
 						1000;
 		rts.tv_sec = timeout;
-		if (timespec_compare(&rts, &ts) < 0)
+		if (timespec_compare(&rts, &ts) >= 0)
 			rts = ts;
 		if (copy_to_user(tsp, &rts, sizeof(rts))) {
 		sticky:

diff -puN fs/compat.c~select-time-comparison-fixes fs/compat.c
--- devel/fs/compat.c~select-time-comparison-fixes 2006-02-16
23:17:54.000000000 -0800 +++ devel-akpm/fs/compat.c 2006-02-16
23:19:33.000000000 -0800

fs/compat.c renamed from fs/compat.c~select-time-comparison-fixes +3 -3
@@ -1757,7 +1757,7 @@ asmlinkage long compat_sys_select(int n,
 			goto sticky;
 		rtv.tv_usec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ));
 		rtv.tv_sec = timeout;
-		if (compat_timeval_compare(&rtv, &tv) < 0)
+		if (compat_timeval_compare(&rtv, &tv) >= 0)
 			rtv = tv;
 		if (copy_to_user(tvp, &rtv, sizeof(rtv))) {
 sticky:
@@ -1834,7 +1834,7 @@ asmlinkage long compat_sys_pselect7(int
 			rts.tv_sec++;
 			rts.tv_nsec -= NSEC_PER_SEC;
 		}
-		if (compat_timespec_compare(&rts, &ts) < 0)
+		if (compat_timespec_compare(&rts, &ts) >= 0)
 			rts = ts;
 		copy_to_user(tsp, &rts, sizeof(rts));
 	}
@@ -1934,7 +1934,7 @@ asmlinkage long compat_sys_ppoll(struct
 		rts.tv_nsec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)) *
 					1000;
 		rts.tv_sec = timeout;
-		if (compat_timespec_compare(&rts, &ts) < 0)
+		if (compat_timespec_compare(&rts, &ts) >= 0)
 			rts = ts;
 		if (copy_to_user(tsp, &rts, sizeof(rts))) {
 sticky:
Quoted 1 line

_

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

The patch does _not_ fix the problem.

sorry...
<earny/>

#5 lore raw
Quoted 3 lines · Ernst Herzberg

The patch does _not_ fix the problem.

Surprised. Could I ask that you double-check that the patch was applied and that the right kernel was running?

#6 lore raw
Quoted 5 lines · Andrew Morton
Quoted 1 line · Ernst Herzberg

The patch does _not_ fix the problem.

Surprised. Could I ask that you double-check that the patch was applied and that the right kernel was running?

**doublechecked**, and..... you are right!

This patch __fixes__ the problem.

Thanks

<earny/>

#7 lore raw
Quoted 12 lines · Ernst Herzberg
Quoted 5 lines · Andrew Morton
Quoted 1 line · Ernst Herzberg

The patch does _not_ fix the problem.

Surprised. Could I ask that you double-check that the patch was applied and that the right kernel was running?

**doublechecked**, and..... you are right!

This patch __fixes__ the problem.

Whew. I thought I was going mad ;)

Thanks for finding the bug.