Thanks to visit codestin.com
Credit goes to github.com

Skip to content

v1.0.1 - runtime error: invalid memory address or nil pointer dereference #9

@kilicomu

Description

@kilicomu

Hi,

With v1.0.1, I see:

Welcome to Slurm Commander!

2022/12/21 09:29:38 Trying conf file: /etc/scom/scom.conf
2022/12/21 09:29:38 Conf: FAILED reading /etc/scom/scom.conf
2022/12/21 09:29:38 Trying conf file: /users/klcm500/scom/scom.conf
2022/12/21 09:29:38 INFO: Configuration: &config.ConfigContainer{Prefix:"/usr/bin", Binpaths:map[string]string{"sacct":"/usr/bin/sacct", "sacctmgr":"/usr/bin/sacctmgr", "sbatch":"/usr/bin/sbatch", "scancel":"/usr/bin/scancel", "scontrol":"/usr/bin/scontrol", "sinfo":"/usr/bin/sinfo", "squeue":"/usr/bin/squeue", "sstat":"/usr/bin/sstat"}, Tick:0xa, TemplateDirs:[]string{"/users/klcm500/scom/templates"}}

Caught panic:

runtime error: invalid memory address or nil pointer dereference

Restoring terminal...

goroutine 1 [running]:
runtime/debug.Stack()
        /opt/hostedtoolcache/go/1.18.9/x64/src/runtime/debug/stack.go:24 +0x65
runtime/debug.PrintStack()
        /opt/hostedtoolcache/go/1.18.9/x64/src/runtime/debug/stack.go:16 +0x19
github.com/charmbracelet/bubbletea.(*Program).Run.func1()
        /home/runner/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:385 +0x95
panic({0x5b4600, 0x765a50})
        /opt/hostedtoolcache/go/1.18.9/x64/src/runtime/panic.go:838 +0x207
github.com/CLIP-HPC/SlurmCommander/internal/model/tabs/jobhisttab.(*SacctJSON).FilterSacctTable(0xc000202e08, {0xc000a0a0b0, 0x0}, 0xc000202ce8?)
        /home/runner/work/SlurmCommander/SlurmCommander/internal/model/tabs/jobhisttab/jobhisttabtable.go:76 +0x2df
github.com/CLIP-HPC/SlurmCommander/internal/model.Model.Update({{0x0, 0x1, 0x1, {0x0, 0x0}, {0x0, 0x0}, 0x16a, 0x5f, 0xc0000c8230, ...}, ...}, ...)
        /home/runner/work/SlurmCommander/SlurmCommander/internal/model/update.go:439 +0x1291
github.com/charmbracelet/bubbletea.(*Program).eventLoop(0xc000194580, {0x6534f8?, 0xc0001d4000?}, 0x652c58?)
        /home/runner/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:324 +0x602
github.com/charmbracelet/bubbletea.(*Program).Run(0xc000194580)
        /home/runner/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:448 +0x8e7
main.main()
        /home/runner/work/SlurmCommander/SlurmCommander/cmd/scom/scom.go:142 +0x16ce
Goodbye!

shortly after starting the program.

The debug log doesn't seem to provide any useful info on this one:

SC: 09:33:39.786522 logger.go:36: Log file: scdebug.log
SC: 09:33:39.787134 jobtabcommands.go:56: QuickGetSqueue() start
SC: 09:33:39.787177 clustertabcommands.go:56: QuickGetSinfo() start
SC: 09:33:39.787869 view.go:98: Got NO error, insert newline
SC: 09:33:39.787890 view.go:105: CALL JobTab.View()
SC: 09:33:39.787912 jobtabview.go:169: IN JobTab.View()
SC: 09:33:39.789199 command.go:38: Fetching UserName
SC: 09:33:39.789342 jobfromtemplate.go:70: GetTemplateList reading dir: /users/klcm500/scom/templates
SC: 09:33:39.789642 update.go:342: Update: got WindowSizeMsg: 362 95
SC: 09:33:39.789814 jobtab.go:53: FixTableHeight(95) from 20
SC: 09:33:39.789852 jobtab.go:59: FixTableHeight to 80
SC: 09:33:39.789864 jobhisttab.go:50: FixTableHeight(95) from 20
SC: 09:33:39.789881 jobhisttab.go:56: FixTableHeight to 80
SC: 09:33:39.789893 clustertab.go:43: FixTableHeight(95) from 20
SC: 09:33:39.789905 clustertab.go:49: FixTableHeight to 70
SC: 09:33:39.789919 update.go:372: CTB Width = 0 
SC: 09:33:39.789965 update.go:374: CTB Width = 228 
SC: 09:33:39.790682 view.go:98: Got NO error, insert newline
SC: 09:33:39.792008 view.go:105: CALL JobTab.View()
SC: 09:33:39.792036 jobtabview.go:169: IN JobTab.View()
SC: 09:33:39.792454 command.go:49: Return UserName: klcm500
SC: 09:33:39.796592 update.go:318: Update: Got TemplatesListRows msg: jobfromtemplate.TemplatesListRows(nil)
SC: 09:33:39.797192 view.go:98: Got NO error, insert newline
SC: 09:33:39.797209 view.go:105: CALL JobTab.View()
SC: 09:33:39.797223 jobtabview.go:169: IN JobTab.View()
SC: 09:33:39.801291 update.go:291: Got UserNAme msg, save "klcm500" to Globals.
SC: 09:33:39.801760 command.go:72: GetUserAssoc about to run: /usr/bin/sacctmgr [list Association format=account -P -n user=klcm500]
SC: 09:33:39.801811 view.go:98: Got NO error, insert newline
SC: 09:33:39.801827 view.go:105: CALL JobTab.View()
SC: 09:33:39.801839 jobtabview.go:169: IN JobTab.View()
SC: 09:33:39.891619 update.go:405: U(): got SinfoJSON
SC: 09:33:39.891669 clustertabtable.go:75: FilterSinfoTable: rows 178 
SC: 09:33:39.903476 clustertab.go:63: GetStatsFiltered JobClusterTab start
SC: 09:33:39.904927 clustertab.go:111: GetStatsFiltered end 
SC: 09:33:39.905420 view.go:98: Got NO error, insert newline
SC: 09:33:39.905438 view.go:105: CALL JobTab.View()
SC: 09:33:39.905452 jobtabview.go:169: IN JobTab.View()
SC: 09:33:40.002325 command.go:94: Got UserAssoc klcm500 -> chem-acm-2018
SC: 09:33:40.002359 command.go:94: Got UserAssoc klcm500 -> its-training-2019
SC: 09:33:40.002373 command.go:94: Got UserAssoc klcm500 -> its-devel-2018
SC: 09:33:40.002385 command.go:94: Got UserAssoc klcm500 -> its-system-2018
SC: 09:33:40.002832 update.go:280: Got UserAssoc msg, value: command.UserAssoc{"chem-acm-2018", "its-training-2019", "its-devel-2018", "its-system-2018"}
SC: 09:33:40.002884 update.go:283: Appended UserAssoc msg go Globals, value now: []string{"chem-acm-2018", "its-training-2019", "its-devel-2018", "its-system-2018"}
SC: 09:33:40.002912 update.go:286: Appended UserAssoc msg go Globals, calling GetSacctHist()
SC: 09:33:40.003182 jobhisttabcommands.go:38: GetSacctHist("chem-acm-2018,its-training-2019,its-devel-2018,its-system-2018") start: days 7, timeout: 30
SC: 09:33:40.003240 jobhisttabcommands.go:50: EXEC: "/usr/bin/sacct" ["-n" "--json" "-S" "now-7days" "-A" "chem-acm-2018,its-training-2019,its-devel-2018,its-system-2018"]
SC: 09:33:40.003395 view.go:98: Got NO error, insert newline
SC: 09:33:40.003409 view.go:105: CALL JobTab.View()
SC: 09:33:40.003420 jobtabview.go:169: IN JobTab.View()
SC: 09:33:41.255036 jobhisttabcommands.go:59: EXEC returned: 7483796 bytes
SC: 09:33:41.433352 jobhisttabcommands.go:74: Unmarshalled 563 jobs from hist
SC: 09:33:41.433393 update.go:435: Got SacctJobHist len: 563 
SC: 09:33:41.433415 jobhisttabtable.go:60: FilterSacctTable: rows 563

I'm not familiar with Go, but I'll download the scom source and have a look at debugging the issue.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions