MrMarble / termsvg

Record, share and export your terminal as a animated SVG image.
GNU General Public License v3.0
194 stars 10 forks source link

unexpected fault address 0x4a5e0c8 #9

Closed brian6932 closed 5 months ago

brian6932 commented 5 months ago

File in #8 will cause this.

stack 1 ``` ❯ termsvg export file.cast unexpected fault address 0x4a5e0c8 fatal error: fault [signal 0xc0000005 code=0x0 addr=0x4a5e0c8 pc=0x247804] goroutine 1 gp=0xc000068000 m=0 mp=0x61efc0 [running]: runtime.throw({0x3e0839?, 0xc0000a50e8?}) runtime/panic.go:1023 +0x65 fp=0xc0000a4e90 sp=0xc0000a4e60 pc=0x102305 runtime.sigpanic() runtime/signal_windows.go:414 +0xca fp=0xc0000a4ec0 sp=0xc0000a4e90 pc=0x116f6a github.com/mrmarble/termsvg/pkg/color.GetColor(0x390680?) github.com/mrmarble/termsvg/pkg/color/color.go:14 +0x24 fp=0xc0000a4ec8 sp=0xc0000a4ec0 pc=0x247804 github.com/mrmarble/termsvg/internal/svg.(*Canvas).getColors(0xc0000a5038, {0x1e600?, 0xc0?, 0x5c?, 0x0?}) github.com/mrmarble/termsvg/internal/svg/svg.go:98 +0x25 fp=0xc0000a4f30 sp=0xc0000a4ec8 pc=0x2484a5 github.com/mrmarble/termsvg/internal/svg.parseCast(0xc0000a5038) github.com/mrmarble/termsvg/internal/svg/svg.go:91 +0x13a fp=0xc0000a4fc0 sp=0xc0000a4f30 pc=0x24841a github.com/mrmarble/termsvg/internal/svg.createCanvas(0xc0001bc570, {{0x2, 0x79, 0x2a, 0x66477b02, 0x4022c9b140000000, 0x 0, {0x0, 0x0}, {0x0, ...}, ...}, ...}, ...) github.com/mrmarble/termsvg/internal/svg/svg.go:57 +0x14a fp=0xc0000a5248 sp=0xc0000a4fc0 pc=0x24800a github.com/mrmarble/termsvg/internal/svg.Export({{0x2, 0x79, 0x2a, 0x66477b02, 0x4022c9b140000000, 0x0, {0x0, 0x0}, {0x0, 0x0}, ...}, ...}, ...) github.com/mrmarble/termsvg/internal/svg/svg.go:49 +0x105 fp=0xc0000a52f0 sp=0xc0000a5248 pc=0x247de5 github.com/mrmarble/termsvg/cmd/termsvg/export.export({0xc000018588?, 0xc00000b568?}, {0xc000016cc0, 0x1c}, 0x0, {0x0, 0x 0}, {0x0, 0x0}, 0x0) github.com/mrmarble/termsvg/cmd/termsvg/export/export.go:73 +0x36b fp=0xc0000a5520 sp=0xc0000a52f0 pc=0x35368b github.com/mrmarble/termsvg/cmd/termsvg/export.(*Cmd).Run(0xc00003c338?) github.com/mrmarble/termsvg/cmd/termsvg/export/export.go:29 +0x85 fp=0xc0000a5590 sp=0xc0000a5520 pc=0x3532a5 runtime.call16(0xc000195830, 0xc000072188, 0x0, 0x0, 0x0, 0x8, 0xc0000a5868) runtime/asm_amd64.s:770 +0x48 fp=0xc0000a55b0 sp=0xc0000a5590 pc=0x132808 runtime.reflectcall(0x38bfa0?, 0xc00003c338?, 0x1?, 0xa5868?, 0xc0?, 0x1?, 0x1?) :1 +0x36 fp=0xc0000a55f0 sp=0xc0000a55b0 pc=0x13a016 reflect.Value.call({0x38bfa0?, 0xc00003c338?, 0x15d0b5?}, {0x3e03b6, 0x4}, {0xc0000a5ca8, 0x0, 0x160217?}) reflect/value.go:596 +0x90a fp=0xc0000a5bc8 sp=0xc0000a55f0 pc=0x168fca reflect.Value.Call({0x38bfa0?, 0xc00003c338?, 0x396de0?}, {0xc0000a5ca8, 0x0, 0x0}) reflect/value.go:380 +0x92 fp=0xc0000a5c30 sp=0xc0000a5bc8 pc=0x168592 github.com/alecthomas/kong.callFunction({0x38bfa0?, 0xc00003c338?, 0xc0000a5e20?}, 0xc0001957a0) github.com/alecthomas/kong@v0.8.1/callbacks.go:98 +0x465 fp=0xc0000a5d68 sp=0xc0000a5c30 pc=0x208945 github.com/alecthomas/kong.(*Context).RunNode(0xc00003c380, 0xc00018c4b0, {0xc0000a5f10, 0x1, 0x1}) github.com/alecthomas/kong@v0.8.1/context.go:765 +0x3fc fp=0xc0000a5e88 sp=0xc0000a5d68 pc=0x20da5c github.com/alecthomas/kong.(*Context).Run(0xc00003c380, {0xc0000a5f10, 0x1, 0x1}) github.com/alecthomas/kong@v0.8.1/context.go:790 +0xec fp=0xc0000a5ec8 sp=0xc0000a5e88 pc=0x20dc4c main.main() github.com/mrmarble/termsvg/cmd/termsvg/main_windows.go:58 +0x129 fp=0xc0000a5f78 sp=0xc0000a5ec8 pc=0x353f89 runtime.main() runtime/proc.go:271 +0x232 fp=0xc0000a5fe0 sp=0xc0000a5f78 pc=0x104a12 runtime.goexit({}) runtime/asm_amd64.s:1695 +0x1 fp=0xc0000a5fe8 sp=0xc0000a5fe0 pc=0x134301 goroutine 2 gp=0xc000068700 m=nil [force gc (idle)]: runtime.gopark(0x4132b8, 0x61dbc0, 0x11, 0xa, 0x1) runtime/proc.go:402 +0xfc fp=0xc00006bf80 sp=0xc00006bf50 pc=0x104e5c runtime.goparkunlock(0x61dbc0?, 0x0?, 0x0?, 0x0?) runtime/proc.go:408 +0x25 fp=0xc00006bfb0 sp=0xc00006bf80 pc=0x104ee5 runtime.forcegchelper() runtime/proc.go:326 +0xb5 fp=0xc00006bfe0 sp=0xc00006bfb0 pc=0x104c75 runtime.goexit({}) runtime/asm_amd64.s:1695 +0x1 fp=0xc00006bfe8 sp=0xc00006bfe0 pc=0x134301 created by runtime.init.6 in goroutine 1 runtime/proc.go:314 +0x1a goroutine 3 gp=0xc000068a80 m=nil [GC sweep wait]: runtime.gopark(0x4132b8, 0x61dfe0, 0xc, 0x9, 0x1) runtime/proc.go:402 +0xfc fp=0xc00006df58 sp=0xc00006df28 pc=0x104e5c runtime.goparkunlock(0x61dfe0?, 0x0?, 0x0?, 0x0?) runtime/proc.go:408 +0x25 fp=0xc00006df88 sp=0xc00006df58 pc=0x104ee5 runtime.bgsweep(0xc000024150) runtime/mgcsweep.go:278 +0xa5 fp=0xc00006dfc8 sp=0xc00006df88 pc=0xee625 runtime.gcenable.gowrap1() runtime/mgc.go:203 +0x25 fp=0xc00006dfe0 sp=0xc00006dfc8 pc=0xe2605 runtime.goexit({}) runtime/asm_amd64.s:1695 +0x1 fp=0xc00006dfe8 sp=0xc00006dfe0 pc=0x134301 created by runtime.gcenable in goroutine 1 runtime/mgc.go:203 +0x66 goroutine 4 gp=0xc000068c40 m=nil [GC scavenge wait]: runtime.gopark(0x4132b8, 0x61e880, 0xd, 0xa, 0x2) runtime/proc.go:402 +0xfc fp=0xc00007df48 sp=0xc00007df18 pc=0x104e5c runtime.goparkunlock(0x61e880?, 0x1?, 0x0?, 0xc000068c40?) runtime/proc.go:408 +0x25 fp=0xc00007df78 sp=0xc00007df48 pc=0x104ee5 runtime.(*scavengerState).park(0x61e880) runtime/mgcscavenge.go:425 +0x45 fp=0xc00007dfa0 sp=0xc00007df78 pc=0xebc85 runtime.bgscavenge(0xc000024150) runtime/mgcscavenge.go:653 +0x45 fp=0xc00007dfc8 sp=0xc00007dfa0 pc=0xec1e5 runtime.gcenable.gowrap2() runtime/mgc.go:204 +0x25 fp=0xc00007dfe0 sp=0xc00007dfc8 pc=0xe25a5 runtime.goexit({}) runtime/asm_amd64.s:1695 +0x1 fp=0xc00007dfe8 sp=0xc00007dfe0 pc=0x134301 created by runtime.gcenable in goroutine 1 runtime/mgc.go:204 +0xa5 goroutine 5 gp=0xc000068fc0 m=nil [finalizer wait]: runtime.gopark(0x412fe8, 0x6a5c70, 0x10, 0xa, 0x1) runtime/proc.go:402 +0xfc fp=0xc00006fe28 sp=0xc00006fdf8 pc=0x104e5c runtime.runfinq() runtime/mfinal.go:194 +0x107 fp=0xc00006ffe0 sp=0xc00006fe28 pc=0xe1647 runtime.goexit({}) runtime/asm_amd64.s:1695 +0x1 fp=0xc00006ffe8 sp=0xc00006ffe0 pc=0x134301 created by runtime.createfing in goroutine 1 runtime/mfinal.go:164 +0x45 ```
stack 2 ``` ❯ termsvg export file2.cast -o file2.svg unexpected fault address 0x4a5e0c8 fatal error: fault [signal 0xc0000005 code=0x0 addr=0x4a5e0c8 pc=0x247804] goroutine 1 gp=0xc000068000 m=0 mp=0x61efc0 [running]: runtime.throw({0x3e0839?, 0xc0000a50e8?}) runtime/panic.go:1023 +0x65 fp=0xc0000a4e90 sp=0xc0000a4e60 pc=0x102305 runtime.sigpanic() runtime/signal_windows.go:414 +0xca fp=0xc0000a4ec0 sp=0xc0000a4e90 pc=0x116f6a github.com/mrmarble/termsvg/pkg/color.GetColor(0x390680?) github.com/mrmarble/termsvg/pkg/color/color.go:14 +0x24 fp=0xc0000a4ec8 sp=0xc0000a4ec0 pc=0x247804 github.com/mrmarble/termsvg/internal/svg.(*Canvas).getColors(0xc0000a5038, {0x1e780?, 0xc0?, 0x5c?, 0x0?}) github.com/mrmarble/termsvg/internal/svg/svg.go:98 +0x25 fp=0xc0000a4f30 sp=0xc0000a4ec8 pc=0x2484a5 github.com/mrmarble/termsvg/internal/svg.parseCast(0xc0000a5038) github.com/mrmarble/termsvg/internal/svg/svg.go:91 +0x13a fp=0xc0000a4fc0 sp=0xc0000a4f30 pc=0x24841a github.com/mrmarble/termsvg/internal/svg.createCanvas(0xc0001ba5a0, {{0x2, 0x79, 0x2a, 0x66477b02, 0x4022917f78000000, 0x 0, {0x0, 0x0}, {0x0, ...}, ...}, ...}, ...) github.com/mrmarble/termsvg/internal/svg/svg.go:57 +0x14a fp=0xc0000a5248 sp=0xc0000a4fc0 pc=0x24800a github.com/mrmarble/termsvg/internal/svg.Export({{0x2, 0x79, 0x2a, 0x66477b02, 0x4022917f78000000, 0x0, {0x0, 0x0}, {0x0, 0x0}, ...}, ...}, ...) github.com/mrmarble/termsvg/internal/svg/svg.go:49 +0x105 fp=0xc0000a52f0 sp=0xc0000a5248 pc=0x247de5 github.com/mrmarble/termsvg/cmd/termsvg/export.export({0xc000016c80?, 0xc00000b618?}, {0xc000016ca0, 0x1a}, 0x0, {0x0, 0x 0}, {0x0, 0x0}, 0x0) github.com/mrmarble/termsvg/cmd/termsvg/export/export.go:73 +0x36b fp=0xc0000a5520 sp=0xc0000a52f0 pc=0x35368b github.com/mrmarble/termsvg/cmd/termsvg/export.(*Cmd).Run(0x16775d?) github.com/mrmarble/termsvg/cmd/termsvg/export/export.go:29 +0x85 fp=0xc0000a5590 sp=0xc0000a5520 pc=0x3532a5 runtime.call16(0xc000195830, 0xc000072178, 0x0, 0x0, 0x0, 0x8, 0xc0000a5868) runtime/asm_amd64.s:770 +0x48 fp=0xc0000a55b0 sp=0xc0000a5590 pc=0x132808 runtime.reflectcall(0x38bfa0?, 0xc00003c3b8?, 0x1?, 0xa5868?, 0xc0?, 0x1?, 0x1?) :1 +0x36 fp=0xc0000a55f0 sp=0xc0000a55b0 pc=0x13a016 reflect.Value.call({0x38bfa0?, 0xc00003c3b8?, 0x15d0b5?}, {0x3e03b6, 0x4}, {0xc0000a5ca8, 0x0, 0x160217?}) reflect/value.go:596 +0x90a fp=0xc0000a5bc8 sp=0xc0000a55f0 pc=0x168fca reflect.Value.Call({0x38bfa0?, 0xc00003c3b8?, 0x396de0?}, {0xc0000a5ca8, 0x0, 0x0}) reflect/value.go:380 +0x92 fp=0xc0000a5c30 sp=0xc0000a5bc8 pc=0x168592 github.com/alecthomas/kong.callFunction({0x38bfa0?, 0xc00003c3b8?, 0xc0000a5e20?}, 0xc0001957a0) github.com/alecthomas/kong@v0.8.1/callbacks.go:98 +0x465 fp=0xc0000a5d68 sp=0xc0000a5c30 pc=0x208945 github.com/alecthomas/kong.(*Context).RunNode(0xc00003c400, 0xc00018c4b0, {0xc0000a5f10, 0x1, 0x1}) github.com/alecthomas/kong@v0.8.1/context.go:765 +0x3fc fp=0xc0000a5e88 sp=0xc0000a5d68 pc=0x20da5c github.com/alecthomas/kong.(*Context).Run(0xc00003c400, {0xc0000a5f10, 0x1, 0x1}) github.com/alecthomas/kong@v0.8.1/context.go:790 +0xec fp=0xc0000a5ec8 sp=0xc0000a5e88 pc=0x20dc4c main.main() github.com/mrmarble/termsvg/cmd/termsvg/main_windows.go:58 +0x129 fp=0xc0000a5f78 sp=0xc0000a5ec8 pc=0x353f89 runtime.main() runtime/proc.go:271 +0x232 fp=0xc0000a5fe0 sp=0xc0000a5f78 pc=0x104a12 runtime.goexit({}) runtime/asm_amd64.s:1695 +0x1 fp=0xc0000a5fe8 sp=0xc0000a5fe0 pc=0x134301 goroutine 2 gp=0xc000068700 m=nil [force gc (idle)]: runtime.gopark(0x4132b8, 0x61dbc0, 0x11, 0xa, 0x1) runtime/proc.go:402 +0xfc fp=0xc00006bf80 sp=0xc00006bf50 pc=0x104e5c runtime.goparkunlock(0x61dbc0?, 0x0?, 0x0?, 0x0?) runtime/proc.go:408 +0x25 fp=0xc00006bfb0 sp=0xc00006bf80 pc=0x104ee5 runtime.forcegchelper() runtime/proc.go:326 +0xb5 fp=0xc00006bfe0 sp=0xc00006bfb0 pc=0x104c75 runtime.goexit({}) runtime/asm_amd64.s:1695 +0x1 fp=0xc00006bfe8 sp=0xc00006bfe0 pc=0x134301 created by runtime.init.6 in goroutine 1 runtime/proc.go:314 +0x1a goroutine 3 gp=0xc000068a80 m=nil [GC sweep wait]: runtime.gopark(0x4132b8, 0x61dfe0, 0xc, 0x9, 0x1) runtime/proc.go:402 +0xfc fp=0xc00006df58 sp=0xc00006df28 pc=0x104e5c runtime.goparkunlock(0x61dfe0?, 0x0?, 0x0?, 0x0?) runtime/proc.go:408 +0x25 fp=0xc00006df88 sp=0xc00006df58 pc=0x104ee5 runtime.bgsweep(0xc000024150) runtime/mgcsweep.go:278 +0xa5 fp=0xc00006dfc8 sp=0xc00006df88 pc=0xee625 runtime.gcenable.gowrap1() runtime/mgc.go:203 +0x25 fp=0xc00006dfe0 sp=0xc00006dfc8 pc=0xe2605 runtime.goexit({}) runtime/asm_amd64.s:1695 +0x1 fp=0xc00006dfe8 sp=0xc00006dfe0 pc=0x134301 created by runtime.gcenable in goroutine 1 runtime/mgc.go:203 +0x66 goroutine 4 gp=0xc000068c40 m=nil [GC scavenge wait]: runtime.gopark(0x4132b8, 0x61e880, 0xd, 0xa, 0x2) runtime/proc.go:402 +0xfc fp=0xc00007df48 sp=0xc00007df18 pc=0x104e5c runtime.goparkunlock(0x61e880?, 0x1?, 0x0?, 0xc000068c40?) runtime/proc.go:408 +0x25 fp=0xc00007df78 sp=0xc00007df48 pc=0x104ee5 runtime.(*scavengerState).park(0x61e880) runtime/mgcscavenge.go:425 +0x45 fp=0xc00007dfa0 sp=0xc00007df78 pc=0xebc85 runtime.bgscavenge(0xc000024150) runtime/mgcscavenge.go:653 +0x45 fp=0xc00007dfc8 sp=0xc00007dfa0 pc=0xec1e5 runtime.gcenable.gowrap2() runtime/mgc.go:204 +0x25 fp=0xc00007dfe0 sp=0xc00007dfc8 pc=0xe25a5 runtime.goexit({}) runtime/asm_amd64.s:1695 +0x1 fp=0xc00007dfe8 sp=0xc00007dfe0 pc=0x134301 created by runtime.gcenable in goroutine 1 runtime/mgc.go:204 +0xa5 goroutine 5 gp=0xc000068fc0 m=nil [finalizer wait]: runtime.gopark(0x412fe8, 0x6a5c70, 0x10, 0xa, 0x1) runtime/proc.go:402 +0xfc fp=0xc00006fe28 sp=0xc00006fdf8 pc=0x104e5c runtime.runfinq() runtime/mfinal.go:194 +0x107 fp=0xc00006ffe0 sp=0xc00006fe28 pc=0xe1647 runtime.goexit({}) runtime/asm_amd64.s:1695 +0x1 fp=0xc00006ffe8 sp=0xc00006ffe0 pc=0x134301 created by runtime.createfing in goroutine 1 runtime/mfinal.go:164 +0x45 ```
MrMarble commented 5 months ago

Seems to be the colors, I only support xterm colors and one of your colors is outside that range.

Looking at the cast file, is when you type | ttyper-, that r- has the color in rgb? you can see it in the cast file \u001b[38;2;68;68;68mr -"].

I'll try and support that format

brian6932 commented 5 months ago

Works, maybe #4 is related to this?

MrMarble commented 5 months ago

Works, maybe #4 is related to this?

It might be, good catch