Skip to content

[v3] Using an array object as a parameter in a method registered with RegisterService causes a crash. #4864

@yukunyi

Description

@yukunyi

Description

system: archlinux
version: alpha.57

SIGSEGV: segmentation violation
PC=0x7f584b5aec7f m=0 sigcode=1 addr=0x28
signal arrived during cgo execution

goroutine 1 gp=0xc000002380 m=0 mp=0x17a3fa0 [syscall, locked to thread]:
runtime.cgocall(0xc7f460, 0xc000553578)
runtime/cgocall.go:167 +0x4b fp=0xc000553550 sp=0xc000553518 pc=0x48a8eb
github.com/wailsapp/wails/v3/pkg/application._Cfunc_g_application_run(0x1526f100, 0x0, 0x0)
_cgo_gotypes.go:1249 +0x46 fp=0xc000553578 sp=0xc000553550 pc=0xb4b846
github.com/wailsapp/wails/v3/pkg/application.appRun.func4(...)
github.com/wailsapp/wails/v3@v3.0.0-alpha.57/pkg/application/linux_cgo.go:579
github.com/wailsapp/wails/v3/pkg/application.appRun(0x1526f100)
github.com/wailsapp/wails/v3@v3.0.0-alpha.57/pkg/application/linux_cgo.go:579 +0x14d fp=0xc000553600 sp=0xc000553578 pc=0xb549ad
github.com/wailsapp/wails/v3/pkg/application.(*linuxApp).run(0xc000284000)
github.com/wailsapp/wails/v3@v3.0.0-alpha.57/pkg/application/application_linux.go:181 +0x348 fp=0xc0005536b0 sp=0xc000553600 pc=0xb52b28
github.com/wailsapp/wails/v3/pkg/application.(*App).Run(0xc0002bc908)
github.com/wailsapp/wails/v3@v3.0.0-alpha.57/pkg/application/application.go:656 +0x7fa fp=0xc0005537f0 sp=0xc0005536b0 pc=0xb1a65a
main.WailsGuiMain()
/app/src/main-gui/gui_main.go:250 +0x8d2 fp=0xc000553cb8 sp=0xc0005537f0 pc=0xc0f632
main.main()
/app/src/main-gui/main.go:73 +0x53f fp=0xc000553f50 sp=0xc000553cb8 pc=0xc119bf
runtime.main()
runtime/proc.go:285 +0x29d fp=0xc000553fe0 sp=0xc000553f50 pc=0x45957d
runtime.goexit({})
runtime/asm_amd64.s:1693 +0x1 fp=0xc000553fe8 sp=0xc000553fe0 pc=0x495c41

To Reproduce

Similar issues have been observed where any method containing array parameters, once called, leads to a crash within a short period (typically within a few minutes). I first noticed this problem starting from the alpha.49 version. As it occurred during the development phase, I initially overlooked it. However, after recent multiple tests and attempts to reproduce the issue, I confirmed that the crash is indeed caused by the presence of arrays in the parameters. Currently, after removing all array-type parameters from the interface, the crashes have stopped.
simple codes:
func (guiApp *GuiMainApi) ForwardGlogMessages(payloadsRaw []string) (err error) { fmt.Printf("length %d", len(payloadsRaw)) return nil }

Expected behaviour

Fix this issue.

Screenshots

No response

Attempted Fixes

No response

System Details

Wails Doctor          
                                
 Wails (v3.0.0-alpha.57)  Wails Doctor 
                                                                                                                                                                                                                                                             
# System 

┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
| Name                | Arch Linux                                                                                                     |
| Version             | Unknown                                                                                                        |
| ID                  | arch                                                                                                           |
| Branding            |                                                                                                                |
| Platform            | linux                                                                                                          |
| Architecture        | amd64                                                                                                          |
| Desktop Environment | KDE                                                                                                            |
| NVIDIA Driver       | N/A                                                                                                            |
| XDG_SESSION_TYPE    | wayland                                                                                                        |
| CPU                 | AMD Ryzen 9 9950X 16-Core Processor                                                                            |
| GPU 1               | Granite Ridge [Radeon Graphics] (Advanced Micro Devices, Inc. [AMD/ATI]) - Driver: amdgpu                      |
| GPU 2               | Navi 10 [Radeon RX 5600 OEM/5600 XT / 5700/5700 XT] (Advanced Micro Devices, Inc. [AMD/ATI]) - Driver: amdgpu  |
| Memory              | 61GB                                                                                                           |
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

# Build Environment 

┌────────────────────────────────┐
| Wails CLI    | v3.0.0-alpha.57 |
| Go Version   | go1.25.5        |
| -buildmode   | exe             |
| -compiler    | gc              |
| CGO_CFLAGS   |                 |
| CGO_CPPFLAGS |                 |
| CGO_CXXFLAGS |                 |
| CGO_ENABLED  | 1               |
| CGO_LDFLAGS  |                 |
| GOAMD64      | v1              |
| GOARCH       | amd64           |
| GOOS         | linux           |
└────────────────────────────────┘

# Dependencies 

┌─────────────────────────────────────────────────────────────────────────────────┐
| pkg-config | 2.5.1-1                                                            |
| webkit2gtk | 2.50.4-1                                                           |
| gcc        | 15.2.1+r301+gf24307422d1d-1                                        |
| gtk3       | 1:3.24.51-1                                                        |
| npm        | 10.9.2                                                             |
| docker     | *Docker version 29.1.3, build f52814d454 (cross-compilation ready) |
|                                                                                 |
└──────────────────────────── * - Optional Dependency ────────────────────────────┘

# Checking for issues 

 SUCCESS  No issues found

# Diagnosis 

 SUCCESS  Your system is ready for Wails development!

Need documentation? Run: wails3 docs
 ♥   If Wails is useful to you or your company, please consider sponsoring the project: wails3 sponsor

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions