Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adobe apps crash when dealing with CSS in generated SVG files #2146

Open
dmolesUC opened this issue Oct 9, 2024 · 6 comments
Open

Adobe apps crash when dealing with CSS in generated SVG files #2146

dmolesUC opened this issue Oct 9, 2024 · 6 comments

Comments

@dmolesUC
Copy link

dmolesUC commented Oct 9, 2024

Steps to reproduce:

  1. From this D2 file, generate an SVG, as:
    • d2 index.d2 index.svg
  2. 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 optimization: tree-shake css themes #2145 and/or make a "minimal" theme #2072?
@cyborg-ts cyborg-ts added this to D2 Oct 9, 2024
@alixander
Copy link
Collaborator

i'm actively working on inlining styles. the segfault is adobe's fault though lol

@alixander
Copy link
Collaborator

related: #2142

@alixander
Copy link
Collaborator

alixander commented Oct 9, 2024

Let's see if it works after #2142 is fixed in the next release. If it's really the presence of <style> that's causing the crash, then we'll need to add a flag for rendering with only inline styles (e.g. --no-css or --inline-styles)

@alixander
Copy link
Collaborator

Maybe also convert text to paths

Screenshot 2024-10-10 at 7 00 52 AM

@alixander
Copy link
Collaborator

@dmolesUC can you check if D2 on the latest version still crashes?

@dmoles
Copy link

dmoles commented Nov 22, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

3 participants