File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
pkg/sentry/platform/systrap Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -268,6 +268,7 @@ func New(opts platform.Options) (*Systrap, error) {
268268 return nil , err
269269 }
270270
271+ var stubErr error
271272 stubInitialized .Do (func () {
272273 // Don't use sentry and stub fast paths if here is just one cpu.
273274 neverEnableFastPath = min (runtime .NumCPU (), runtime .GOMAXPROCS (0 )) == 1
@@ -279,8 +280,8 @@ func New(opts platform.Options) (*Systrap, error) {
279280 // done before initializing any other processes.
280281 source , err := newSubprocess (createStub , mf , false )
281282 if err != nil {
282- // Should never happen.
283- panic ( "unable to initialize systrap source: " + err . Error ())
283+ stubErr = fmt . Errorf ( "initialize systrap: %w" , err )
284+ return
284285 }
285286 // The source subprocess is never released explicitly by a MM.
286287 source .DecRef (nil )
@@ -291,6 +292,10 @@ func New(opts platform.Options) (*Systrap, error) {
291292
292293 initSeccompNotify ()
293294 })
295+ if stubErr != nil {
296+ mf .Destroy ()
297+ return nil , stubErr
298+ }
294299
295300 latencyMonitoring .Do (func () {
296301 go controlFastPath ()
You can’t perform that action at this time.
0 commit comments