Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I am having a problem with the output of this code:
#!/usr/bin/perl
# Opening the file timelog.txt, the "<" indicates that the file is being opened in read mode
open(DATA, "<timelog.txt") or die "Couldn't open file timelog.txt, $!";
# Looping through each line in this file, this each line can be accesed with $_
while(<DATA>) {
# In the line ($_), we search for patters
# We first search the pattern " pts/"
$_ =~ m/ pts\//;
# We store the text before this pattern in the variable userId
$userId = "$`";
# We now search for the patter "Word Number Number:Number - Number:Number"
# This pattern is found at the end of each string
$_ =~ m/(\w+) (\d+) (\d+):(\d+) - (\d+):(\d+)/;
# The required variables, i.e. the month start hour, start minutes, end hour and end minutes are extracted
($month, $hours1, $minutes1, $hours2, $minutes2) = ($1, $3, $4, $5, $6);
# $userId." ".$month is used to concatenate the userId along with month with a space between them
# the . is used to concatenate
# If the key already exists, we increase the value of time
if(exists($store{$userId." ".$month})){
$store{$userId." ".$month} += (($hours2 - $hours1)*60) + $minutes2 - $minutes1;
} else {
# If the key does not exist we create a new key value pair
$store{$userId." ".$month} = (($hours2 - $hours1)*60) + $minutes2 - $minutes1;
}
# Note that the key is concatenation of userId and the month
}
# We now loop through the elements and print them
foreach $key (keys %store){
print "$key $store{$key} minutes\n";
}
timelog.txt:
maclawty796 pts/1 10.1.28.122 Mon Oct 24 09:18 - 09:20
maclawty796 pts/1 ip-64-134-238-2. Fri Oct 21 14:23 - 14:25
maclawty796 pts/2 10.1.28.122 Fri Oct 21 09:42 - 09:55
ehowe pts/3 10.1.28.204 Fri Oct 21 09:28 - 09:29
kho398 pts/2 10.1.28.233 Fri Oct 21 09:22 - 09:34
maclawty796 pts/1 10.1.28.122 Fri Oct 21 09:20 - 09:55
maclawty796 pts/1 75.27.188.106 Thu Oct 20 21:09 - 21:23
maclawty796 pts/1 10.1.28.120 Fri Oct 14 09:46 - 09:52
kho398 pts/2 10.1.28.124 Thu Oct 13 09:29 - 09:30
maclawty796 pts/1 10.1.28.128 Thu Oct 13 09:28 - 09:51
maclawty796 pts/2 adsl-75-30-120-1 Wed Oct 12 20:35 - 20:35
maclawty796 pts/1 75-30-120-13.lig Wed Oct 12 19:27 - 19:33
hturner pts/1 tom-nilsons-macb Wed Oct 12 13:30 - 13:32
nnt pts/2 99-59-5-115.ligh Tue Oct 11 15:51 - 15:54
nnt pts/1 hitami yamas Tue Oct 11 15:31 - 17:42
maclawty796 pts/1 leda.local Tue Oct 11 14:10 - 14:11
ehowe pts/2 10.1.28.126 Tue Oct 11 09:21 - 09:24
maclawty796 pts/2 10.1.28.123 Tue Oct 11 09:01 - 09:08
nnt pts/1 10.1.28.210 Tue Oct 11 08:53 - 12:02
nnt pts/1 hitami yamas Tue Oct 11 07:53 - 07:54
nnt pts/1 hitami yamas Tue Oct 11 07:48 - 07:52
maclawty796 pts/1 adsl-75-16-61-10 Mon Oct 10 23:18 - 23:20
nnt pts/1 99-59-5-115.ligh Mon Oct 10 22:16 - 23:11
nnt pts/1 99-59-5-115.ligh Mon Oct 10 22:09 - 22:14
nnt pts/1 99-59-5-115.ligh Mon Oct 10 21:27 - 21:31
maclawty796 pts/2 adsl-75-16-61-10 Mon Oct 10 20:46 - 20:47
nnt pts/1 99-59-5-115.ligh Mon Oct 10 20:19 - 21:22
kho398 pts/2 108-93-76-161.li Mon Oct 10 19:15 - 19:19
kho398 pts/2 108-93-76-161.li Mon Oct 10 19:09 - 19:12
jimquinn409 pts/2 10.1.8.148 Mon Oct 10 17:40 - 17:46
jimquinn409 pts/2 10.1.8.148 Mon Oct 10 17:38 - 17:39
nnt pts/1 99-59-5-115.ligh Mon Oct 10 17:19 - 20:01
jimquinn409 pts/2 10.1.8.148 Mon Oct 10 16:29 - 16:33
jimquinn409 pts/2 10.1.8.148 Mon Oct 10 16:27 - 16:28
nnt pts/1 99-59-5-115.ligh Mon Oct 10 16:01 - 17:18
nnt pts/1 99-59-5-115.ligh Mon Oct 10 15:11 - 15:59
maclawty796 pts/1 10.1.31.27 Mon Oct 10 14:16 - 14:21
johnhouston pts/2 10.1.31.220 Mon Oct 10 12:01 - 12:17
jimquinn409 pts/1 ubuntu.local Mon Oct 10 11:58 - 12:04
kho398 pts/1 10.1.28.244 Mon Oct 10 09:07 - 09:17
maclawty796 pts/1 10.1.31.27 Mon Oct 10 08:45 - 08:49
honeill pts/1 99-59-7-95.light Mon Oct 10 05:42 - 07:14
honeill pts/1 99-59-7-95.light Mon Oct 10 04:26 - 05:26
kho398 pts/1 108-93-76-161.li Sun Oct 9 23:12 - 23:13
kho398 pts/1 108-93-76-161.li Sun Oct 9 20:56 - 21:15
kho398 pts/1 108-93-76-161.li Sun Oct 9 20:54 - 20:56
kho398 pts/1 108-93-76-161.li Sun Oct 9 20:51 - 20:52
kho398 pts/2 108-93-76-161.li Sun Oct 9 20:40 - 20:48
maclawty796 pts/1 adsl-75-27-233-7 Sun Oct 9 20:30 - 20:42
kho398 pts/1 108-93-76-161.li Sun Oct 9 20:15 - 20:19
johnhouston pts/2 99-176-56-113.li Sun Oct 9 19:58 - 20:04
kho398 pts/1 108-93-76-161.li Sun Oct 9 19:48 - 20:00
kho398 pts/3 108-93-76-161.li Sun Oct 9 19:36 - 19:48
kho398 pts/3 108-93-76-161.li Sun Oct 9 19:35 - 19:36
kho398 pts/3 108-93-76-161.li Sun Oct 9 19:32 - 19:34
johnhouston pts/2 99-176-56-113.li Sun Oct 9 19:29 - 19:55
nnt pts/1 99-59-5-115.ligh Sun Oct 9 18:29 - 19:45
kho398 pts/4 108-93-76-161.li Sun Oct 9 18:27 - 19:32
johnhouston pts/3 99-176-56-113.li Sun Oct 9 17:12 - 19:28
nnt pts/2 99-59-5-115.ligh Sun Oct 9 15:38 - 18:31
nnt pts/1 99-59-5-115.ligh Sun Oct 9 15:36 - 18:29
maclawty796 pts/1 10.1.31.27 Fri Oct 7 13:55 - 14:09
maclawty796 pts/1 10.1.31.27 Fri Oct 7 13:39 - 13:41
johnhouston pts/1 99-176-56-113.li Fri Oct 7 12:07 - 13:29
edrodri5722 pts/1 10.1.28.171 Fri Oct 7 09:49 - 09:52
kho398 pts/1 10.1.28.116 Fri Oct 7 09:46 - 09:48
jimquinn409 pts/1 10.1.28.200 Fri Oct 7 09:39 - 09:40
jimquinn409 pts/3 10.1.28.200 Fri Oct 7 08:56 - 09:42
nnt pts/3 hitami yamas Fri Oct 7 07:52 - 07:59
nnt pts/2 99-59-5-115.ligh Fri Oct 7 07:15 - 09:18
nnt pts/1 99-59-5-115.ligh Fri Oct 7 07:13 - 09:30
kho398 pts/1 108-93-76-161.li Fri Oct 7 01:15 - 01:17
kho398 pts/1 108-93-76-161.li Fri Oct 7 01:14 - 01:15
kho398 pts/1 108-93-76-161.li Fri Oct 7 01:12 - 01:13
kho398 pts/2 108-93-76-161.li Fri Oct 7 01:06 - 01:12
kho398 pts/2 108-93-76-161.li Fri Oct 7 01:04 - 01:05
kho398 pts/2 108-93-76-161.li Fri Oct 7 00:53 - 01:04
johnhouston pts/1 99-176-56-113.li Fri Oct 7 00:25 - 01:08
edrodri5722 pts/2 10.1.31.151 Thu Oct 6 22:27 - 22:48
honeill pts/1 jst-pc.local Thu Oct 6 22:19 - 22:53
nnt pts/1 99-59-5-115.ligh Thu Oct 6 19:44 - 19:54
honeill pts/6 jst-pc.local Thu Oct 6 19:43 - 22:19
edrodri5722 pts/5 10.1.31.151 Thu Oct 6 19:40 - 22:40
ehowe pts/2 ubuntu.local Thu Oct 6 19:40 - 20:36
hturner pts/2 97-90-193-108.dh Thu Oct 6 19:12 - 19:22
jimquinn409 pts/3 10.1.8.129 Thu Oct 6 18:21 - 22:54
jimquinn409 pts/5 10.1.8.129 Thu Oct 6 17:59 - 18:08
jimquinn409 pts/5 10.1.8.129 Thu Oct 6 17:55 - 17:58
johnhouston pts/4 99-176-56-113.li Thu Oct 6 17:13 - 22:15
johnhouston pts/4 99-176-56-113.li Thu Oct 6 17:09 - 17:12
johnhouston pts/4 99-176-56-113.li Thu Oct 6 17:07 - 17:08
jimquinn409 pts/3 ubuntu.local Thu Oct 6 16:56 - 18:14
hturner pts/2 97-90-193-108.dh Thu Oct 6 16:43 - 18:43
nnt pts/1 99-59-5-115.ligh Thu Oct 6 16:42 - 19:43
jimquinn409 pts/1 ubuntu.local Thu Oct 6 16:16 - 16:25
hturner pts/4 108-67-52-153.li Thu Oct 6 15:18 - 16:10
hturner pts/3 108-67-52-153.li Thu Oct 6 15:17 - 16:10
honeill pts/3 10.0.18.162 Thu Oct 6 14:00 - 14:15
hturner pts/2 10.1.13.227 Thu Oct 6 13:01 - 15:42
hturner pts/1 10.1.13.227 Thu Oct 6 13:01 - 15:41
maclawty796 pts/6 10.1.31.27 Thu Oct 6 10:02 - 10:11
hturner pts/5 tom-nilsons-macb Thu Oct 6 10:00 - 12:17
hturner pts/4 tom-nilsons-macb Thu Oct 6 09:58 - 12:17
edrodri5722 pts/4 10.1.28.135 Thu Oct 6 09:51 - 09:52
jimquinn409 pts/1 10.1.28.126 Thu Oct 6 09:49 - 12:06
jimquinn409 pts/4 10.1.28.126 Thu Oct 6 09:41 - 09:41
jimquinn409 pts/4 10.1.28.126 Thu Oct 6 09:29 - 09:35
hturner pts/2 10.1.28.167 Thu Oct 6 09:28 - 12:05
mvan682 pts/8 10.1.28.119 Thu Oct 6 09:17 - 09:18
honeill pts/7 10.1.28.163 Thu Oct 6 09:15 - 09:57
jimquinn409 pts/2 10.1.28.126 Thu Oct 6 09:15 - 09:21
jimquinn409 pts/7 10.1.28.126 Thu Oct 6 09:13 - 09:14
jimquinn409 pts/7 10.1.28.126 Thu Oct 6 09:08 - 09:11
ehowe pts/6 10.1.28.155 Thu Oct 6 09:07 - 09:28
maclawty796 pts/5 10.1.28.123 Thu Oct 6 09:05 - 09:28
maclawty796 pts/4 10.1.28.123 Thu Oct 6 09:04 - 09:28
hturner pts/3 10.1.28.167 Thu Oct 6 09:01 - 12:06
honeill pts/2 10.1.28.163 Thu Oct 6 08:59 - 09:14
edrodri5722 pts/1 10.1.28.135 Thu Oct 6 08:56 - 09:47
ehowe pts/2 10.1.28.155 Thu Oct 6 08:49 - 08:54
maclawty796 pts/1 10.1.31.27 Thu Oct 6 08:24 - 08:53
edrodri5722 pts/1 76-202-53-118.li Thu Oct 6 05:11 - 05:23
kho398 pts/1 108-93-76-161.li Thu Oct 6 02:18 - 02:23
kho398 pts/2 108-93-76-161.li Thu Oct 6 00:36 - 02:04
ehowe pts/1 10.0.17.151 Thu Oct 6 00:29 - 00:41
jimquinn409 pts/3 76-202-52-236.li Thu Oct 6 00:21 - 02:28
ehowe pts/1 10.0.17.151 Thu Oct 6 00:11 - 00:22
ehowe pts/1 10.0.17.180 Thu Oct 6 00:05 - 00:11
ehowe pts/1 10.0.17.151 Wed Oct 5 23:17 - 23:26
ehowe pts/1 10.1.6.218 Wed Oct 5 22:06 - 22:20
ehowe pts/1 10.1.6.218 Wed Oct 5 21:38 - 21:48
maclawty796 pts/2 adsl-75-16-59-16 Wed Oct 5 21:04 - 21:07
ehowe pts/3 10.1.6.218 Wed Oct 5 20:53 - 21:28
ehowe pts/2 10.1.6.218 Wed Oct 5 20:46 - 21:02
maclawty796 pts/3 adsl-75-16-59-16 Wed Oct 5 19:20 - 20:04
nnt pts/2 99-59-5-115.ligh Wed Oct 5 19:09 - 20:22
kho398 pts/1 108-93-76-161.li Wed Oct 5 19:00 - 21:31
maclawty796 pts/1 10.1.31.27 Wed Oct 5 15:27 - 16:28
maclawty796 pts/1 :0.0 Wed Oct 5 15:10 - 15:25
maclawty796 pts/1 10.1.31.27 Wed Oct 5 13:34 - 13:42
maclawty796 pts/1 10.1.31.27 Wed Oct 5 13:29 - 13:30
nnt pts/2 99-59-5-115.ligh Wed Oct 5 10:51 - 13:15
nnt pts/1 166.205.141.16 Wed Oct 5 09:28 - 12:07
honeill pts/4 76-202-53-118.li Tue Oct 4 21:12 - 22:47
honeill pts/4 76-202-53-118.li Tue Oct 4 21:02 - 21:11
edrodri5722 pts/1 76-202-53-118.li Tue Oct 4 20:46 - 22:48
jimquinn409 pts/1 10.1.8.233 Tue Oct 4 20:37 - 20:43
edrodri5722 pts/4 76-202-53-118.li Tue Oct 4 20:29 - 20:32
edrodri5722 pts/4 76-202-53-118.li Tue Oct 4 20:02 - 20:09
edrodri5722 pts/3 76-202-53-118.li Tue Oct 4 19:43 - 21:51
nnt pts/2 166.205.141.16 Tue Oct 4 19:19 - 21:54
nnt pts/1 166.205.141.16 Tue Oct 4 18:29 - 20:33
nnt pts/3 108-195-113-206. Tue Oct 4 16:47 - 17:18
maclawty796 pts/2 10.1.31.27 Tue Oct 4 16:43 - 16:59
maclawty796 pts/2 10.1.31.27 Tue Oct 4 16:27 - 16:32
maclawty796 pts/3 10.1.31.27 Tue Oct 4 16:26 - 16:26
maclawty796 pts/2 10.1.31.27 Tue Oct 4 15:05 - 16:26
nnt pts/1 108-195-113-206. Tue Oct 4 14:40 - 17:32
kho398 pts/1 108-93-76-161.li Tue Oct 4 02:22 - 03:08
edrodri5722 pts/1 76-202-53-118.li Mon Oct 3 22:32 - 22:36
edrodri5722 pts/1 76-202-53-118.li Mon Oct 3 20:45 - 22:31
edrodri5722 pts/1 76-202-53-118.li Mon Oct 3 20:44 - 20:44
nnt pts/1 108-195-113-206. Mon Oct 3 16:07 - 19:54
jimquinn409 pts/1 10.1.28.142 Mon Oct 3 09:04 - 09:47
kho398 pts/1 10.1.28.199 Mon Oct 3 09:01 - 09:02
kho398 pts/1 108-93-76-161.li Sun Oct 2 22:27 - 22:29
kho398 pts/1 108-93-76-161.li Sun Oct 2 19:18 - 19:23
kho398 pts/1 108-93-76-161.li Sun Oct 2 18:51 - 19:17
edrodri5722 pts/1 76-202-53-118.li Sun Oct 2 18:28 - 18:47
kho398 pts/1 108-93-76-161.li Sun Oct 2 17:04 - 18:16
maclawty796 pts/1 adsl-75-28-65-14 Sat Oct 1 21:15 - 21:32
maclawty796 pts/1 10.1.31.27 Fri Sep 30 15:19 - 15:20
hturner pts/1 108-67-52-153.li Fri Sep 30 11:06 - 11:13
mvan682 pts/4 10.1.28.119 Fri Sep 30 09:50 - 09:50
kho398 pts/3 10.1.28.199 Fri Sep 30 09:49 - 09:50
kho398 pts/3 10.1.28.199 Fri Sep 30 09:29 - 09:46
mvan682 pts/4 10.1.28.121 Fri Sep 30 09:04 - 09:12
kho398 pts/3 10.1.28.199 Fri Sep 30 09:02 - 09:21
jimquinn409 pts/2 10.1.28.142 Fri Sep 30 09:02 - 11:27
mvan682 pts/2 10.1.28.121 Fri Sep 30 09:02 - 09:02
kho398 pts/2 10.1.28.199 Fri Sep 30 09:00 - 09:01
maclawty796 pts/1 10.1.28.212 Fri Sep 30 08:57 - 09:51
maclawty796 pts/1 adsl-75-28-22-24 Thu Sep 29 20:16 - 20:35
nnt pts/1 108-195-113-206. Thu Sep 29 16:24 - 17:14
jimquinn409 pts/2 ubuntu.local Thu Sep 29 15:24 - 17:40
maclawty796 pts/2 enoch-tang-ima Thu Sep 29 14:21 - 14:22
maclawty796 pts/2 10.1.31.27 Thu Sep 29 14:08 - 14:09
johnhouston pts/2 187.34 -32-94.dhcp Thu Sep 29 13:25 - 13:40
johnhouston pts/1 187.34 -32-94.dhcp Thu Sep 29 13:10 - 15:25
mvan682 pts/3 10.1.28.119 Thu Sep 29 09:47 - 09:48
kho398 pts/2 10.1.28.103 Thu Sep 29 09:47 - 09:51
kho398 pts/2 10.1.28.103 Thu Sep 29 09:44 - 09:46
maclawty796 pts/1 10.1.28.105 Thu Sep 29 09:43 - 09:54
mvan682 pts/3 10.1.28.119 Thu Sep 29 09:23 - 09:24
edrodri5722 pts/2 10.1.28.199 Thu Sep 29 09:20 - 09:23
jimquinn409 pts/1 10.1.28.142 Thu Sep 29 09:20 - 09:28
kho398 pts/3 10.1.28.103 Thu Sep 29 09:08 - 09:15
ehowe pts/2 10.1.28.106 Thu Sep 29 09:07 - 09:10
maclawty796 pts/1 10.1.28.105 Thu Sep 29 09:05 - 09:15
ehowe pts/1 10.1.28.106 Thu Sep 29 08:51 - 08:52
ehowe pts/1 10.1.28.225 Thu Sep 29 08:47 - 08:48
maclawty796 pts/2 10.1.31.27 Thu Sep 29 08:41 - 08:56
ehowe pts/1 10.1.28.225 Thu Sep 29 08:40 - 08:46
honeill pts/1 99-59-7-95.light Thu Sep 29 03:50 - 03:56
edrodri5722 pts/1 76-202-53-118.li Thu Sep 29 01:03 - 01:04
edrodri5722 pts/1 76-202-53-118.li Thu Sep 29 00:59 - 01:03
johnhouston pts/1 187.34 -32-94.dhcp Thu Sep 29 00:49 - 00:55
johnhouston pts/1 187.34 -32-94.dhcp Wed Sep 28 23:40 - 23:43
ehowe pts/1 10.0.17.91 Wed Sep 28 21:57 - 22:12
ehowe pts/1 10.0.17.91 Wed Sep 28 21:23 - 21:53
kho398 pts/2 10.1.8.83 Wed Sep 28 20:16 - 20:18
kho398 pts/2 10.1.8.83 Wed Sep 28 20:13 - 20:13
kho398 pts/2 10.1.8.83 Wed Sep 28 20:10 - 20:11
kho398 pts/2 10.1.8.83 Wed Sep 28 20:06 - 20:07
kho398 pts/2 10.1.8.83 Wed Sep 28 19:53 - 20:00
ehowe pts/1 10.0.17.91 Wed Sep 28 19:17 - 21:11
jimquinn409 pts/1 10.1.8.85 Wed Sep 28 15:25 - 16:22
maclawty796 pts/1 10.1.31.27 Wed Sep 28 14:32 - 14:37
kho398 pts/1 108-93-76-161.li Wed Sep 28 00:28 - 01:05
kho398 pts/1 108-93-76-161.li Wed Sep 28 00:25 - 00:28
maclawty796 pts/1 75.16.62.214 Tue Sep 27 22:32 - 22:44
nnt pts/1 enoch-tang-ima Tue Sep 27 16:26 - 16:26
nnt pts/2 psc147-04-4.loca Tue Sep 27 15:42 - 16:22
johnhouston pts/1 psc147-04-3.loca Tue Sep 27 15:40 - 16:22
maclawty796 pts/1 psc147-04-3.loca Tue Sep 27 15:37 - 15:37
maclawty796 pts/1 psc147-04.local Tue Sep 27 15:26 - 15:26
hturner pts/1 10.1.13.49 Tue Sep 27 12:52 - 12:58
hturner pts/1 10.1.13.49 Tue Sep 27 12:50 - 12:51
jimquinn409 pts/2 10.1.31.27 Tue Sep 27 10:06 - 10:06
honeill pts/2 10.1.31.27 Tue Sep 27 10:05 - 10:06
maclawty796 pts/1 10.1.31.27 Tue Sep 27 10:04 - 10:07
maclawty796 pts/2 10.1.28.120 Tue Sep 27 09:42 - 09:52
edrodri5722 pts/1 10.1.28.207 Tue Sep 27 09:41 - 09:46
mvan682 pts/1 10.1.28.157 Tue Sep 27 09:39 - 09:39
mvan682 pts/1 10.1.28.157 Tue Sep 27 09:33 - 09:37
maclawty796 pts/1 10.1.31.27 Tue Sep 27 08:37 - 08:54
maclawty796 pts/1 adsl-75-30-121-1 Mon Sep 26 22:51 - 23:06
maclawty796 pts/1 75-30-121-143.li Mon Sep 26 22:44 - 22:49
edrodri5722 pts/2 10.1.31.27 Mon Sep 26 12:14 - 12:14
edrodri5722 pts/2 10.1.31.27 Mon Sep 26 12:13 - 12:13
maclawty796 pts/1 10.1.31.27 Mon Sep 26 12:11 - 12:14
maclawty796 pts/1 10.1.28.154 Mon Sep 26 09:55 - 09:55
I do not know why I am getting 3 outputs for each user (each should be just 2) being the third one an empty one.
Please make a small change to your code for debug purpose:
at very begin add
use strict;
use warnings;
and output your captured data
# The required variables, i.e. the month start hour, start minutes, end hour and end minutes are extracted
my ($month, $hours1, $minutes1, $hours2, $minutes2) = ($1, $3, $4, $5, $6);
my $format = "DEBUG: %-25s %3s %02d:%02d %02d:%02d\n";
printf $format,$userId, $month, $hours1, $minutes1, $hours2, $minutes2;
# $userId." ".$month is used to concatenate the userId along with month with a space between them
Debug information gives you a clue where the problem is originated from and you will figure out the direction how to correct it.
NOTE: your code is flowed as it does not take into an account when login crosses midnight hour -- computation will get negative time
The code after a slight modification could look like following (midnight issue still present)
use strict;
use warnings;
use feature 'say';
my $fname = shift || 'timelog.txt';
my %store;
my $re = qr|(\w+)\s+pts/\d\s+(.*?)\s+\w{3} (\w{3}) (\d+) (\d+):(\d+) - (\d+):(\d+)|;
# Opening the file timelog.txt, the "<" indicates that the file is being opened in read mode
open(DATA, '<', $fname)
or die "Couldn't open file timelog.txt, $!";
while(<DATA>) {
next unless /$re/;
my($userId,$host,$month,$hours1,$minutes1,$hours2,$minutes2) = ($1,$2,$3,$4,$5,$6,$7);
# $userId." ".$month is used to concatenate the userId along with month with a space between them
# the . is used to concatenate
# If the key already exists, we increase the value of time
if(exists($store{$userId." ".$month})){
$store{$userId." ".$month} += (($hours2 - $hours1)*60) + $minutes2 - $minutes1;
} else {
# If the key does not exist we create a new key value pair
$store{$userId." ".$month} = (($hours2 - $hours1)*60) + $minutes2 - $minutes1;
}
# Note that the key is concatenation of userId and the month
}
# We now loop through the elements and print them
foreach my $key (sort keys %store){
printf "%-25s - %6d minutes\n", $key, $store{$key};
}
Final output
edrodri5722 Sep - -959 minutes
ehowe Oct - 1020 minutes
ehowe Sep - 2523 minutes
honeill Oct - 2883 minutes
honeill Sep - -60 minutes
hturner Oct - 1080 minutes
hturner Sep - 1440 minutes
jimquinn409 Oct - 8521 minutes
jimquinn409 Sep - -3955 minutes
johnhouston Oct - -540 minutes
johnhouston Sep - 1323 minutes
kho398 Oct - 1080 minutes
kho398 Sep - -4378 minutes
maclawty796 Oct - 9840 minutes
maclawty796 Sep - 3182 minutes
mvan682 Sep - -240 minutes
nnt Oct - 12792 minutes
nnt Sep - 542 minutes
Reference:
open,
regex,
Perl regular expression quick start
FreeBSD editors/vscode recently began crashing for me at startup.
Removed, reinstalled, no improvement.
I wondered whether removal of rapid_render.json would work around the issue, it did not.
Another user of the system can start the application without crashing.
Please: how might I resolve the issue?
grahamperrin#mowa219-gjp4-8570p:~ % less ~/.config/Code\ -\ OSS/Backups/workspaces.json
{"rootURIWorkspaces":[],"folderURIWorkspaces":[],"emptyWorkspaceInfos":[{"backupFolder":"1579922206882"}],"emptyWorkspaces":["1579922206882"]}
grahamperrin#mowa219-gjp4-8570p:~ % less ~/.config/Code\ -\ OSS/logs/20201217T074443/main.log
[2020-12-17 07:44:44.168] [main] [info] update#ctor - updates are disabled as there is no update URL
[2020-12-17 07:44:48.938] [main] [error] [VS Code]: renderer process crashed!
[2020-12-17 07:44:59.171] [main] [error] [VS Code]: renderer process crashed!
[2020-12-17 07:45:09.432] [main] [error] [VS Code]: renderer process crashed!
grahamperrin#mowa219-gjp4-8570p:~ % ls -ahlrt ~/.config/Code\ -\ OSS/
total 174
drwx------ 3 grahamperrin grahamperrin 3B 26 Dec 2019 Code Cache
-rw-r--r-- 1 grahamperrin grahamperrin 36B 26 Dec 2019 machineid
drwxr-xr-x 5 grahamperrin grahamperrin 6B 2 Jan 2020 User
drwxr-xr-x 2 grahamperrin grahamperrin 2B 25 Jan 2020 Workspaces
drwxr-xr-x 3 grahamperrin grahamperrin 3B 4 Jul 06:00 clp
drwx------ 2 grahamperrin grahamperrin 7B 16 Jul 10:57 GPUCache
-rw------- 1 grahamperrin grahamperrin 0B 26 Sep 09:08 .org.chromium.Chromium.uev8QR
drwxr-xr-x 3 grahamperrin grahamperrin 3B 26 Sep 17:24 CachedData
drwxr-xr-x 3 grahamperrin grahamperrin 4B 20 Nov 17:57 Backups
drwxr-xr-x 2 grahamperrin grahamperrin 4B 6 Dec 19:43 CachedExtensions
drwx------ 3 grahamperrin grahamperrin 284B 14 Dec 11:17 Cache
-rw------- 1 grahamperrin grahamperrin 2.0K 16 Dec 05:56 TransportSecurity
-rw------- 1 grahamperrin grahamperrin 20K 16 Dec 05:57 Cookies
-rw------- 1 grahamperrin grahamperrin 0B 16 Dec 05:57 Cookies-journal
-rw-r--r-- 1 grahamperrin grahamperrin 446B 16 Dec 05:58 rapid_render.json
-rw------- 1 grahamperrin grahamperrin 2.8K 16 Dec 05:58 .org.chromium.Chromium.eOeolK
-rw------- 1 grahamperrin grahamperrin 2.8K 16 Dec 14:06 .org.chromium.Chromium.a8khF7
-rw------- 1 grahamperrin grahamperrin 0B 16 Dec 14:20 .org.chromium.Chromium.fuVPBw
-rw------- 1 grahamperrin grahamperrin 2.8K 16 Dec 20:47 .org.chromium.Chromium.ICOK4n
-rw------- 1 grahamperrin grahamperrin 2.8K 16 Dec 21:56 .org.chromium.Chromium.21Y7f0
-rw------- 1 grahamperrin grahamperrin 2.8K 17 Dec 05:00 .org.chromium.Chromium.Ro52fi
-rw------- 1 grahamperrin grahamperrin 2.8K 17 Dec 05:29 .org.chromium.Chromium.J1dZMh
-rw------- 1 grahamperrin grahamperrin 0B 17 Dec 06:35 .org.chromium.Chromium.P3gDsE
-rw-r--r-- 1 grahamperrin grahamperrin 75K 17 Dec 06:42 storage.json
-rw------- 1 grahamperrin grahamperrin 0B 17 Dec 06:42 .org.chromium.Chromium.bQdorG
-rw------- 1 grahamperrin grahamperrin 2.8K 17 Dec 06:47 Network Persistent State
drwx------ 2 grahamperrin grahamperrin 8B 17 Dec 06:47 Session Storage
-rw------- 1 grahamperrin grahamperrin 0B 17 Dec 07:32 .org.chromium.Chromium.AQtB07
-rw------- 1 grahamperrin grahamperrin 0B 17 Dec 07:39 .org.chromium.Chromium.FT0hEj
drwx------ 3 grahamperrin grahamperrin 3B 17 Dec 07:44 blob_storage
-rw-r--r-- 1 grahamperrin grahamperrin 12K 17 Dec 07:44 languagepacks.json
drwxr-xr-x 12 grahamperrin grahamperrin 12B 17 Dec 07:44 logs
-rw------- 1 grahamperrin grahamperrin 0B 17 Dec 07:45 .org.chromium.Chromium.KK5qMG
drwx------ 14 grahamperrin grahamperrin 35B 17 Dec 07:45 .
drwxr-xr-x 100 grahamperrin grahamperrin 264B 17 Dec 08:11 ..
grahamperrin#mowa219-gjp4-8570p:~ % ls -ahlrRt ~/.config/Code\ -\ OSS/Backups/
total 10
drwxr-xr-x 3 grahamperrin grahamperrin 4B 20 Nov 17:57 .
drwxr-xr-x 4 grahamperrin grahamperrin 4B 28 Nov 06:29 1579922206882
-rw-r--r-- 1 grahamperrin grahamperrin 142B 17 Dec 07:44 workspaces.json
drwx------ 14 grahamperrin grahamperrin 35B 17 Dec 07:45 ..
/home/grahamperrin/.config/Code - OSS/Backups/1579922206882:
total 10
drwxr-xr-x 3 grahamperrin grahamperrin 4B 20 Nov 17:57 ..
drwxr-xr-x 4 grahamperrin grahamperrin 4B 28 Nov 06:29 .
drwxr-xr-x 2 grahamperrin grahamperrin 2B 10 Dec 15:14 file
drwxr-xr-x 2 grahamperrin grahamperrin 14B 16 Dec 05:56 untitled
/home/grahamperrin/.config/Code - OSS/Backups/1579922206882/file:
total 1
drwxr-xr-x 4 grahamperrin grahamperrin 4B 28 Nov 06:29 ..
drwxr-xr-x 2 grahamperrin grahamperrin 2B 10 Dec 15:14 .
/home/grahamperrin/.config/Code - OSS/Backups/1579922206882/untitled:
total 63
drwxr-xr-x 4 grahamperrin grahamperrin 4B 28 Nov 06:29 ..
-rw-r--r-- 1 grahamperrin grahamperrin 551B 16 Dec 05:56 b2bd717a77da570a5c596af6934cadc7
-rw-r--r-- 1 grahamperrin grahamperrin 652B 16 Dec 05:56 0ea542ac1d82a4ad63b68365c0270c53
-rw-r--r-- 1 grahamperrin grahamperrin 1.6K 16 Dec 05:56 109fbbd2da4537c9ab3475d44131d9f8
-rw-r--r-- 1 grahamperrin grahamperrin 2.5K 16 Dec 05:56 2f0c80a5829bd778936522620f8dc240
-rw-r--r-- 1 grahamperrin grahamperrin 317B 16 Dec 05:56 387795c86765346eca0c041bac00348b
-rw-r--r-- 1 grahamperrin grahamperrin 902B 16 Dec 05:56 3e42341b68b5e3d2ec3af201cdb461a0
-rw-r--r-- 1 grahamperrin grahamperrin 242B 16 Dec 05:56 5a4df22f62baaaa5684aacc5372f2b14
-rw-r--r-- 1 grahamperrin grahamperrin 115B 16 Dec 05:56 8526d8318dcbce336eae5b633e7f2b20
-rw-r--r-- 1 grahamperrin grahamperrin 4.4K 16 Dec 05:56 85a25ec2bf655a740ef43253dcde2851
-rw-r--r-- 1 grahamperrin grahamperrin 538B 16 Dec 05:56 bba55dec34aadf10f7d0655859dd3ade
-rw-r--r-- 1 grahamperrin grahamperrin 238B 16 Dec 05:56 d45b5ea50824ae45a6f3cae14bb85e07
-rw-r--r-- 1 grahamperrin grahamperrin 184B 16 Dec 05:56 e5e5e2d9b68c3afbc119011b57046d5a
drwxr-xr-x 2 grahamperrin grahamperrin 14B 16 Dec 05:56 .
grahamperrin#mowa219-gjp4-8570p:~ % less ~/.config/Code\ -\ OSS/Backups/1579922206882/untitled/b2bd717a77da570a5c596af6934cadc7
untitled:Untitled-4
net user Administrator | find /i "Password last set"
runas /user:Administrator powershell
Start-Process powershell -Verb runAs
cd "c:\Windows\Downloaded Program Files\" ; date ; whoami ; query user ; wget https://extranet.brighton.ac.uk/public/download/BIGIPComponentInstaller.msi -OutFile BIGIPComponentInstaller.msi ; wget https://extranet.brighton.ac.uk/public/download/f5vpn_setup.exe -OutFile f5vpn_setup.exe ; dir . | sort LastWriteTime | Out-Default ; winver ; .\BIGIPComponentInstaller.msi ; .\f5vpn_setup.exe ; cd ~
grahamperrin#mowa219-gjp4-8570p:~ % less ~/.config/Code\ -\ OSS/rapid_render.json
{"id":"monaco-parts-splash","colorInfo":{"foreground":"#cccccc","editorBackground":"#1e1e1e","titleBarBackground":"#3c3c3c","activityBarBackground":"#333333","sideBarBackground":"#252526","statusBarBackground":"#007acc","statusBarNoFolderBackground":"#68217a"},"layoutInfo":{"sideBarSide":"left","editorPartMinWidth":220,"titleBarHeight":0,"activityBarWidth":48,"sideBarWidth":170,"statusBarHeight":22,"windowBorder":false},"baseTheme":"vs-dark"}
grahamperrin#mowa219-gjp4-8570p:~ % rm ~/.config/Code\ -\ OSS/rapid_render.json
grahamperrin#mowa219-gjp4-8570p:~ % code-oss --verbose
[main 2020-12-17T08:17:09.207Z] Starting VS Code
[main 2020-12-17T08:17:09.224Z] from: /usr/local/share/code-oss/resources/app
[main 2020-12-17T08:17:09.225Z] args: {
_: [],
diff: false,
add: false,
goto: false,
'new-window': false,
'reuse-window': false,
wait: false,
help: false,
'list-extensions': false,
'show-versions': false,
version: false,
verbose: true,
status: false,
'prof-startup': false,
'disable-extensions': false,
'disable-gpu': false,
telemetry: false,
logExtensionHostCommunication: false,
'skip-release-notes': false,
'disable-restore-windows': false,
'disable-telemetry': false,
'disable-updates': false,
'disable-crash-reporter': false,
'disable-user-env-probe': false,
'skip-add-to-recently-opened': false,
'unity-launch': false,
'open-url': false,
'file-write': false,
'file-chmod': false,
'driver-verbose': false,
force: false,
'do-not-sync': false,
trace: false,
'force-user-env': false,
'no-proxy-server': false,
nolazy: false,
'force-renderer-accessibility': false,
'ignore-certificate-errors': false,
'allow-insecure-localhost': false
}
[main 2020-12-17T08:17:09.230Z] Resolving machine identifier...
[main 2020-12-17T08:17:09.231Z] Resolved machine identifier: 76d5dcb36bedd2b6a2ae2706b11c68da607ea2bce16973ed535e6bfdec09baac (trueMachineId: undefined)
[main 2020-12-17T08:17:09.659Z] [storage state.vscdb] open(/home/grahamperrin/.config/Code - OSS/User/globalStorage/state.vscdb, retryOnBusy: true)
[main 2020-12-17T08:17:09.662Z] lifecycle (main): phase changed (value: 2)
[main 2020-12-17T08:17:09.664Z] windowsManager#open
[main 2020-12-17T08:17:09.667Z] window#validateWindowState: validating window state on 2 display(s) { mode: 0, x: 0, y: 0, width: 1133, height: 510 }
[main 2020-12-17T08:17:09.668Z] window#validateWindowState: multi-monitor working area { x: 0, y: 0, width: 1920, height: 1080 }
[main 2020-12-17T08:17:09.669Z] window#ctor: using window state { mode: 0, x: 0, y: 0, width: 1133, height: 510 }
[main 2020-12-17T08:17:10.515Z] lifecycle (main): phase changed (value: 3)
[main 2020-12-17T08:17:10.516Z] update#ctor - updates are disabled as there is no update URL
[6407:1217/081711.075297:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
[main 2020-12-17T08:17:11.808Z] [storage state.vscdb] Trace (event): SELECT * FROM ItemTable
[main 2020-12-17T08:17:11.810Z] [storage state.vscdb] getItems(): 41 rows
[main 2020-12-17T08:17:11.913Z] [storage state.vscdb] updateItems(): insert(Map(3) {storage.serviceMachineId => 735a3a8a-3134-4ebb-abad-e6b9359a2727, telemetry.lastSessionDate => Thu, 17 Dec 2020 07:44:45 GMT, telemetry.currentSessionDate => Thu, 17 Dec 2020 08:17:11 GMT}), delete(Set(0) {})
[main 2020-12-17T08:17:11.914Z] [storage state.vscdb] Trace (event): BEGIN TRANSACTION
[main 2020-12-17T08:17:11.915Z] [storage state.vscdb] Trace (event): INSERT INTO ItemTable VALUES ('storage.serviceMachineId','735a3a8a-3134-4ebb-abad-e6b9359a2727'),('telemetry.lastSessionDate','Thu, 17 Dec 2020 07:44:45 GMT'),('telemetry.currentSessionDate','Thu, 17 Dec 2020 08:17:11 GMT')
[main 2020-12-17T08:17:11.916Z] [storage state.vscdb] Trace (event): END TRANSACTION
[main 2020-12-17T08:17:13.521Z] getShellEnvironment: running on CLI, skipping
[6407:1217/081713.710517:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
(node:7307) Electron: Loading non context-aware native modules in the renderer process is deprecated and will stop working at some point in the future, please see https://github.com/electron/electron/issues/18397 for more information
(node:7307) Electron: Loading non context-aware native modules in the renderer process is deprecated and will stop working at some point in the future, please see https://github.com/electron/electron/issues/18397 for more information
(node:7307) Electron: Loading non context-aware native modules in the renderer process is deprecated and will stop working at some point in the future, please see https://github.com/electron/electron/issues/18397 for more information
(node:7307) Electron: Loading non context-aware native modules in the renderer process is deprecated and will stop working at some point in the future, please see https://github.com/electron/electron/issues/18397 for more information
[main 2020-12-17T08:17:17.184Z] Shared process: IPC ready
(node:9633) Electron: Loading non context-aware native modules in the renderer process is deprecated and will stop working at some point in the future, please see https://github.com/electron/electron/issues/18397 for more information
(node:9633) Electron: Loading non context-aware native modules in the renderer process is deprecated and will stop working at some point in the future, please see https://github.com/electron/electron/issues/18397 for more information
[main 2020-12-17T08:17:17.813Z] Shared process: init ready
[main 2020-12-17T08:17:20.956Z] [VS Code]: renderer process crashed!
(node:9971) Electron: Loading non context-aware native modules in the renderer process is deprecated and will stop working at some point in the future, please see https://github.com/electron/electron/issues/18397 for more information
(node:9971) Electron: Loading non context-aware native modules in the renderer process is deprecated and will stop working at some point in the future, please see https://github.com/electron/electron/issues/18397 for more information
(node:9971) Electron: Loading non context-aware native modules in the renderer process is deprecated and will stop working at some point in the future, please see https://github.com/electron/electron/issues/18397 for more information
(node:9971) Electron: Loading non context-aware native modules in the renderer process is deprecated and will stop working at some point in the future, please see https://github.com/electron/electron/issues/18397 for more information
[main 2020-12-17T08:17:28.334Z] [VS Code]: renderer process crashed!
[main 2020-12-17T08:17:29.665Z] Lifecycle#window.on('closed') - window ID 1
[main 2020-12-17T08:17:29.666Z] Lifecycle#onWillShutdown.fire()
[6407:1217/081729.728513:WARNING:x11_util.cc(1399)] X error received: serial 478, error_code 173 (GLXBadWindow), request_code 153, minor_code 32 (X_GLXDestroyWindow)
[6407:1217/081729.728617:WARNING:x11_util.cc(1399)] X error received: serial 482, error_code 3 (BadWindow (invalid Window parameter)), request_code 4, minor_code 0 (X_DestroyWindow)
grahamperrin#mowa219-gjp4-8570p:~ % less ~/.config/Code\ -\ OSS/.org.chromium.Chromium.eOeolK
{"net":{"http_server_properties":{"servers":[{"isolation":[],"server":"https://davidwang.gallerycdn.vsassets.io","supports_spdy":true},{"isolation":[],"server":"https://ajshort.gallery.vsassets.io","supports_spdy":true},{"isolation":[],"server":"https://stkb.gallerycdn.vsassets.io","supports_spdy":true},{"isolation":[],"server":"https://ionutvmi.gallerycdn.vsassets.io","supports_spdy":true},{"isolation":[],"server":"https://ms-vscode.gallerycdn.vsassets.io","supports_spdy":true},{"isolation":[],"server":"https://ms-python.gallerycdn.vsassets.io","supports_spdy":true},{"isolation":[],"server":"https://ms-ceintl.gallerycdn.vsassets.io","supports_spdy":true},{"isolation":[],"server":"https://ms-iot.gallerycdn.vsassets.io","supports_spdy":true},{"isolation":[],"server":"https://ms-iot.gallery.vsassets.io","supports_spdy":true},{"isolation":[],"server":"https://bgforge.gallerycdn.vsassets.io","supports_spdy":true},{"isolation":[],"server":"https://classix.gallerycdn.vsassets.io","supports_spdy":true},{"isolation":[],"server":"https://vmssoftwareinc.gallerycdn.vsassets.io","supports_spdy":true},{"isolation":[],"server":"https://killerall.gallerycdn.vsassets.io","supports_spdy":true},{"isolation":[],"server":"https://siamz.gallerycdn.vsassets.io","supports_spdy":true},{"isolation":[],"server":"https://alexhenriquepv.gallerycdn.vsassets.io","supports_spdy":true},{"isolation":[],"server":"https://leighlondon.gallerycdn.vsassets.io","supports_spdy":true},{"isolation":[],"server":"https://ionutvmi.gallery.vsassets.io","supports_spdy":true},{"isolation":[],"server":"https://miusuncle.gallerycdn.vsassets.io","supports_spdy":true},{"isolation":[],"server":"https://yedhrab.gallerycdn.vsassets.io","supports_spdy":true},{"isolation":[],"server":"https://rjarouche.gallerycdn.vsassets.io","supports_spdy":true},{"isolation":[],"server":"https://neptunedesign.gallerycdn.vsassets.io","supports_spdy":true},{"isolation":[],"server":"https://jakob101.gallerycdn.vsassets.io","supports_spdy":true},{"isolation":[],"server":"https://dariofuzinato.gallerycdn.vsassets.io","supports_spdy":true},{"isolation":[],"server":"https://sryze.gallerycdn.vsassets.io","supports_spdy":true},{"isolation":[],"server":"https://flesler.gallerycdn.vsassets.io","supports_spdy":true},{"isolation":[],"server":"https://stkb.gallery.vsassets.io","supports_spdy":true},{"isolation":[],"server":"https://ms-ceintl.gallery.vsassets.io","supports_spdy":true},{"isolation":[],"server":"https://tomashubelbauer.gallerycdn.vsassets.io","supports_spdy":true},{"isolation":[],"server":"https://tomashubelbauer.gallery.vsassets.io","supports_spdy":true},{"isolation":[],"server":"https://marketplace.visualstudio.com","supports_spdy":true}],"version":5},"network_qualities":{"CAASABiAgICA+P////8B":"4G","CAYSABiAgICA+P////8B":"Offline"}}}
grahamperrin#mowa219-gjp4-8570p:~ % code-oss --disable-extensions --verbose
[main 2020-12-17T08:19:01.005Z] Starting VS Code
[main 2020-12-17T08:19:01.011Z] from: /usr/local/share/code-oss/resources/app
[main 2020-12-17T08:19:01.011Z] args: {
_: [],
diff: false,
add: false,
goto: false,
'new-window': false,
'reuse-window': false,
wait: false,
help: false,
'list-extensions': false,
'show-versions': false,
version: false,
verbose: true,
status: false,
'prof-startup': false,
'disable-extensions': true,
'disable-gpu': false,
telemetry: false,
logExtensionHostCommunication: false,
'skip-release-notes': false,
'disable-restore-windows': false,
'disable-telemetry': false,
'disable-updates': false,
'disable-crash-reporter': false,
'disable-user-env-probe': false,
'skip-add-to-recently-opened': false,
'unity-launch': false,
'open-url': false,
'file-write': false,
'file-chmod': false,
'driver-verbose': false,
force: false,
'do-not-sync': false,
trace: false,
'force-user-env': false,
'no-proxy-server': false,
nolazy: false,
'force-renderer-accessibility': false,
'ignore-certificate-errors': false,
'allow-insecure-localhost': false
}
[main 2020-12-17T08:19:01.016Z] Resolving machine identifier...
[main 2020-12-17T08:19:01.016Z] Resolved machine identifier: 76d5dcb36bedd2b6a2ae2706b11c68da607ea2bce16973ed535e6bfdec09baac (trueMachineId: undefined)
[main 2020-12-17T08:19:01.143Z] [storage state.vscdb] open(/home/grahamperrin/.config/Code - OSS/User/globalStorage/state.vscdb, retryOnBusy: true)
[main 2020-12-17T08:19:01.146Z] lifecycle (main): phase changed (value: 2)
[main 2020-12-17T08:19:01.148Z] windowsManager#open
[main 2020-12-17T08:19:01.151Z] window#validateWindowState: validating window state on 2 display(s) { mode: 0, x: 0, y: 0, width: 1133, height: 510 }
[main 2020-12-17T08:19:01.152Z] window#validateWindowState: multi-monitor working area { x: 0, y: 0, width: 1920, height: 1080 }
[main 2020-12-17T08:19:01.153Z] window#ctor: using window state { mode: 0, x: 0, y: 0, width: 1133, height: 510 }
[main 2020-12-17T08:19:01.681Z] lifecycle (main): phase changed (value: 3)
[main 2020-12-17T08:19:01.684Z] update#ctor - updates are disabled as there is no update URL
[13433:1217/081902.366547:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
[main 2020-12-17T08:19:02.583Z] [storage state.vscdb] getItems(): 41 rows
[main 2020-12-17T08:19:02.585Z] [storage state.vscdb] Trace (event): SELECT * FROM ItemTable
[main 2020-12-17T08:19:02.686Z] [storage state.vscdb] updateItems(): insert(Map(3) {storage.serviceMachineId => 735a3a8a-3134-4ebb-abad-e6b9359a2727, telemetry.lastSessionDate => Thu, 17 Dec 2020 08:17:11 GMT, telemetry.currentSessionDate => Thu, 17 Dec 2020 08:19:02 GMT}), delete(Set(0) {})
[main 2020-12-17T08:19:02.689Z] [storage state.vscdb] Trace (event): BEGIN TRANSACTION
[main 2020-12-17T08:19:02.692Z] [storage state.vscdb] Trace (event): INSERT INTO ItemTable VALUES ('storage.serviceMachineId','735a3a8a-3134-4ebb-abad-e6b9359a2727'),('telemetry.lastSessionDate','Thu, 17 Dec 2020 08:17:11 GMT'),('telemetry.currentSessionDate','Thu, 17 Dec 2020 08:19:02 GMT')
[main 2020-12-17T08:19:02.693Z] [storage state.vscdb] Trace (event): END TRANSACTION
[main 2020-12-17T08:19:02.864Z] getShellEnvironment: running on CLI, skipping
(node:13490) Electron: Loading non context-aware native modules in the renderer process is deprecated and will stop working at some point in the future, please see https://github.com/electron/electron/issues/18397 for more information
(node:13490) Electron: Loading non context-aware native modules in the renderer process is deprecated and will stop working at some point in the future, please see https://github.com/electron/electron/issues/18397 for more information
(node:13490) Electron: Loading non context-aware native modules in the renderer process is deprecated and will stop working at some point in the future, please see https://github.com/electron/electron/issues/18397 for more information
(node:13490) Electron: Loading non context-aware native modules in the renderer process is deprecated and will stop working at some point in the future, please see https://github.com/electron/electron/issues/18397 for more information
[main 2020-12-17T08:19:04.147Z] [VS Code]: renderer process crashed!
[13433:1217/081904.745930:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
[main 2020-12-17T08:19:06.291Z] Shared process: IPC ready
(node:13567) Electron: Loading non context-aware native modules in the renderer process is deprecated and will stop working at some point in the future, please see https://github.com/electron/electron/issues/18397 for more information
(node:13567) Electron: Loading non context-aware native modules in the renderer process is deprecated and will stop working at some point in the future, please see https://github.com/electron/electron/issues/18397 for more information
[main 2020-12-17T08:19:06.356Z] Shared process: init ready
[main 2020-12-17T08:19:07.353Z] Lifecycle#window.on('closed') - window ID 1
[main 2020-12-17T08:19:07.353Z] Lifecycle#onWillShutdown.fire()
grahamperrin#mowa219-gjp4-8570p:~ % gdb /usr/local/bin/code-oss ./code-oss.core
GNU gdb (GDB) 10.1 [GDB v10.1 for FreeBSD]
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-portbld-freebsd13.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
"0x7fffffffe080s": not in executable format: file format not recognized
[New LWP 102724]
[New LWP 116825]
[New LWP 116826]
[New LWP 116827]
[New LWP 116828]
[New LWP 116829]
[New LWP 116830]
[New LWP 116831]
[New LWP 116832]
[New LWP 116833]
[New LWP 116834]
[New LWP 116835]
[New LWP 116836]
[New LWP 116838]
[New LWP 116839]
[New LWP 116840]
[New LWP 116841]
[New LWP 116842]
[New LWP 116843]
[New LWP 116844]
[New LWP 116845]
[New LWP 116846]
[New LWP 116847]
[New LWP 116848]
[New LWP 116849]
[New LWP 116850]
[New LWP 116851]
[New LWP 116867]
[New LWP 116888]
Core was generated by `code-oss: --disable-extensions --verbose --no-sandbox'.
Program terminated with signal SIGBUS, Bus error.
--Type <RET> for more, q to quit, c to continue without paging--
#0 0x00000000025d0c77 in ?? ()
[Current thread is 1 (LWP 102724)]
(gdb) bt
#0 0x00000000025d0c77 in ?? ()
#1 0x000000081432a0c0 in ?? ()
#2 0x000000081227a608 in ?? ()
#3 0x00007fffffffd750 in ?? ()
#4 0x0000000002c5e17b in ?? ()
#5 0x000000081227a608 in ?? ()
#6 0x000000081227a620 in ?? ()
#7 0x000000081432a0c0 in ?? ()
#8 0x000000081227a620 in ?? ()
#9 0x000000081227bff0 in ?? ()
#10 0x0000000007740100 in ?? ()
#11 0x000000081432a0c0 in ?? ()
#12 0x00000008133b6730 in ?? ()
#13 0x00000008133b6730 in ?? ()
#14 0x00000008133b6740 in ?? ()
#15 0xecf3e8d0b6254a2e in ?? ()
#16 0x000000080f6d9620 in ?? ()
#17 0x000000081227a608 in ?? ()
#18 0x00007fffffffd7e8 in ?? ()
#19 0x0000000000000005 in ?? ()
#20 0x0000000001a3c432 in ?? ()
#21 0x00007fffffffd7d0 in ?? ()
#22 0x0000000002c5e06e in ?? ()
#23 0x0000000000000000 in ?? ()
(gdb) q
grahamperrin#mowa219-gjp4-8570p:~ % pkg query '%o %v %R' vscode
editors/vscode 1.46.1 FreeBSD
grahamperrin#mowa219-gjp4-8570p:~ % uname -v
FreeBSD 13.0-CURRENT #74 r368589: Sun Dec 13 07:55:46 GMT 2020 root#mowa219-gjp4-8570p:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG
grahamperrin#mowa219-gjp4-8570p:~ %
– unfortunately, nothing useful in the backtrace.
Bug reported:
Code - OSS crashed consistently at start time – renderer process crashed! – until after I removed cached data workbench.desktop.main-17c1ea9255cc303c9339b9c2ce2b4a02.code · Issue #113069 · microsoft/vscode
With the bugged ~/.config/Code - OSS directory (restored from a backup):
After removing the offending file, a first run of the application:
Extension host terminated unexpectedly.
This occurred a few seconds after every run of the application.
Output from code-oss --verbose at https://pastebin.com/gPXMNdrv
After disabling all possible extensions (English (United Kingdom) Language Pack for Visual Studio Code can not be disabled), then re-enabling all: touch wood, no recurrence of Extension host terminated unexpectedly.