Black rectangles in menu bar that randomly appear

I recently purchased a MacBook Air M1 and it runs the latest OS version. I noticed that sometimes there is a black rectangle in the menu bar. I have attached two screen shots. I am now worried if this is a known software bug or if my device has a defect. I have not been able to find the problem on the internet. Should I replace my device? The size of the rectangle is changing in size.

enter image description here

enter image description here


Solution 1:

To start with I would boot your Mac into Safe Mode and determine if the rectangles still appear.

Booting into Safe Mode on an M1 Mac

Follow these steps to boot your Mac into Safe Mode:

  1. Fully shut down your Mac
  2. Press the power button to start your Mac, but continue holding it down as your Mac starts up until you see the startup options window:

enter image description here

  1. Select your startup disk, press and hold the shift key and click the Continue in Safe option
  2. Let go of the shift key
  3. Log into your Mac (Note: you may need to do this twice)
  4. Take a note of what happens (i.e. do the rectangles still appear while in Safe Mode?)
  5. Exit Safe Mode by restarting your Mac as normal
  6. Test again to see if the rectangles still appear when booted normally

Once you've followed the above steps, let me know how you went and we'll go from there.