Bug 10729 - After the Upgrade to python-pillow, PySolFC cannot load .jpg files as table tiles.
Summary: After the Upgrade to python-pillow, PySolFC cannot load .jpg files as table t...
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: x86_64 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Philippe Makowski
QA Contact:
URL:
Whiteboard:
Keywords: Triaged
Depends on:
Blocks:
 
Reported: 2013-07-07 14:30 CEST by Shlomi Fish
Modified: 2013-09-12 16:58 CEST (History)
0 users

See Also:
Source RPM: python-pillow-2.0.0-0.gitd1c6db8.4.mga4.src.rpm
CVE:
Status comment:


Attachments
Patch to update PySolFC for Pillow - but there's a segfault (2.55 KB, patch)
2013-07-08 17:22 CEST, Shlomi Fish
Details | Diff
A Python program that reproduces the problem. (2.94 KB, text/x-python)
2013-07-08 19:14 CEST, Shlomi Fish
Details

Description Shlomi Fish 2013-07-07 14:30:18 CEST
Description of problem:

After the upgrade to python-pillow, PySolFC cannot load .jpg files as table tiles. It can load .gifs fine.

<<<
shlomif[rpms]:$mageia/python-pillow$ rpm -ql PySolFC | grep -P '\.jpg$'
/usr/share/PySolFC/images/stats/progression.jpg
/usr/share/PySolFC/tiles/save-aspect/Paradise_Wide.jpg
/usr/share/PySolFC/tiles/stretch/Blue_Fractal.jpg
>>>

But I cannot see the Paradise_Wide.jpg and the Blue_Fractal.jpg table tile in the list in [Menu] -> Options -> "Table Tile..." nor is my custom table tile still displayed. This seems like a regression from python-imaging.

Version-Release number of selected component (if applicable):

Cauldron.

How reproducible:


Steps to Reproduce:
1. Install the "PySolFC" package.
2. Run pysol on the command line.
3. Access [Menu] -> Options -> "Table Tile..."


Reproducible: 

Steps to Reproduce:
Manuel Hiebel 2013-07-08 12:21:52 CEST

Keywords: (none) => Triaged
Assignee: bugsquad => makowski.mageia

Comment 1 Philippe Makowski 2013-07-08 16:24:17 CEST
yes listed here : https://wiki.mageia.org/en/Feature:Pillow
with a link to Fedora patch : https://bugzilla.redhat.com/show_bug.cgi?id=893781
Comment 2 Shlomi Fish 2013-07-08 17:22:15 CEST
Created attachment 4198 [details]
Patch to update PySolFC for Pillow - but there's a segfault

Hi.

This is a patch against svn+ssh://svn.mageia.org/svn/packages/cauldron/PySolFC/current for fixing PySol, however on this machine, there is a crash or memory corruption with pillow somewhere in the middle. I'm getting:

ImagePalette.py(101):     return palette
Image.py(723):             self.palette.dirty = 1
Image.py(724):             self.load()
 --- modulename: Image, funcname: load
Image.py(624):         if self.im and self.palette and self.palette.dirty:
Image.py(626):             self.im.putpalette(*self.palette.getdata())
 --- modulename: ImagePalette, funcname: getdata
ImagePalette.py(40):         if self.rawmode:
ImagePalette.py(41):             return self.rawmode, self.palette
Image.py(627):             self.palette.dirty = 0
Image.py(628):             self.palette.mode = "RGB"
Image.py(629):             self.palette.rawmode = None
Image.py(630):             if "transparency" in self.info:
Image.py(631):                 if isinstance(self.info["transparency"], int):
Image.py(632):                     self.im.putpalettealpha(self.info["transparency"], 0)
Image.py(635):                 self.palette.mode = "RGBA"
Image.py(637):         if self.im:
Image.py(638):             return self.im.pixel_access(self.readonly)
Image.py(726):         try:
Image.py(727):             im = self.im.convert(mode, dither)
Image.py(736):         return self._new(im)
 --- modulename: Image, funcname: _new
Image.py(462):         new = Image()
 --- modulename: Image, funcname: __init__
Image.py(453):         self.im = None
Image.py(454):         self.mode = ""
Image.py(455):         self.size = (0, 0)
Image.py(456):         self.palette = None
Image.py(457):         self.info = {}
Image.py(458):         self.category = NORMAL
Image.py(459):         self.readonly = 0
Image.py(463):         new.im = im
Image.py(464):         new.mode = im.mode
Image.py(465):         new.size = im.size
Image.py(466):         new.palette = self.palette
Image.py(467):         if im.mode == "P":
Image.py(470):         try:
Image.py(471):             new.info = self.info.copy()
Image.py(477):         return new
Image.py(1127):             im = im.im

My computer has the following SPECS:

<<<
 My primary machine is a desktop machine with a:

    An Intel Core i3 CPU (x86-64).
    8 GB of RAM.
    Intel Corporation Sandy Bridge Integrated Graphics Controller (rev 09)
    A 2 TB hard-disk.
    A 19×´ LCD Screen by ViewSonic.
    Intel Corporation Cougar Point High Definition Audio Controller.
    Intel Corporation 82579V Gigabit Network Connection.
>>>
Comment 3 Shlomi Fish 2013-07-08 19:14:25 CEST
Created attachment 4199 [details]
A Python program that reproduces the problem.

This is a python program that reproduces the problem - but it also happens with Pillow-2.1.0 or Pillow-trunk as compiled from source:

shlomif@telaviv1:~$ python TRY_REPRODUCE_BUG.py 
*** Error in `python': malloc(): memory corruption: 0x0000000002a53c50 ***
Comment 4 Philippe Makowski 2013-07-08 21:09:02 CEST
strange
as you are in 64 bit, try with this patch :
http://pkgs.fedoraproject.org/cgit/python-pillow.git/tree/python-pillow-archs.patch

but here under Fedora and same Pillow as in Mageia, your test program run without problem

I will test under Mageia asap
Comment 5 Philippe Makowski 2013-07-08 21:30:43 CEST
sorry I didn't read correctly the patch, it is not need for us
Comment 6 Shlomi Fish 2013-07-08 21:36:04 CEST
(In reply to Philippe Makowski from comment #4)
> strange
> as you are in 64 bit, try with this patch :
> http://pkgs.fedoraproject.org/cgit/python-pillow.git/tree/python-pillow-
> archs.patch
> 
> but here under Fedora and same Pillow as in Mageia, your test program run
> without problem
> 
> I will test under Mageia asap

Hi Philippe,

some news:

1. I was able to reproduce the problem with both pysol.py and my test program on an x86-64 Ubuntu 13.04 VM with Pillow compiled from source.

2. Your patch does not apply cleanly to the python-pillow SPEC. How should I apply it?

Regards,

-- Shlomi Fish
Comment 7 Philippe Makowski 2013-07-08 22:25:59 CEST
sorry I can't reproduce your problem, neither under Fedora, neither under Mageia

I even just build under iurt latest 2.1.0 (that I will push in few minutes)
and add your test that run without problem :

+ PYTHONPATH=/home/philippe/rpmbuild/BUILD/python-imaging-Pillow-75af7e0/build/lib.linux-x86_64-2.7/build/lib.linux-x86_64-2.7
+ /usr/bin/xvfb-run /usr/bin/python TRY_REPRODUCE_BUG.py

and no segfault

note I added in your script a line :
import sys


please try in few minutes with 2.1.0
Comment 8 Philippe Makowski 2013-07-08 22:38:31 CEST
maybe a problem with your graphic controller ?
https://bbs.archlinux.org/viewtopic.php?pid=710093
Comment 9 Shlomi Fish 2013-07-09 09:15:10 CEST
Hi Philippe,

(In reply to Philippe Makowski from comment #7)
> sorry I can't reproduce your problem, neither under Fedora, neither under
> Mageia
> 
> I even just build under iurt latest 2.1.0 (that I will push in few minutes)
> and add your test that run without problem :
> 
> +
> PYTHONPATH=/home/philippe/rpmbuild/BUILD/python-imaging-Pillow-75af7e0/build/
> lib.linux-x86_64-2.7/build/lib.linux-x86_64-2.7
> + /usr/bin/xvfb-run /usr/bin/python TRY_REPRODUCE_BUG.py
> 
> and no segfault
> 
> note I added in your script a line :
> import sys
> 
> 
> please try in few minutes with 2.1.0

I tried it - same thing.

Regards,

-- Shlomi Fish
Comment 10 Shlomi Fish 2013-07-09 09:20:36 CEST
(In reply to Philippe Makowski from comment #8)
> maybe a problem with your graphic controller ?
> https://bbs.archlinux.org/viewtopic.php?pid=710093

What am I looking for in this page? I believe I have a Kernel Mode Setting enabled, and I have 3-D graphics' effects too. And X starts fine.

Regards,

-- Shlomi Fish
Comment 11 Philippe Makowski 2013-07-09 10:36:48 CEST
can you then report it upstream, I have no idea of what your problem is, since I can't reproduce it, wathever the hardware and the distro I use.
Comment 12 Shlomi Fish 2013-07-09 11:25:28 CEST
(In reply to Philippe Makowski from comment #11)
> can you then report it upstream, I have no idea of what your problem is,
> since I can't reproduce it, wathever the hardware and the distro I use.

I guess I can.

Regards,

-- Shlomi Fish
Comment 13 Shlomi Fish 2013-07-09 13:04:27 CEST
(In reply to Shlomi Fish from comment #12)
> (In reply to Philippe Makowski from comment #11)
> > can you then report it upstream, I have no idea of what your problem is,
> > since I can't reproduce it, wathever the hardware and the distro I use.
> 
> I guess I can.
> 

See https://github.com/python-imaging/Pillow/issues/278

Regards,

-- Shlomi Fish

> Regards,
> 
> -- Shlomi Fish
Comment 14 Philippe Makowski 2013-09-07 20:03:57 CEST
new patched version python-pillow-2.1.0-0.2.mga4 should fix the problem
Comment 15 Philippe Makowski 2013-09-11 20:29:00 CEST
is the fix ok ? can we close this bug ?
Comment 16 Shlomi Fish 2013-09-12 16:58:03 CEST
(In reply to Philippe Makowski from comment #15)
> is the fix ok ? can we close this bug ?

Yes, the fix is OK.

Resolving as FIXED. Can you comment regarding the fix on the upstream issue I opened so they'll know how to fix it? https://github.com/python-imaging/Pillow/issues/278 .

Regards,

-- Shlomi Fish

Status: NEW => RESOLVED
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.