This repository was archived by the owner on Oct 31, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
SIGSEGV in components.go with too large files for timeout #10
Copy link
Copy link
Open
Description
Getting a stack crash on a timeout in the gonexus api which is located here
if _ , resp, err := rm.Do(req); err != nil /* && resp.StatusCode != http.StatusNoContent*/ {
return doError(err)
}
will sigsegv with this type of error
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x620f0f]
goroutine 1 [running]:
gonexus/rm.UploadComponent({0x70b868, 0xc000078230}, {0x7fff259a4f07, 0xd}, {0x702f20, 0xc00002a2c0})
~/nexus_api/gonexus/rm/components.go:394 +0x6cf
main.upload_components({0x70b868, 0xc000078230}, {0x7fff259a4f07, 0xd}, {0x7fff259a4f15, 0x4}, {0x7fff259a4f1a, 0x7}, {0xc000151e60, 0x1b})
~nexus_api/nexus_api.go:76 +0x2c6
main.main()
~/nexus_api/nexus_api.go:126 +0x5f8
The problem is the rm.Do(req) in ~ Components.go:394
if the Do function returns a timeout error then accessing resp again will cause a stack crash. My solution was to change the line to this
if _ , _, err := rm.Do(req); err != nil {
return doError(err)
}
will correctly print the timeout error I am not sure what that code was there for but it may need to be fixed differently.
To reproduce do a nexusrm.UploadComponent with a file larger then can be uploaded then the timeout in nexus.go file and it will sigsegv. Since its returning
if err != nil {
return nil, nil, err
}
If you need more details let me know.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels