How to "detect system program error" in Ubuntu

L4T32.5.1

hello junxing.liang,

may I know what’s the actual errors? please also gather the logs for reference.
for example,
there’s system level logs, /var/log/syslog, and kernel level logs, dmesg

Note that if you start “report problem” that it will provide more information there as well as in logs. You don’t even have to complete the report or send it anywhere. Also, the information which is for the report is in this log file (which you could post):
/var/log/apport.log
(older logs will for example have a numbered extension, e.g., “apport.log.1”)