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

Mac m1 运行报错 #29

Closed
alchu4n opened this issue Apr 15, 2023 · 5 comments
Closed

Mac m1 运行报错 #29

alchu4n opened this issue Apr 15, 2023 · 5 comments

Comments

@alchu4n
Copy link

alchu4n commented Apr 15, 2023

fofax -q 'app="APACHE-Solr"'

      ____        ____       _  __
     / __/____   / __/____ _| |/ /
    / /_ / __ \ / /_ / __ `/|   /
   / __// /_/ // __// /_/ //   |
  /_/   \____//_/   \__,_//_/|_|
                 	v0.1.43
			https://fofax.xiecat.fun

2023/04/15 15:58:13 [INFO] No new updates found for fofax engine!
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x104c41150]

goroutine 1 [running]:
github.com/xiecat/fofax/internal/cli.updateTips({0x104c48c23?, 0x14?})
	/Users/ksc/go/pkg/mod/github.com/xiecat/fofax@v0.1.43/internal/cli/update.go:29 +0xe0
github.com/xiecat/fofax/internal/cli.checkUpdateInfo()
	/Users/ksc/go/pkg/mod/github.com/xiecat/fofax@v0.1.43/internal/cli/parser.go:427 +0x248
github.com/xiecat/fofax/internal/cli.ParseOptions()
	/Users/ksc/go/pkg/mod/github.com/xiecat/fofax@v0.1.43/internal/cli/parser.go:330 +0x37c
main.main()
	/Users/ksc/go/pkg/mod/github.com/xiecat/fofax@v0.1.43/cmd/fofax/fofax.go:11 +0x1c
@alchu4n
Copy link
Author

alchu4n commented Apr 15, 2023

image

@0xf4n9x
Copy link
Contributor

0xf4n9x commented Apr 15, 2023

我在M1的macOS上,并没有复现出来。大概率应该是网络环境的原因,请切换下代理,然后再次尝试。

~  system_profiler SPHardwareDataType
Hardware:

    Hardware Overview:

      Model Name: MacBook Pro
      Model Identifier: MacBookPro18,3
      Chip: Apple M1 Pro
      ...


➜  ~  fofax -q 'app="APACHE-Solr"'

      ____        ____       _  __
     / __/____   / __/____ _| |/ /
    / /_ / __ \ / /_ / __ `/|   /
   / __// /_/ // __// /_/ //   |
  /_/   \____//_/   \__,_//_/|_|
                 	v0.1.43
			https://fofax.xiecat.fun

2023/04/15 18:04:49 [SUCC] Fetch Data From FoFa: [100/978764]
47.111.49.40:30001
47.113.156.29:8087
...

这个问题我已经定位到相关存在Bug的代码了,下个小版本会修复这个Bug。

@Becivells
Copy link
Member

目前来说应该是第一更新网络有问题才会出现。后续使用没影响。修复内容随下个版本发布

@alchu4n
Copy link
Author

alchu4n commented Apr 15, 2023

我定位到updateTips函数中的latest, err := updateFoFaXVersionToLatest() 这行需要添加
if latest == nil {
return errors.New("latest version is nil")
}

整体函数代码如下:
func updateTips(tagName string) error {
tagName = fmt.Sprintf("v%s", strings.TrimPrefix(tagName, "v"))
if strings.HasSuffix(tagName, "-next") {
printer.Debug("Self-compiled versions do not check for updates")
return nil
}
latest, err := updateFoFaXVersionToLatest()
if latest == nil {
return errors.New("latest version is nil")
}
if err != nil {
return err
}
if !args.Update {
bannerSite(fmt.Sprintf("New:\n\nVersion:%s\n\n%s\n", latest.Version, latest.Notes))
bannerSite("Please Use [./fofax -update] to download\n\n")
}
return nil
}

@0xf4n9x
Copy link
Contributor

0xf4n9x commented Apr 15, 2023

Thx!

@alchu4n alchu4n closed this as completed Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants