Win32 built on Apr 9 2015 21:05:04 Compiler: 4.6.2 Latest update: #50039 thanks in advance 2015-03-13 21:22 GMT+01:00 stepharo <[hidden email]>:
|
the code (reverting igors change for the 1 pixel extra height) 2015-05-08 0:43 GMT+02:00 Nicolai Hess <[hidden email]>:
issue_14813.cs (832 bytes) Download Attachment |
In reply to this post by Nicolai Hess
Hi Code for loading it can be very helpfull |
2015-05-08 10:05 GMT+02:00 Denis Kudriashov <[hidden email]>:
:) Gofer new smalltalkhubUser: 'Pharo' project: 'Bloc'; load; configurationOf: 'Bloc'; loadBleedingEdge |
2015-05-08 11:06 GMT+02:00 Denis Kudriashov <[hidden email]>:
Thank you for testing.
|
In reply to this post by Nicolai Hess
On 8 May 2015 at 00:43, Nicolai Hess <[hidden email]> wrote:
Be sure, my fried, the bug is there, sitting in VM. Bitblt implementation prereads a pixel from bitmap *before* checking the loop bounds, meaning that it reads at least a single byte beyond the actual contents of the bitmap. It is not harmful in cases when bitmap is allocated in object memory since VM memory design actually guarantees, that there are at least certain amount of bytes in form of breathing space always available, so reading single word past any allocated object is not hurts.. But not in case, when bitmap residing in external heap.. because reading beyond allocated space might cause segmentation fault.. and it was, until i figured what was causing it and where the bug is.
-- Best regards,
Igor Stasenko. |
On 8 May 2015 at 21:32, Igor Stasenko <[hidden email]> wrote:
The workaround, that i introduced was simply to tell Cairo to allocate surface 1 row taller and then use smaller height in bitblt operations, so it can never use the last row.. that, of course, going in conflict of using cairo for a patterns to fill things with bitmaps, which relying on surface's dimensions and using all its pixels.. :( hmm..
-- Best regards,
Igor Stasenko. |
2015-05-08 21:42 GMT+02:00 Igor Stasenko <[hidden email]>:
This mean it can happen every time we read form data from a surface plugin - it is not only an issue for athens/cairo. I will take a look at bitblt implementation. Thank you !
|
On 8 May 2015 at 22:20, Nicolai Hess <[hidden email]> wrote:
Right, this is not cairo-only issue.. It just manifested itself when i was started using external surfaces allocated by cairo with bitblt. Which was causing occasional, irregular crashes time to time and i was quite lucky finding the cause of it.
-- Best regards,
Igor Stasenko. |
In reply to this post by Nicolai Hess
On Fri, May 8, 2015 at 6:43 AM, Nicolai Hess <[hidden email]> wrote:
I am unable to produce the segfault on OSX Mavericks with neither old nor new VMs... Image ----- /Users/ben/Library/Application Support/Pharo/images/Athens BitBlt-50041/Athens BitBlt-50041.image Pharo5.0 Latest update: #50041 Unnamed Virtual Machine --------------- /Applications/Pharo.app/Contents/MacOS/Pharo NBCoInterpreter NativeBoost-CogPlugin-GuillermoPolito.19 uuid: acc98e51-2fba-4841-a965-2975997bba66 May 15 2014 NBCogit NativeBoost-CogPlugin-GuillermoPolito.19 uuid: acc98e51-2fba-4841-a965-2975997bba66 May 15 2014 https://github.com/pharo-project/pharo-vm.git Commit: ed4a4f59208968a21d82fd2406f75c2c4de558b2 Date: 2014-05-15 18:23:04 +0200 By: Esteban Lorenzano <[hidden email]> Jenkins build #14826 Mac Cocoa Cog 5.8b12 21-Sep-10 >1B0534FA-246C-47C5-AB29-7A76C81CCDCB< VMMaker versionString https://github.com/pharo-project/pharo-vm.git Commit: ed4a4f59208968a21d82fd2406f75c2c4de558b2 Date: 2014-05-15 18:23:04 +0200 By: Esteban Lorenzano <[hidden email]> Jenkins build #14826 NBCoInterpreter NativeBoost-CogPlugin-GuillermoPolito.19 uuid: acc98e51-2fba-4841-a965-2975997bba66 May 15 2014 NBCogit NativeBoost-CogPlugin-GuillermoPolito.19 uuid: acc98e51-2fba-4841-a965-2975997bba66 May 15 2014 Virtual Machine --------------- /Users/ben/Library/Application Support/Pharo/vm/pharo-mac-stable-vm/Contents/MacOS/Pharo NBCoInterpreter NativeBoost-CogPlugin-EstebanLorenzano.21 uuid: 4d9b9bdf-2dfa-4c0b-99eb-5b110dadc697 Apr 2 2015 NBCogit NativeBoost-CogPlugin-EstebanLorenzano.21 uuid: 4d9b9bdf-2dfa-4c0b-99eb-5b110dadc697 Apr 2 2015 https://github.com/pharo-project/pharo-vm.git Commit: 32d18ba0f2db9bee7f3bdbf16bdb24fe4801cfc5 Date: 2015-03-24 11:08:14 +0100 By: Esteban Lorenzano <[hidden email]> Jenkins build #14904 Mac Cocoa Cog 5.8b12 21-Sep-10 >1B0534FA-246C-47C5-AB29-7A76C81CCDCB< VMMaker versionString https://github.com/pharo-project/pharo-vm.git Commit: 32d18ba0f2db9bee7f3bdbf16bdb24fe4801cfc5 Date: 2015-03-24 11:08:14 +0100 By: Esteban Lorenzano <[hidden email]> Jenkins build #14904 NBCoInterpreter NativeBoost-CogPlugin-EstebanLorenzano.21 uuid: 4d9b9bdf-2dfa-4c0b-99eb-5b110dadc697 Apr 2 2015 NBCogit NativeBoost-CogPlugin-EstebanLorenzano.21 uuid: 4d9b9bdf-2dfa-4c0b-99eb-5b110dadc697 Apr 2 2015 cheers -ben |
Thank you for testing. I am sorry but I missed one additional change. This change set issue_14183.cs did not revert all. AthensCairoSurface class>>createGetSurfaceFormatFn You need to save and restart the image to use the change in createGetSurfaceFormatFn (I don't know how to manually reinitialize this method). 2015-05-09 10:41 GMT+02:00 Ben Coman <[hidden email]>:
issue_14813_II.cs (3K) Download Attachment |
In reply to this post by Igor Stasenko
Indeed I'm amazed. Freaky logic.
Stef Le 8/5/15 22:28, Igor Stasenko a
écrit :
|
In reply to this post by Igor Stasenko
2015-05-08 22:28 GMT+02:00 Igor Stasenko <[hidden email]>:
Any chance you remember what triggers this error? What code did you use, simple drawings or more advanced use of athens. Image patterns, gradient patterns. Or at least, what platform mac/win/linux? I tried different vm/image versions but only on windows so far. There were some changes on some bitblt functions, maybe the bug does not exist anymore? nicolai
|
I can't follow all the details, but I dug up for a few references that might relate... * [Vm-dev] There might be a bug in Bitblt copyloop * BitBltSimulation>>copyLoop, read ahead memory failure. * [Squeakland] [BUG] Can't use Squeakland plugin very well from Firefox... Review 3.8.13.b3 * Macintosh release - source code change notes Review 3.8.13.b3 * [pypy-commit] lang-smalltalk default: reverted the optimization to the copyLoop because it introduced clipping errors (BTC: Strange that smalltalk is mixing with pypy, so this might not relate at all) cheers -ben On Thu, May 14, 2015 at 5:22 AM, Nicolai Hess <[hidden email]> wrote:
|
Thank you Ben, I think this is the information I was looking for.2015-05-14 17:41 GMT+02:00 Ben Coman <[hidden email]>:
|
In reply to this post by Nicolai Hess
On 13 May 2015 at 23:22, Nicolai Hess <[hidden email]> wrote:
the easiest way to reproduce it would be: - allocate a new surface of such dimensions, that its buffer size will be aligned with 4k page boundary (a smallest one would be 1x1024, or 1024x1, since one pixel is 4 bytes) - try to blit this surface with bitblt - crash (sure it happens not always, since often there could be another memory page allocated for other purposes with read access granted, but if you continuously do that, you will inevitable face the crash)
-- Best regards,
Igor Stasenko. |
2015-06-09 18:03 GMT+02:00 Igor Stasenko <[hidden email]>:
Thank you for your feedback, but still no "luck" - no crash. Do you remember if this happens on windows at all or only on mac?
|
On 9 June 2015 at 22:54, Nicolai Hess <[hidden email]> wrote:
Dunno. I had it on my mac. Sure it may depend on how OS/C libs allocating memory. Anyways, since we're talking about using bitmaps as fill patterns for cairo, it should be safe as long as bitblt never involved with it. Actually registering surfaces with bitblt required only if they used in operations like copying their contents to Display form require this workaround, since it involves bitblt primitive(s). For the rest of cases (and if one day, hopefully we stop using bitblt altogether), the need in this workaround can be completely eliminated. So the issue can be localized if we split implementation and make a subclass, lets say CairoMorphicCompatibleSurface, where we move all registering logic together with workarounds, and in basic class simply throw exception on attempt to use it #asForm.
-- Best regards,
Igor Stasenko. |
Free forum by Nabble | Edit this page |