Next time go into Console > Utilities and post the report which will help diagnose what is causing this.
Here's the most recent:
Anonymous UUID: 72A51068-5C21-5D2E-813A-E4445DA26CAB
Fri Sep 15 00:11:51 2017
*** Panic Report ***
panic(cpu 1 caller 0xffffff80127fe39d): Kernel trap at 0xffffff80127a5d13, type 14=page fault, registers:
CR0: 0x0000000080010033, CR2: 0x0000000000000028, CR3: 0x0000000001d6e000, CR4: 0x0000000000002660
RAX: 0xffffff8017ed0000, RBX: 0xffffff80186a5b10, RCX: 0x0000000000000028, RDX: 0x0000000000000028
RSP: 0xffffff91fb4db8c0, RBP: 0xffffff91fb4db8f0, RSI: 0x0000000000000000, RDI: 0xffffff8017d061c8
R8: 0x0000000080000000, R9: 0xffffff80186a5b10, R10: 0x0000003fffffff00, R11: 0xffffff80398b9900
R12: 0xffffff7f80000000, R13: 0x000000000006c391, R14: 0xffffff80398b9900, R15: 0xffffff8016cd0000
RFL: 0x0000000000010207, RIP: 0xffffff80127a5d13, CS: 0x0000000000000008, SS: 0x0000000000000010
Fault CR2: 0x0000000000000028, Error code: 0x0000000000000000, Fault CPU: 0x1, PL: 1, VF: 0
Backtrace (CPU 1), Frame : Return Address
0xffffff91fb4db550 : 0xffffff80126e953c
0xffffff91fb4db5d0 : 0xffffff80127fe39d
0xffffff91fb4db7b0 : 0xffffff801269a593
0xffffff91fb4db7d0 : 0xffffff80127a5d13
0xffffff91fb4db8f0 : 0xffffff80127a5b78
0xffffff91fb4db910 : 0xffffff80127a891d
0xffffff91fb4db980 : 0xffffff8012787653
0xffffff91fb4dba00 : 0xffffff8012786081
0xffffff91fb4dba30 : 0xffffff8012787446
0xffffff91fb4dba60 : 0xffffff801278652a
0xffffff91fb4dbaa0 : 0xffffff8012772412
0xffffff91fb4dbbe0 : 0xffffff8012771aac
0xffffff91fb4dbc10 : 0xffffff801276d4a3
0xffffff91fb4dbc40 : 0xffffff80126f4cdd
0xffffff91fb4dbc60 : 0xffffff7f94287a20
0xffffff91fb4dbc90 : 0xffffff7f942bd028
0xffffff91fb4dbcc0 : 0xffffff7f94290d5a
0xffffff91fb4dbdc0 : 0xffffff8012948f70
0xffffff91fb4dbe40 : 0xffffff801293a4fd
0xffffff91fb4dbec0 : 0xffffff8012b9c11b
0xffffff91fb4dbf10 : 0xffffff8012b9c03a
0xffffff91fb4dbf50 : 0xffffff8012c240f5
0xffffff91fb4dbfb0 : 0xffffff801269ad96
Kernel Extensions in backtrace:
com.apple.filesystems.hfs.kext(366.70.1)[B0B8A05A-CC75-325C-A3DA-76C4F7B6F21A]@0xffffff7f94270000->0xffffff7f942d8fff
dependency: com.apple.filesystems.hfs.encodings.kext(1)[057A044B-8E0D-3A57-8861-87193496E893]@0xffffff7f94269000
BSD process name corresponding to current thread: logd
Mac OS version:
16G29
Kernel version:
Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64
Kernel UUID: D3314D98-5D40-3CD8-98A4-F1DD46C20E03
Kernel slide: 0x0000000012400000
Kernel text base: 0xffffff8012600000
__HIB text base: 0xffffff8012500000
System model name: iMac11,1 (Mac-F2268DAE)
System uptime in nanoseconds: 41615249654869
last loaded kext at 1174741136287: com.apple.nke.l2tp 1.9 (addr 0xffffff7f95650000, size 32768)
loaded kexts:
com.avast.FileShield 3.0.0
com.avast.PacketForwarder 2.1
com.apple.nke.l2tp 1.9
com.apple.filesystems.afpfs 11.0.5
com.apple.nke.asp-tcp 8.0.1
com.apple.filesystems.msdosfs 1.10
com.apple.filesystems.smbfs 3.1.2
com.apple.driver.AppleTopCaseHIDEventDriver 114
com.apple.driver.AppleHSBluetoothDriver 114
com.apple.driver.AppleBluetoothMultitouch 92
com.apple.driver.AudioAUUC 1.70
com.apple.filesystems.autofs 3.0
com.apple.driver.AppleTyMCEDriver 1.0.2d2
com.apple.driver.AGPM 110.23.17
com.apple.driver.AppleMikeyHIDDriver 131
com.apple.driver.AppleMikeyDriver 279.48
com.apple.driver.AppleHDAHardwareConfigDriver 279.48
com.apple.driver.AppleHDA 279.48
com.apple.driver.AppleHWSensor 1.9.5d0
com.apple.driver.AppleUpstreamUserClient 3.6.4
com.apple.driver.pmtelemetry 1
com.apple.kext.AMDLegacyFramebuffer 1.5.1
com.apple.iokit.IOUserEthernet 1.0.1
com.apple.iokit.IOBluetoothSerialManager 5.0.5f1
com.apple.Dont_Steal_Mac_OS_X 7.0.0
com.apple.driver.AppleMuxControl 3.14.49
com.apple.driver.AppleBacklight 170.9.20
com.apple.driver.AppleOSXWatchdog 1
com.apple.driver.AppleFIVRDriver 4.1.0
com.apple.driver.ACPI_SMC_PlatformPlugin 1.0.0
com.apple.driver.AppleHV 1
com.apple.ATIRadeonX2000 10.0.2
com.apple.driver.AppleMCCSControl 1.3.4
com.apple.driver.AppleLPC 3.1
com.apple.driver.AppleIntelSlowAdaptiveClocking 4.0.0
com.apple.kext.AMD4800Controller 1.5.1
com.apple.iokit.IOBluetoothUSBDFU 5.0.5f1
com.apple.driver.AppleUSBStorageCoexistentDriver 404.50.6
com.apple.driver.AppleUSBCardReader 404.50.6
com.apple.driver.AppleIRController 341.2
com.apple.driver.AppleFireWireStorage 404.50.6
com.apple.driver.initioFWBridge 404.50.6
com.apple.driver.IOFireWireSerialBusProtocolSansPhysicalUnit 404.50.6
com.apple.driver.LSI_FW_500 404.50.6
com.apple.driver.Oxford_Semi 404.50.6
com.apple.driver.StorageLynx 404.50.6
com.apple.driver.AppleFileSystemDriver 3.0.1
com.apple.AppleFSCompression.AppleFSCompressionTypeDataless 1.0.0d1
com.apple.AppleFSCompression.AppleFSCompressionTypeZlib 1.0.0
com.apple.BootCache 40
com.apple.filesystems.hfs.kext 366.70.1
com.apple.iokit.SCSITaskUserClient 394.50.1
com.apple.iokit.IOAHCIBlockStorage 295.20.1
com.apple.driver.AppleFWOHCI 5.5.5
com.apple.iokit.AppleBCM5701Ethernet 10.2.10
com.apple.driver.AirPort.Atheros40 700.74.5
com.apple.driver.AppleAHCIPort 326.60.1
com.apple.driver.AppleRTC 2.0
com.apple.driver.AppleACPIButtons 5.0
com.apple.driver.AppleHPET 1.8
com.apple.driver.AppleSMBIOS 2.1
com.apple.driver.AppleACPIEC 5.0
com.apple.driver.AppleAPIC 1.7
com.apple.driver.AppleIntelCPUPowerManagementClient 219.0.0
com.apple.nke.applicationfirewall 172
com.apple.security.quarantine 3
com.apple.security.TMSafetyNet 8
com.apple.driver.AppleIntelCPUPowerManagement 219.0.0
com.apple.nke.ppp 1.9
com.apple.security.SecureRemotePassword 1.0
com.apple.driver.AppleHIDKeyboard 199
com.apple.driver.IOBluetoothHIDDriver 5.0.5f1
com.apple.driver.AppleMultitouchDriver 368.16
com.apple.driver.AppleInputDeviceSupport 76.7
com.apple.kext.triggers 1.0
com.apple.driver.DspFuncLib 279.48
com.apple.kext.OSvKernDSPLib 525
com.apple.iokit.IOSurface 159.9
com.apple.iokit.IOSerialFamily 11
com.apple.driver.AppleSSE 1.0
com.apple.driver.AppleGraphicsControl 3.14.49
com.apple.driver.AppleBacklightExpert 1.1.0
com.apple.iokit.IONDRVSupport 516.1
com.apple.iokit.IOFireWireIP 2.2.7
com.apple.driver.IOPlatformPluginLegacy 1.0.0
com.apple.driver.AppleHDAController 279.48
com.apple.iokit.IOHDAFamily 279.48
com.apple.iokit.IOAudioFamily 205.15
com.apple.vecLib.kext 1.2.0
com.apple.driver.AppleSMBusController 1.0.18d1
com.apple.driver.AppleSMBusPCI 1.0.14d1
com.apple.driver.IOPlatformPluginFamily 6.0.0d8
com.apple.driver.AppleSMC 3.1.9
com.apple.iokit.IOSlowAdaptiveClockingFamily 1.0.0
com.apple.kext.AMDSupport 1.5.1
com.apple.AppleGraphicsDeviceControl 3.14.49
com.apple.kext.AMDLegacySupport 1.5.1
com.apple.iokit.IOGraphicsFamily 515.3
com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport 5.0.5f1
com.apple.iokit.IOBluetoothHostControllerUSBTransport 5.0.5f1
com.apple.iokit.IOBluetoothHostControllerTransport 5.0.5f1
com.apple.iokit.IOBluetoothFamily 5.0.5f1
com.apple.iokit.IOUSBMassStorageClass 4.0.4
com.apple.iokit.IOSCSIBlockCommandsDevice 394.50.1
com.apple.iokit.IOUSBMassStorageDriver 131.60.1
com.apple.driver.usb.IOUSBHostHIDDevice 1.1
com.apple.iokit.IOFireWireSerialBusProtocolTransport 2.5.1
com.apple.iokit.IOFireWireSBP2 4.2.7
com.apple.driver.usb.cdc 5.0.0
com.apple.driver.usb.networking 5.0.0
com.apple.driver.usb.AppleUSBHostCompositeDevice 1.1
com.apple.filesystems.hfs.encodings.kext 1
com.apple.driver.usb.AppleUSBHub 1.1
com.apple.iokit.IOSCSIMultimediaCommandsDevice 394.50.1
com.apple.iokit.IOBDStorageFamily 1.8
com.apple.iokit.IODVDStorageFamily 1.8
com.apple.iokit.IOCDStorageFamily 1.8
com.apple.driver.AppleXsanScheme 3
com.apple.iokit.IOAHCISerialATAPI 266.50.1
com.apple.iokit.IOSCSIArchitectureModelFamily 394.50.1
com.apple.driver.AppleUSBMergeNub 900.4.1
com.apple.iokit.IOFireWireFamily 4.6.6
com.apple.driver.usb.AppleUSBHostPacketFilter 1.0
com.apple.iokit.IOEthernetAVBController 1.0.3b4
com.apple.driver.mDNSOffloadUserClient 1.0.1b8
com.apple.iokit.IOUSBFamily 900.4.1
com.apple.iokit.IO80211Family 1200.12.2
com.apple.iokit.IONetworkingFamily 3.2
com.apple.driver.corecapture 1.0.4
com.apple.iokit.IOAHCIFamily 288
com.apple.driver.usb.AppleUSBEHCIPCI 1.1
com.apple.driver.usb.AppleUSBUHCIPCI 1.1
com.apple.driver.usb.AppleUSBUHCI 1.1
com.apple.driver.usb.AppleUSBEHCI 1.1
com.apple.driver.AppleUSBHostMergeProperties 1.1
com.apple.driver.AppleEFINVRAM 2.1
com.apple.driver.AppleEFIRuntime 2.1
com.apple.iokit.IOHIDFamily 2.0.0
com.apple.iokit.IOSMBusFamily 1.1
com.apple.security.sandbox 300.0
com.apple.kext.AppleMatch 1.0.0d1
com.apple.driver.AppleKeyStore 2
com.apple.driver.AppleMobileFileIntegrity 1.0.5
com.apple.driver.AppleCredentialManager 1.0
com.apple.driver.KernelRelayHost 1
com.apple.iokit.IOUSBHostFamily 1.1
com.apple.driver.AppleBusPowerController 1.0
com.apple.driver.DiskImages 444.50.16
com.apple.iokit.IOStorageFamily 2.1
com.apple.iokit.IOReportFamily 31
com.apple.driver.AppleFDEKeyStore 28.30
com.apple.driver.AppleACPIPlatform 5.0
com.apple.iokit.IOPCIFamily 2.9
com.apple.iokit.IOACPIFamily 1.4
com.apple.kec.Libm 1
com.apple.kec.pthread 1
com.apple.kec.corecrypto 1.0