d2
d2 copied to clipboard
Adobe apps crash when dealing with CSS in generated SVG files
Steps to reproduce:
- From this D2 file, generate an SVG, as:
-
d2 index.d2 index.svg
-
- Open the resulting file in Adobe Illustrator 2024 or Adobe Photoshop 2024.
Expected behavior:
- File opens.
Actual behavior:
- Adobe application crashes with a segfault in
AdobeSVGRE.
Notes:
- Removing the generated
<style/>tags allows the application to open the file (though it's then transparent-on-black and unreadable). - Switching to the default theme doesn't solve the crashing problem (and only slightly reduces the generated file size).
- Might be solvable by #2145 and/or #2072?
i'm actively working on inlining styles. the segfault is adobe's fault though lol
related: https://github.com/terrastruct/d2/issues/2142
Let's see if it works after #2142 is fixed in the next release. If it's really the presence of
Maybe also convert text to paths
@dmolesUC can you check if D2 on the latest version still crashes?
Still crashes with 0.6.8, I'm afraid. 😕
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------
Process: Adobe Illustrator [14999]
Path: /Applications/Adobe Illustrator 2025/Adobe Illustrator.app/Contents/MacOS/Adobe Illustrator
Identifier: com.adobe.illustrator
Version: 29.0.1 (29.0.1)
Code Type: ARM-64 (Native)
Parent Process: launchd [1]
User ID: 501
Date/Time: 2024-11-22 13:19:35.6398 -0800
OS Version: macOS 15.0.1 (24A348)
Report Version: 12
Anonymous UUID: 144E807F-3728-20FA-AF95-4E3D1D923345
Sleep/Wake UUID: D50F74AF-11A0-4514-8A31-182EE9356BF4
Time Awake Since Boot: 63000 seconds
Time Since Wake: 57218 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Codes: 0x0000000000000001, 0x0000000000000000
Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process: exc handler [14999]
VM Region Info: 0 is not in any region. Bytes before following region: 4337319936
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
UNUSED SPACE AT START
--->
__TEXT 102864000-104f54000 [ 38.9M] r-x/r-x SM=COW /Applications/Adobe Illustrator 2025/Adobe Illustrator.app/Contents/MacOS/Adobe Illustrator
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 AdobeSVGRE 0x1071052e8 0x106fb4000 + 1381096
1 AdobeSVGRE 0x107105d40 0x106fb4000 + 1383744
2 AdobeSVGRE 0x107106094 0x106fb4000 + 1384596
3 AdobeSVGRE 0x1071016a8 0x106fb4000 + 1365672
4 AdobeSVGRE 0x1070fff8c 0x106fb4000 + 1359756
5 AdobeSVGRE 0x107012134 0x106fb4000 + 385332
6 AdobeSVGRE 0x10701127c 0x106fb4000 + 381564
7 AdobeSVGRE 0x107011070 0x106fb4000 + 381040
8 AdobeSVGRE 0x106fe8804 0x106fb4000 + 215044
9 AdobeSVGRE 0x106fe8bb4 0x106fb4000 + 215988
10 AdobeSVGRE 0x106fe8eb4 0x106fb4000 + 216756
11 AdobeSVGRE 0x10700ffe8 0x106fb4000 + 376808
12 AdobeSVGRE 0x106ff87f8 0x106fb4000 + 280568
13 AdobeSVGRE 0x106fc1428 0x106fb4000 + 54312
14 AdobeSVGRE 0x1071399b0 0x106fb4000 + 1595824
15 AdobeSVGRE 0x107129284 0x106fb4000 + 1528452
16 AdobeSVGRE 0x107144540 0x106fb4000 + 1639744
17 AdobeSVGRE 0x10714278c 0x106fb4000 + 1632140
18 AdobeSVGRE 0x10713dd9c 0x106fb4000 + 1613212
19 AdobeSVGRE 0x10713d9e0 0x106fb4000 + 1612256
20 AdobeSVGRE 0x107138d60 0x106fb4000 + 1592672
21 AdobeSVGRE 0x10700eb68 0x106fb4000 + 371560
22 AdobeSVGRE 0x10700edc4 0x106fb4000 + 372164
23 AdobeSVGRE 0x107085c40 0x106fb4000 + 859200
24 AdobeSVGRE 0x107081c98 0x106fb4000 + 842904
25 svgFileFormat 0x3081f46c4 0x308144000 + 722628
26 svgFileFormat 0x3081a1500 0x308144000 + 382208
27 svgFileFormat 0x30819c8b0 0x308144000 + 362672
28 svgFileFormat 0x30819db90 PluginMain + 252
29 Adobe Illustrator 0x1045767d8 0x102864000 + 30484440