documentcloud / docsplit

Break Apart Documents into Images, Text, Pages and PDFs
http://documentcloud.github.com/docsplit/
Other
833 stars 214 forks source link

*** glibc detected *** gm: realloc(): invalid next size: 0x00007f4b7e88e0c0 *** #113

Closed lordfinal closed 10 years ago

lordfinal commented 10 years ago

Hi,

I have a funny problem. I have a svg file which I has to be rendered to a jpg file, but gm convert gets an error: * glibc detected * gm: realloc(): invalid next size: 0x00007f4b7e88e0c0 *** So far non of your concern, but I use Docsplit within another ruby script an this script stop thanks to this bug.

Sincerely lordf

lordfinal commented 10 years ago

I'm working on a solution...

nathanstitt commented 10 years ago

Thanks for reporting the issue. As you've already figured out, the issue appears to lie with GraphicsMagick. Docsplit uses whatever gm binary is available on your system and doesn't embed it. Therefore you may be able to switch to a different version that doesn't have the issue.

Once you narrow down the gm version that are affected, I'd also say you could submit the issue along with the jpg to the GraphicsMagick project.

I'll close the issue for now since it doesn't seem to be related to anything that we're doing. If it does turn out to be an issue with Docsplit, please re-open and let us know.

lordfinal commented 10 years ago

I think it would be better if docsplit is detached from the system calls. So even if the system call generates an error and get stuck, docsplit should return.

I wrote something like this (it's just pseudo code ;-)):

Docsplit.run_shellcode(cmd)

def self.run_shellcmd(cmd) pid = spawn(cmd) while run_time < x sec AND check_cmd_output() if process_exists?(pid) kill(pid) #process runs but should have ended at least in x sec end end