Ticket #11295 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

insufficient resources for operation in wikipedia

Reported by: carrott Owned by: godiard
Priority: normal Milestone: 11.3.0
Component: wikibrowse-activity Version: Development build as of this date
Keywords: Cc: dsd
Action Needed: test in build Verified: no
Deployments affected: Blocked By:
Blocking:

Description

os-7, XO-1.75, WikipediaEN 28

1. Start WikipediaEN 1. Click Energy 1. Wait for the page to load 1. Scroll 1. Observe Activity Disappears and the below log message 1. See attached for full log

xo-6d-6c-3a.localdomain - - [01/Jan/2000 00:27:09] "GET /static/outgoing_link.gif HTTP/1.1" 200 -
Fontconfig warning: Directory/file mtime in the future. New fonts may not be detected

Gdk-ERROR **: The program 'sugar-activity' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadAlloc (insufficient resources for operation)'.
  (Details: serial 6859 error_code 11 request_code 53 minor_code 0)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
aborting...
ready
Terminated by signal 6, pid 1738 data (None, <open file '<fdopen>', mode 'w' at 0xc08d30>, 'a080f34eb2432617adad05f5cb84c6c6f38700c9')

Attachments

org.laptop.WikipediaActivityEN-1.log (7.2 kB) - added by carrott 3 years ago.
log from wikipediaen-28
0001-Use-size-parameter-to-set-the-request-thumbnail-size.patch (1.0 kB) - added by godiard 3 years ago.
0002-Set-size-to-thumbnails-in-galleries-too.patch (0.9 kB) - added by godiard 3 years ago.

Change History

Changed 3 years ago by carrott

log from wikipediaen-28

  Changed 3 years ago by erikos

  • owner changed from cjb to godiard
  • milestone changed from Not Triaged to 1.75-software

  Changed 3 years ago by greenfeld

  • cc jnettlet added
  • next_action changed from never set to diagnose

  Changed 3 years ago by godiard

  • next_action changed from diagnose to add to build

Solved in Wikipedia-30/WikipediaEN-30

Related to http://bugs.sugarlabs.org/ticket/3183

Changed 3 years ago by godiard

  Changed 3 years ago by godiard

  • cc dsd added
  • milestone changed from 1.75-software to 11.3.0

I have added two patches:

* One fix my mistake and use the requested size instead of 300px.

* The second request the thumbnails to images in galeries. (Can be tested in the page "Spain")

The code is working with images with special characters (Can be tested in the page "Coruña", the first image have special char in the name)

The only problem I could not solve was the case where there are a image smaller than the requested thumbnail size. I have found one case in the page "Planet", in the Orbit section.

A reference to the image parameters in wikipedia is here http://en.wikipedia.org/wiki/Wikipedia:Extended_image_syntax

follow-up: ↓ 6   Changed 3 years ago by dsd

Thanks for checking all that. I guess there is no easy solution for the planet issue.

Do you know of any pages that use a image of type "frame"? The Extended image syntax page suggests that you can't apply a size attribute to a framed image, which your work does, but after a very brief look I can't find any examples to test with.

Have you tested pages with SVG images? It looks like wikipedia will do thumbnails of svg images, but it will present them in PNG format (e.g. http://upload.wikimedia.org/wikipedia/en/thumb/c/ce/SVG-logo.svg/500px-SVG-logo.svg.png). Your patch will still use <object> to display them when actually it should be <img> right?

Also I can't quite grok the final hunk of your original commit, specifically this line: https://dev.laptop.org/git/projects/wikiserver/tree/server.py#n439

            self.out.write('<a href="%s">' % url_thumb.encode('utf8'))

What does that final 'else' condition represent, and is it definitely correct to use the thumbnail rather than the real image as the link target here?

in reply to: ↑ 5   Changed 2 years ago by godiard

  • cc jnettlet removed

Replying to dsd:

Thanks for checking all that. I guess there is no easy solution for the planet issue. Do you know of any pages that use a image of type "frame"? The Extended image syntax page suggests that you can't apply a size attribute to a framed image, which your work does, but after a very brief look I can't find any examples to test with.

There are few (34) images with type "frame" and a defined size. One is the first image in the page "Henry Ford". There are also images with type "frame" but without size, like in "2004 Indian Ocean Earthquake", the first animation in the section "Tsunami characteristics". Is logic do not have a size and is not scaled, because wikipedia does not scale animated gifs. Both cases are well displayed.

Have you tested pages with SVG images? It looks like wikipedia will do thumbnails of svg images, but it will present them in PNG format (e.g. http://upload.wikimedia.org/wikipedia/en/thumb/c/ce/SVG-logo.svg/500px-SVG-logo.svg.png). Your patch will still use <object> to display them when actually it should be <img> right?

The original code (and my patch) exclude the svg images, because in more cases the svg image will be smaller than the resulting png. The SVG are ok, and you can see it in the Planet page, in the "Orbit" section (just over the missing little image). Another example is the first image in "Olympic Games" page.

Also I can't quite grok the final hunk of your original commit, specifically this line: https://dev.laptop.org/git/projects/wikiserver/tree/server.py#n439 {{{ self.out.write('<a href="%s">' % url_thumb.encode('utf8')) }}} What does that final 'else' condition represent, and is it definitely correct to use the thumbnail rather than the real image as the link target here?

It's true. This is a link then, does not have sense change it. I don't know in what conditions the else part can be executed, but was present in the code.

  Changed 2 years ago by dsd

OK great, sounds like all the questionable cases are covered then (svg, frame, special characters) with the only small issue being tiny images, which are not common. It is looking good indeed.

I don't understand your comment about the final else clause. Your patch does change the original code behaviour, from linking to the original image, to linking to the thumbnail, and it's the only part of the patch I don't understand.

  Changed 2 years ago by dsd

fixed in wikipediaES-31 and wikipediaEN-31, thanks gonzalo!

  Changed 2 years ago by dsd

  • next_action changed from add to build to test in build

test in 11.3.0 candidate build 882

  Changed 2 years ago by erikos

Looks good in os883

  Changed 2 years ago by dsd

  • status changed from new to closed
  • resolution set to fixed

Tested 11.3.0 build 882 on XO-1.75, could not reproduce crashes loading and scrolling the Energy page in wikipediaEN

Note: See TracTickets for help on using tickets.