[GH-ISSUE #9] 运行错误 runtime error: invalid memory address or nil pointer dereference #1346

Closed
opened 2026-02-27 12:09:55 +03:00 by kerem · 6 comments
Owner

Originally created by @yesicoo on GitHub (Nov 5, 2021).
Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/9

您好,我在mac上编译成win exe 控制台运行报以下错误

2021/11/05 17:02:52 /*****/go/pkg/mod/gorm.io/driver/sqlite@v1.1.4/migrator.go:32
[0.000ms] [rows:-] SELECT count(
) FROM sqlite_master WHERE type='table' AND name="config_backups"
panic: runtime error: invalid memory address or nil pointer dereference
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x3cfbce]

Originally created by @yesicoo on GitHub (Nov 5, 2021). Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/9 您好,我在mac上编译成win exe 控制台运行报以下错误 2021/11/05 17:02:52 /******/go/pkg/mod/gorm.io/driver/sqlite@v1.1.4/migrator.go:32 [0.000ms] [rows:-] SELECT count(*) FROM sqlite_master WHERE type='table' AND name="config_backups" panic: runtime error: invalid memory address or nil pointer dereference panic: runtime error: invalid memory address or nil pointer dereference [signal 0xc0000005 code=0x0 addr=0x0 pc=0x3cfbce]
kerem closed this issue 2026-02-27 12:09:55 +03:00
Author
Owner

@0xJacky commented on GitHub (Nov 5, 2021):

您好,我手头上没有暂时没有Win的设备,可能暂时测不了,在mac上能正常运行吗

Jacky

在 2021年11月5日,下午5:05,XuQing @.***> 写道:


您好,我在mac上编译成win exe 控制台运行报以下错误

2021/11/05 17:02:52 @.***/migrator.go:32
[0.000ms] [rows:-] SELECT count() FROM sqlite_master WHERE type='table' AND name="config_backups"
panic: runtime error: invalid memory address or nil pointer dereference
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x3cfbce]


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

<!-- gh-comment-id:961741485 --> @0xJacky commented on GitHub (Nov 5, 2021): 您好,我手头上没有暂时没有Win的设备,可能暂时测不了,在mac上能正常运行吗 Jacky > 在 2021年11月5日,下午5:05,XuQing ***@***.***> 写道: > >  > 您好,我在mac上编译成win exe 控制台运行报以下错误 > > 2021/11/05 17:02:52 ***@***.***/migrator.go:32 > [0.000ms] [rows:-] SELECT count() FROM sqlite_master WHERE type='table' AND name="config_backups" > panic: runtime error: invalid memory address or nil pointer dereference > panic: runtime error: invalid memory address or nil pointer dereference > [signal 0xc0000005 code=0x0 addr=0x0 pc=0x3cfbce] > > — > You are receiving this because you are subscribed to this thread. > Reply to this email directly, view it on GitHub, or unsubscribe.
Author
Owner

@yesicoo commented on GitHub (Nov 5, 2021):

mac 上可以的 非常好

<!-- gh-comment-id:961894780 --> @yesicoo commented on GitHub (Nov 5, 2021): mac 上可以的 非常好
Author
Owner

@0xJacky commented on GitHub (Nov 6, 2021):

好的 我下周看看,有可能是 sql driver 的锅

Jacky

在 2021年11月5日,下午9:28,XuQing @.***> 写道:


mac 上可以的 非常好


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.

<!-- gh-comment-id:962394762 --> @0xJacky commented on GitHub (Nov 6, 2021): 好的 我下周看看,有可能是 sql driver 的锅 Jacky > 在 2021年11月5日,下午9:28,XuQing ***@***.***> 写道: > >  > mac 上可以的 非常好 > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub, or unsubscribe.
Author
Owner

@0xJacky commented on GitHub (Nov 23, 2021):

应该是 gorm sqlite driver 的锅,注释掉 server/model/models.go 的迁移代码是可以跑的。

<!-- gh-comment-id:976093620 --> @0xJacky commented on GitHub (Nov 23, 2021): 应该是 gorm sqlite driver 的锅,注释掉 server/model/models.go 的迁移代码是可以跑的。
Author
Owner

@yesicoo commented on GitHub (Nov 24, 2021):

好的 我晚点试试 非常感谢

<!-- gh-comment-id:977679950 --> @yesicoo commented on GitHub (Nov 24, 2021): 好的 我晚点试试 非常感谢
Author
Owner

@0xJacky commented on GitHub (Nov 30, 2021):

您好,这个问题应该是没有启用CGO编译导致的。
请先用 brew install mingw-w64 安装依赖
再使用

CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ GOOS=windows GOARCH=amd64 go build main.go

编译 Windows 版本

<!-- gh-comment-id:982254789 --> @0xJacky commented on GitHub (Nov 30, 2021): 您好,这个问题应该是没有启用CGO编译导致的。 请先用 `brew install mingw-w64` 安装依赖 再使用 ``` CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ GOOS=windows GOARCH=amd64 go build main.go ``` 编译 Windows 版本
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-ui#1346
No description provided.