Mike McCormack mike_mccormack@start.com.au writes:
i have found a problem with Wine and the Linux 2.4.5 Kernel. The Kernel no longer return EINVAL when offsets are not page aligned... it simply does the mapping ignoring the lower bits of the offset. This small patch fixes that problem.
That's a glibc bug IMO. What version are you using?
On 11 Jun 2001, Alexandre Julliard wrote:
Mike McCormack mike_mccormack@start.com.au writes:
i have found a problem with Wine and the Linux 2.4.5 Kernel. The Kernel no longer return EINVAL when offsets are not page aligned... it simply does the mapping ignoring the lower bits of the offset. This small patch fixes that problem.
That's a glibc bug IMO. What version are you using?
glibc-2.1.3 with kernel 2.4.x (no problem with 2.2.x, no problem with 2.4.x using without _FILE_OFFSET_BITS 64 (I have the same symptoms, I think - want ot do some tests to be sure.))
-- Alexandre Julliard julliard@winehq.com
Lawson ---cut here---
________________________________________________________________ GET INTERNET ACCESS FROM JUNO! Juno offers FREE or PREMIUM Internet access for less! Join Juno today! For your FREE software, visit: http://dl.www.juno.com/get/tagj.
On Tue, Jun 12, 2001 at 07:11:01AM -0400, lawson_whitney@juno.com wrote:
On 11 Jun 2001, Alexandre Julliard wrote:
Mike McCormack mike_mccormack@start.com.au writes:
i have found a problem with Wine and the Linux 2.4.5 Kernel. The Kernel no longer return EINVAL when offsets are not page aligned... it simply does the mapping ignoring the lower bits of the offset. This small patch fixes that problem.
That's a glibc bug IMO. What version are you using?
glibc-2.1.3 with kernel 2.4.x (no problem with 2.2.x, no problem with 2.4.x using without _FILE_OFFSET_BITS 64 (I have the same symptoms, I think - want ot do some tests to be sure.))
Could you please apply following check to configure.in, then do: autoconf rm config.cache ./configure
and check whether mmap64 detects as 'no' and check the output of config.log ?
Ciao, Marcus
Index: configure.in =================================================================== RCS file: /home/wine/wine/configure.in,v retrieving revision 1.208 diff -u -r1.208 configure.in --- configure.in 2001/06/08 19:34:57 1.208 +++ configure.in 2001/06/12 11:43:33 @@ -538,6 +542,10 @@ ) { exit(1); } + if (-1!=mmap(0,2,PROT_READ|PROT_WRITE,MAP_SHARED,fd,2)){ + fprintf(stderr,"mapped at non aligned offset?\n"); + exit(2); + } close(fd); fprintf(stderr,"success!\n"); exit(0);
On Tue, 12 Jun 2001, Marcus Meissner wrote:
Could you please apply following check to configure.in, then do: autoconf rm config.cache ./configure
and check whether mmap64 detects as 'no' and check the output of config.log ?
Ciao, Marcus
Hmmm, here is all ./configre says about mmap:
checking for mmap in -lmmap... no checking whether mmap64 works defined as mmap... yes checking for mmap... yes
Here is config.log on the subject:
configure:5108: checking whether mmap64 works defined as mmap configure:5150: gcc -o conftest -g -O2 conftest.c -lncurses -lm -lutil -ldl 1>&5 configure: In function `main': configure:5133: warning: comparison between pointer and integer configure:5138: warning: comparison between pointer and integer configure:5178: checking for gcc strength-reduce bug
I am not sure however that I have exactly Mike's bug. It sounded the same from his description but I haven't done a conclusive test yet.
Lawson ---cut here---
________________________________________________________________ GET INTERNET ACCESS FROM JUNO! Juno offers FREE or PREMIUM Internet access for less! Join Juno today! For your FREE software, visit: http://dl.www.juno.com/get/tagj.
On Tue, 12 Jun 2001 lawson_whitney@juno.com wrote:
I am not sure however that I have exactly Mike's bug. It sounded the same from his description but I haven't done a conclusive test yet.
Not only does it look like it could easily be a misaligned mmap, Mike's little patch makes the crash go away. Using mmap instead of mmap64 or using kernel 2.2.14 instead of 2.4.5 also takes away the crash. Sorry the config test doesn't seem to catch it - it looks as if it should. I will take a better look at some debugmsgs and straces after supper.
Lawson ---cut---
________________________________________________________________ GET INTERNET ACCESS FROM JUNO! Juno offers FREE or PREMIUM Internet access for less! Join Juno today! For your FREE software, visit: http://dl.www.juno.com/get/tagj.
On Tue, 12 Jun 2001 lawson_whitney@juno.com wrote:
Not only does it look like it could easily be a misaligned mmap, Mike's little patch makes the crash go away. Using mmap instead of mmap64 or using kernel 2.2.14 instead of 2.4.5 also takes away the crash. Sorry the config test doesn't seem to catch it - it looks as if it should. I will take a better look at some debugmsgs and straces after supper.
Couldn't catch it with strace, but the attached ugly patch caught these troublesome mmaps:
trace:module:PE_LoadImage loading C:\iv\I_view32.exe trace:virtual:CreateFileMappingA (14,(nil),01000000,0000000000000000,(null)) trace:module:map_image mapped PE file at 0x400000-0x4bf000 View: 00400000 - 004befff 28 00400000 - 004befff c-rw- trace:module:map_image mapping section .text at 0x401000 off 400 size 77400 flags 60000020 trace:virtual:VIRTUAL_mmap setoff 0x401000 77400 7 12 9 400 = 0x401000 trace:module:map_image mapping section .rdata at 0x479000 off 77800 size ec00 flags 40000040 trace:virtual:VIRTUAL_mmap setoff 0x479000 ec00 7 12 9 77800 = 0x479000 trace:module:map_image mapping section .data at 0x488000 off 86400 size b000 flags c0000040 trace:virtual:VIRTUAL_mmap setoff 0x488000 b000 7 12 9 86400 = 0x488000 trace:module:map_image mapping section .idata at 0x4ab000 off 91400 size 1a00 flags c0000040 trace:virtual:VIRTUAL_mmap setoff 0x4ab000 1a00 7 12 9 91400 = 0x4ab000 trace:module:map_image mapping section .rsrc at 0x4ad000 off 92e00 size 12000 flags 40000040
trace:module:PE_LoadImage loading C:\away\bin\juno.exe trace:virtual:CreateFileMappingA (14,(nil),01000000,0000000000000000,(null)) trace:module:map_image mapped PE file at 0x400000-0x4bc000 View: 00400000 - 004bbfff 28 00400000 - 004bbfff c-rw- trace:module:map_image mapping section .text at 0x401000 off 400 size 68c00 flags 60000020 trace:virtual:VIRTUAL_mmap setoff 0x401000 68c00 7 12 9 400 = 0x401000 trace:module:map_image mapping section .rdata at 0x46a000 off 69000 size 18200 flags 40000040 trace:module:map_image mapping section .data at 0x483000 off 81200 size f000 flags c0000040 trace:module:map_image mapping section .rsrc at 0x494000 off 90200 size 28000 flags 40000040
This looks sort of like a kernel bug, doesn't it? Do I want to try to find it?
Lawson ---cut---