drawio-desktop icon indicating copy to clipboard operation
drawio-desktop copied to clipboard

Parallel PNG exports cause various errors, even segmentation faults

Open Paebbels opened this issue 1 month ago • 2 comments

Preflight Checklist

  • [x] I agree to follow the Code of Conduct that this project adheres to.
  • [x] I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Describe the bug

Following this StackOverflow article, we developed a Bash script to export diagrams from multiple *.drawio files, potentially containing multiple diagrams per file, into a directory. Our script starts multiple DrawIO instances (using drawio ... &) in parallel to speedup the exporting process.

When executed in parallel, the following errors (just a selection) have been recorded:

  1. [68119:1031/155946.404558:ERROR:net/disk_cache/blockfile/backend_impl.cc:986] Critical error found -8
    [68121:1031/155946.423339:ERROR:net/disk_cache/blockfile/backend_impl.cc:986] Critical error found -8
    [68132:1031/155946.432622:ERROR:net/disk_cache/blockfile/backend_impl.cc:986] Critical error found -8
    [68120:1031/155946.445253:ERROR:net/disk_cache/blockfile/backend_impl.cc:986] Critical error found -8
    [68129:1031/155946.472229:ERROR:net/disk_cache/blockfile/backend_impl.cc:986] Critical error found -8
    [68137:1031/155946.474177:ERROR:net/disk_cache/blockfile/backend_impl.cc:986] Critical error found -8
    [68127:1031/155946.478406:ERROR:net/disk_cache/blockfile/backend_impl.cc:986] Critical error found -8
    [68123:1031/155946.486087:ERROR:net/disk_cache/blockfile/backend_impl.cc:986] Critical error found -8
    [68135:1031/155946.496028:ERROR:net/disk_cache/blockfile/backend_impl.cc:986] Critical error found -8
    [68139:1031/155947.037409:ERROR:net/disk_cache/blockfile/backend_impl.cc:986] Critical error found -8
    [68139:1031/155947.037587:ERROR:net/disk_cache/blockfile/entry_impl.cc:953] Failed to save user data
    [68133:1031/155947.077053:ERROR:net/disk_cache/blockfile/backend_impl.cc:986] Critical error found -8
    
  2. [68139:1031/155947.037587:ERROR:net/disk_cache/blockfile/entry_impl.cc:953] Failed to save user data
    
  3. [61407:1031/155921.759267:ERROR:content/browser/network_service_instance_impl.cc:597] Network service crashed, restarting service.
    
  4. [49354:1031/155131.965047:ERROR:gpu/ipc/host/gpu_disk_cache.cc:245] Failed retry to open blob cache entry: -2
    
  5. ./export_DrawIO.sh: line 16: 51190 Segmentation fault      (core dumped) drawio --export --page-index $((i+1)) --crop --border 5 --output "${base_name}_${names[i]}.png" "$file"
    
  6. ...

To Reproduce The used script export.sh:

#!/bin/bash

ANSI_LIGHT_GREEN=$'\x1b[92m'
ANSI_LIGHT_YELLOW=$'\x1b[93m'
ANSI_LIGHT_BLUE=$'\x1b[94m'
ANSI_NOCOLOR=$'\x1b[0m'

for file in "$@"; do
    base_name="${file%.*}"

    # Count how many pages exist per *.drawio file. Use "diagram" tag as indication. Also extract page names.
    mapfile -t names < <(sed -nE  's/.*<diagram.*name="([^"]*).*/\1/p' "$file")
    printf "${ANSI_LIGHT_YELLOW}Exporting from '$base_name'${ANSI_NOCOLOR}\n"

    # Export each page as an PNG
    for i in "${!names[@]}"; do
        printf "  ${ANSI_LIGHT_BLUE}page '${names[i]}' ...${ANSI_NOCOLOR}\n"
        drawio --export --page-index $((i+1)) --crop --border 5 --output "${base_name}_${names[i]}.png" "$file" &
    done
done

printf "${ANSI_LIGHT_YELLOW}Waiting for exports to finish ...${ANSI_NOCOLOR}\n"
wait

printf "${ANSI_LIGHT_GREEN}Finished export${ANSI_NOCOLOR}\n"

The used *.drawio file: My-Test.drawio

Steps to reproduce the behavior:

  1. Download script and use any *.drawio file (or provided file from above)
  2. Set execution rights (chmod u+x export.sh)
  3. Run script multiple times: ./export.sh My-Test.drawio
  4. Check console outputs

Expected behavior Parallel execution of DrawIO should be possible. Especially parallel export should be working. It shouldn't cause internal errors or even segmentation error.

Screenshots See provided console outputs above.

draw.io version (In the Help->About menu of the draw.io editor):

  • draw.io version: 28.2.5

Desktop (please complete the following information):

  • OS: Linux, Mint 22.2 Cinnamon

Additional context Add any other context about the problem here.


/cc @stefanunrein, @skoehler, @navidcity

Paebbels avatar Oct 31 '25 16:10 Paebbels