grant icon indicating copy to clipboard operation
grant copied to clipboard

panic: send on closed channel

Open popey opened this issue 1 year ago • 1 comments

: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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/tools/identify_license/backend/backend.go:96 +0x165        

popey avatar Mar 26 '24 18:03 popey

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 =(

spiffcs avatar Mar 26 '24 19:03 spiffcs