anchore / grant

Search an SBOM for licenses and the packages they belong to
Apache License 2.0
59 stars 3 forks source link

panic: send on closed channel #71

Open popey opened 5 months ago

popey commented 5 months ago

:wave:

I ran grant check against a folder which contains an installation of Android Studio. It ran for a while then crashed.

android-studio                                                                                                                                                                                
 ⠇ Checking licenses  ━━━━━━━━━━━━━━━━━━━━                                                                                                                                                    
panic: send on closed channel                                                                                                                                                                 

goroutine 11434 [running]:                                                                                                                                                                    
github.com/google/licenseclassifier/v2/tools/identify_license/backend.(*ClassifierBackend).ClassifyLicenses.func1.1()                                                                         
        /home/runner/go/pkg/mod/github.com/google/licenseclassifier/v2@v2.0.0/tools/identify_license/backend/backend.go:86 +0x39                                                              
github.com/google/licenseclassifier/v2/tools/identify_license/backend.(*ClassifierBackend).ClassifyLicenses.func1({0xc004b69c00?, 0xc00716c900?})                                             
        /home/runner/go/pkg/mod/github.com/google/licenseclassifier/v2@v2.0.0/tools/identify_license/backend/backend.go:91 +0xab                                                              
created by github.com/google/licenseclassifier/v2/tools/identify_license/backend.(*ClassifierBackend).ClassifyLicenses in goroutine 11433
        /home/runner/go/pkg/mod/github.com/google/licenseclassifier/v2@v2.0.0/tools/identify_license/backend/backend.go:96 +0x165                  

Steps to reproduce

  1. On a system which supports snap (such as Ubuntu), install Android Studio

snap install android-studio

(it's a classic (unconfined) snap, so it will need --classic passed on the above command)

  1. Run grant against the installed application

grant check /snap/android-studio/current/

Expected results

I'd expect grant check to produce a list of licenses.

Actual results

The run crashed:

panic: send on closed channel                                                                                                                                                                 

goroutine 11434 [running]:                                                                                                                                                                    
github.com/google/licenseclassifier/v2/tools/identify_license/backend.(*ClassifierBackend).ClassifyLicenses.func1.1()                                                                         
        /home/runner/go/pkg/mod/github.com/google/licenseclassifier/v2@v2.0.0/tools/identify_license/backend/backend.go:86 +0x39                                                              
github.com/google/licenseclassifier/v2/tools/identify_license/backend.(*ClassifierBackend).ClassifyLicenses.func1({0xc004b69c00?, 0xc00716c900?})                                             
        /home/runner/go/pkg/mod/github.com/google/licenseclassifier/v2@v2.0.0/tools/identify_license/backend/backend.go:91 +0xab                                                              
created by github.com/google/licenseclassifier/v2/tools/identify_license/backend.(*ClassifierBackend).ClassifyLicenses in goroutine 11433
        /home/runner/go/pkg/mod/github.com/google/licenseclassifier/v2@v2.0.0/tools/identify_license/backend/backend.go:96 +0x165        
spiffcs commented 5 months ago

Oh no! I'm so sorry about this. Let me check why this is showing a panic for android. Thanks for the report and I'll make sure to add it into our test cases going forward =(