#28 Crash on drop or open of multiple files


Running the current (revision 64) subversion code:

If you attempt to drag-n-drop multiple files at once, or even open multiple files at once from the file dialog, pdfshuffler crashes. It does so in odd ways depending on which files you open, as if the files are completely corrupted. Yet everything works fine if you drop or open them one at a time.


  • Jason Tibbitts

    Jason Tibbitts - 2012-03-02

    I spent a little time trying to track this down in a debugger. All I can figure out is that it appears some state isn't getting cleared or there a race condition somewhere when the thumbnails are being rendered, but I can't tell exactly where as when I single step through the whole thing it doesn't crash (which is what makes me suspect a race).

    Unfortunately I'm pretty much at the limit of my understanding here, but if you have hints I'll be happy to pursue them.

  • Jason Tibbitts

    Jason Tibbitts - 2012-03-03

    An even easier way to trigger this is to just pass two pdf files on the command line.

    To further explore the race condition possibility, I disabled starting of the render thread at the end of add_pdf_pages() and the problem does not occur. So I re-enabled it and added a short delay at the beginning of the render() function and again the problem does not occur. On my hardware it's sufficient to time.sleep(0.01) as the third line of render(). (A shorter time did not help the crashes.) I see another short sleep in PDF_Render::run() but increasing it doesn't seem to help with this issue.

  • logari81

    logari81 - 2012-03-04
    • assigned_to: nobody --> logari81
  • logari81

    logari81 - 2012-03-05

    could you try with:

    if self.rendering_thread:
    self.rendering_thread.quit = True


  • Jason Tibbitts

    Jason Tibbitts - 2012-03-05

    Adding self.rendering_thread.join() to the end of the first if clause in the render() function in a fresh, unmodified install does appear to solve the problem for me.

  • logari81

    logari81 - 2012-04-28
    • status: open --> closed
  • logari81

    logari81 - 2012-04-28
    • status: closed --> closed-fixed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks