I have a program that's using the SAPI.SPVoice object in order to speak text and sometimes when the program exits, I get this error:
Exception 0xc0000005 0x1 0x0 0x7ffd7898a956
PC=0x7ffd7898a956
I'm wondering if there is some kind of rule that I call runtime.KeepAlive() before passing the object to COM?
Also, my program also uses SDL2 which also uses COM and I'm wondering if my code and the SDL code are conflicting somehow.
All my code should be doing is creating a SAPI.SPVoice object and calling methods on it like Speak, checking if it's speaking, changing volume ETC. The only part where there could be a problem is the Speak method, where I pass a string which is more complicated than an integer.
I have a program that's using the SAPI.SPVoice object in order to speak text and sometimes when the program exits, I get this error: Exception 0xc0000005 0x1 0x0 0x7ffd7898a956 PC=0x7ffd7898a956
runtime: unknown pc 0x7ffd7898a956 stack: frame={sp:0xcb40bff190, fp:0x0} stack=[0x0,0xcb40bffa30) 0x000000cb40bff090: 0x0000000000000000 0x00007ffd79ae07b0 0x000000cb40bff0a0: 0x0000000000000000 0x000000cb40bff1a0 0x000000cb40bff0b0: 0x000002b470002ba0 0x00007ffd771f98bb 0x000000cb40bff0c0: 0x000000cb40bff1d0 0x000000cb40bff0d0 0x000000cb40bff0d0: 0x0000efb98f9e63ea 0x000000cb40bff1d0 0x000000cb40bff0e0: 0x000000cb40bff200 0x00007ffd7899aa7a 0x000000cb40bff0f0: 0x00003b4400000006 0x000002b479a00c50 0x000000cb40bff100: 0x000000cb40bff3a0 0x000000cb40bff3a0 0x000000cb40bff110: 0x00007ffd520a54c0 0x00007ffd78967d69 0x000000cb40bff120: 0x000000cb40bff200 0x000002b4772b94a0 0x000000cb40bff130: 0x0000d564601adfa3 0x00007ffd51d5601c 0x000000cb40bff140: 0x000000cb40bff200 0x00007ffd78979ac9 0x000000cb40bff150: 0x0000000000000000 0x00007ffd79ab604c 0x000000cb40bff160: 0x0000000001e02c80 0x00007ffd79bf8bd8 0x000000cb40bff170: 0x0000000000000000 0x0000000000000000 0x000000cb40bff180: 0x00007ffd520a54c0 0x00007ffd7898a8e0 0x000000cb40bff190: <0x000000cb40bff200 0x000000cb40bff1e0 0x000000cb40bff1a0: 0x0000000000000000 0x000000cb40bff1d0 0x000000cb40bff1b0: 0x0000000001e02c80 0x00007ffd51d419bf 0x000000cb40bff1c0: 0x00007ffd51d582a0 0x000002b4772b94e0 0x000000cb40bff1d0: 0x00007ffd520a54c0 0x0000000000000001 0x000000cb40bff1e0: 0x00007ffd51d582a0 0x00007ffd51d419f9 0x000000cb40bff1f0: 0x000000cb40bff250 0x0000000000000000 0x000000cb40bff200: 0x0000000000000000 0x00007ffd79aecbf4 0x000000cb40bff210: 0x00007ffd51d582a0 0x00007ffd51d58a94 0x000000cb40bff220: 0x0000000000000000 0x000000cb40bff280 0x000000cb40bff230: 0x00007ffd79bf8ba8 0x0000000000000001 0x000000cb40bff240: 0x0000000000000000 0x00007ffd51d58337 0x000000cb40bff250: 0x0000000000000001 0x000000cb40bff440 0x000000cb40bff260: 0x00007ffd520a54c0 0x0000000000000000 0x000000cb40bff270: 0x0000000077300101 0x0000000020000020 0x000000cb40bff280: 0x0000000000000001 0x0000000001e02c80 runtime: unknown pc 0x7ffd7898a956 stack: frame={sp:0xcb40bff190, fp:0x0} stack=[0x0,0xcb40bffa30) 0x000000cb40bff090: 0x0000000000000000 0x00007ffd79ae07b0 0x000000cb40bff0a0: 0x0000000000000000 0x000000cb40bff1a0 0x000000cb40bff0b0: 0x000002b470002ba0 0x00007ffd771f98bb 0x000000cb40bff0c0: 0x000000cb40bff1d0 0x000000cb40bff0d0 0x000000cb40bff0d0: 0x0000efb98f9e63ea 0x000000cb40bff1d0 0x000000cb40bff0e0: 0x000000cb40bff200 0x00007ffd7899aa7a 0x000000cb40bff0f0: 0x00003b4400000006 0x000002b479a00c50 0x000000cb40bff100: 0x000000cb40bff3a0 0x000000cb40bff3a0 0x000000cb40bff110: 0x00007ffd520a54c0 0x00007ffd78967d69 0x000000cb40bff120: 0x000000cb40bff200 0x000002b4772b94a0 0x000000cb40bff130: 0x0000d564601adfa3 0x00007ffd51d5601c 0x000000cb40bff140: 0x000000cb40bff200 0x00007ffd78979ac9 0x000000cb40bff150: 0x0000000000000000 0x00007ffd79ab604c 0x000000cb40bff160: 0x0000000001e02c80 0x00007ffd79bf8bd8 0x000000cb40bff170: 0x0000000000000000 0x0000000000000000 0x000000cb40bff180: 0x00007ffd520a54c0 0x00007ffd7898a8e0 0x000000cb40bff190: <0x000000cb40bff200 0x000000cb40bff1e0 0x000000cb40bff1a0: 0x0000000000000000 0x000000cb40bff1d0 0x000000cb40bff1b0: 0x0000000001e02c80 0x00007ffd51d419bf 0x000000cb40bff1c0: 0x00007ffd51d582a0 0x000002b4772b94e0 0x000000cb40bff1d0: 0x00007ffd520a54c0 0x0000000000000001 0x000000cb40bff1e0: 0x00007ffd51d582a0 0x00007ffd51d419f9 0x000000cb40bff1f0: 0x000000cb40bff250 0x0000000000000000 0x000000cb40bff200: 0x0000000000000000 0x00007ffd79aecbf4 0x000000cb40bff210: 0x00007ffd51d582a0 0x00007ffd51d58a94 0x000000cb40bff220: 0x0000000000000000 0x000000cb40bff280 0x000000cb40bff230: 0x00007ffd79bf8ba8 0x0000000000000001 0x000000cb40bff240: 0x0000000000000000 0x00007ffd51d58337 0x000000cb40bff250: 0x0000000000000001 0x000000cb40bff440 0x000000cb40bff260: 0x00007ffd520a54c0 0x0000000000000000 0x000000cb40bff270: 0x0000000077300101 0x0000000020000020 0x000000cb40bff280: 0x0000000000000001 0x0000000001e02c80
goroutine 1 [running, locked to thread]: runtime.systemstack_switch() runtime/asm_amd64.s:350 fp=0xc000077f08 sp=0xc000077f00 pc=0x7ff62a9bede0 runtime.stdcall(0x7ff62aa642d7) runtime/os_windows.go:1068 +0x7d fp=0xc000077f40 sp=0xc000077f08 pc=0x7ff62a992c1d runtime.stdcall1(0x7ff62ab8f068, 0x0) runtime/os_windows.go:1089 +0x65 fp=0xc000077f58 sp=0xc000077f40 pc=0x7ff62a992d45 runtime.exit(0x0) runtime/os_windows.go:702 +0x49 fp=0xc000077f80 sp=0xc000077f58 pc=0x7ff62a991a29 runtime.main() runtime/proc.go:277 +0x26c fp=0xc000077fe0 sp=0xc000077f80 pc=0x7ff62a998dac runtime.goexit() runtime/asm_amd64.s:1581 +0x1 fp=0xc000077fe8 sp=0xc000077fe0 pc=0x7ff62a9c1181 rax 0x0 rbx 0xcb40bff200 rcx 0xd5af20a533a30000 rdi 0x7ffd520a54c0 rsi 0xffffffffffffffff rbp 0xcb40bff380 rsp 0xcb40bff190 r8 0x0 r9 0xcb40bfe7a0 r10 0x0 r11 0xcb40bfebd0 r12 0x2b4772b94a0 r13 0x1 r14 0xcb40bff1f8 r15 0x7ffd51d582a0 rip 0x7ffd7898a956 rflags 0x10286 cs 0x33 fs 0x53 gs 0x2b
I'm wondering if there is some kind of rule that I call runtime.KeepAlive() before passing the object to COM? Also, my program also uses SDL2 which also uses COM and I'm wondering if my code and the SDL code are conflicting somehow. All my code should be doing is creating a SAPI.SPVoice object and calling methods on it like Speak, checking if it's speaking, changing volume ETC. The only part where there could be a problem is the Speak method, where I pass a string which is more complicated than an integer.