|
From: Jan E. <je...@me...> - 2011-06-30 20:48:46
|
Using the below testcase, running the program under valgrind 3.6.1 fails with ENOMEM. I am using the openSUSE Factory package (there are some patches in there[1]). [1] https://build.opensuse.org/package/files?package=valgrind&project=openSUSE:Factory --- #define _GNU_SOURCE 1 #include <sys/mman.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> int main(void) { char buf[256]; void *area = mmap((void *)0x10000000, 4096, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE,0,0); printf("area= %p\n", area); strcpy(area, "Hello World"); void *a2 = mremap((void *)0x10000000, 4096, 40960, 0); if (a2 == MAP_FAILED) { perror("mremap"); abort(); } printf("area= %p\n", a2); printf("%s\n", a2); snprintf(buf, sizeof(buf), "cat /proc/%u/maps", getpid()); system(buf); return 0; } |
|
From: WAROQUIERS P. <phi...@eu...> - 2011-07-01 14:20:26
|
Checked with 3.7.0 SVN and the problem is still there. But I think I know what it is (wrong check of segment state in the implementation of the mremap). I will work on that this evening, and if confirmed, will prepare a patch and file a bug in bugzilla. Philippe ____ This message and any files transmitted with it are legally privileged and intended for the sole use of the individual(s) or entity to whom they are addressed. If you are not the intended recipient, please notify the sender by reply and delete the message and any attachments from your system. Any unauthorised use or disclosure of the content of this message is strictly prohibited and may be unlawful. Nothing in this e-mail message amounts to a contractual or legal commitment on the part of EUROCONTROL, unless it is confirmed by appropriately signed hard copy. Any views expressed in this message are those of the sender. |
|
From: WAROQUIERS P. <phi...@eu...> - 2011-07-04 22:53:00
|
>I will work on that this evening, and if confirmed, will prepare >a patch and file a bug in bugzilla. https://bugs.kde.org/show_bug.cgi?id=276993 filed in bugzilla (with patch containing a test case and a fix for 3.7.0 SVN) Philippe ____ This message and any files transmitted with it are legally privileged and intended for the sole use of the individual(s) or entity to whom they are addressed. If you are not the intended recipient, please notify the sender by reply and delete the message and any attachments from your system. Any unauthorised use or disclosure of the content of this message is strictly prohibited and may be unlawful. Nothing in this e-mail message amounts to a contractual or legal commitment on the part of EUROCONTROL, unless it is confirmed by appropriately signed hard copy. Any views expressed in this message are those of the sender. |
|
From: Jan E. <je...@me...> - 2011-07-04 23:20:31
|
On Tuesday 2011-07-05 00:52, WAROQUIERS Philippe wrote: > >>I will work on that this evening, and if confirmed, will prepare >>a patch and file a bug in bugzilla. > >https://bugs.kde.org/show_bug.cgi?id=276993 > >filed in bugzilla (with patch containing a test case and a fix for 3.7.0 >SVN) > >Philippe + /* first find free segment of 40K, then unmap it */ + void *initial_area = mmap((void *)0x10000000, 40960, PROT_READ|PROT_WRITE, + MAP_ANONYMOUS|MAP_PRIVATE,0,0); The 0x10000000 stems from my experimenting around (in particular, 0x10000000 was a definitely free area in my runtime environment); as far as the test case is concerned, mmap should probably just be called with NULL as first argument to pick any available address. |
|
From: WAROQUIERS P. <phi...@eu...> - 2011-07-05 00:07:56
|
> >The 0x10000000 stems from my experimenting around (in particular, >0x10000000 was a definitely free area in my runtime >environment); as far >as the test case is concerned, mmap should probably just be called >with NULL as first argument to pick any available address. It does not arm to use 0x10000000 so I preferred to keep the address you had in your test case. In case this address is not free, mmap returns another one. I have tested a.o. on debian5/ppc64, in which 0x10000000 is not ok and on e.g. f12/x86, where it is ok. In both cases, the test was failing without the patch, and succeeds with the patch (whatever the address returned by the initial mmap). Philippe ____ This message and any files transmitted with it are legally privileged and intended for the sole use of the individual(s) or entity to whom they are addressed. If you are not the intended recipient, please notify the sender by reply and delete the message and any attachments from your system. Any unauthorised use or disclosure of the content of this message is strictly prohibited and may be unlawful. Nothing in this e-mail message amounts to a contractual or legal commitment on the part of EUROCONTROL, unless it is confirmed by appropriately signed hard copy. Any views expressed in this message are those of the sender. |