diff options
Diffstat (limited to 'results/classifier/deepseek-2/output/manual-review/2983')
| -rw-r--r-- | results/classifier/deepseek-2/output/manual-review/2983 | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/results/classifier/deepseek-2/output/manual-review/2983 b/results/classifier/deepseek-2/output/manual-review/2983 new file mode 100644 index 000000000..cbcb1d44f --- /dev/null +++ b/results/classifier/deepseek-2/output/manual-review/2983 @@ -0,0 +1,116 @@ + +qemu-system-riscv64 randomly turns MPP bits to 0 in the mstatus word. +Description of problem: +ToyOs runs the kernel in machine mode and user programs in user mode. This is specific choice on my part to make sure the kernel code runs with machine address and user code runs with virtual addresses. This is different than Linux, NetBSD or other OSes I know that run the kernel in supervisor mode. When running in machine mode and running kernel code, I get a a trap. My error message looks like this: + +PANIC: Unexpected trap from machine mode! + mepc = 0x800002a8, mcause = 2, mtval=0xe78023 mstatus=0xa00000080 + +Notice, the mstatus bits show the trap was due to a privileged instruction being run by a "user" mode instruction. In the "assignment version" used for the above, no user code was run. It was just multiple threads running in machine mode. Also, the trap function is run with the MPP bits of 0, so even trying to recover from this trap can't be done as trying to manipulate the mstatus will generate yet again another trap to the same place and still running in "user" mode. + +This change does not happen on every run. It happens more consistently recently when trying to debug the kernel with gdb. This must be a race condition somewhere. + +The kernel is written in C++ with C libraries. +Steps to reproduce: +1. You will need to have access to my kernel and possibly my code base. This is a code base that I want to stay at WWU (Western Washington University). +2. Give the command "bmake run". It often completes with no problems, but if you run it often enough it will generate this trap from "machine mode". The example above had four good runs with no errors and on the fifth run it blew up. There is not guaranteed way to get this to have a problem. (This is why I haven't reported it before, I kept trying to get a minimal code set that had the problem, but I couldn't do it.) +Additional information: +This is a bug has been a problem for several years. It didn't strike very often on some versions of qemu. I think one of the 7.x.x versions happened not too often. But with newer, faster machines and a different version of Linux, this bug has become a big problem for me and my students. + +Here is a sample bad run: (All compilation has been done before so this just makes sure everything is up-to-date and then runs qemu-system-riscv64. In this assignment, no user mode code is being run. Threads are all running in machine mode for the entire time. I am getting clock interrupts on the CPU, but that does not appear to be the problem.) + +$ bmake run +if ! [ -e toolbin ] ; then mkdir toolbin ; fi; +(cd tools; bmake install) +(cd toy_fs; bmake) +`toyfs' is up to date. +(cd mkdep; bmake) +`mkdep' is up to date. +(cd toy_fs; bmake install) +(cd mkdep; bmake install) +Making in /home/phil/447/csci447_s25/lib +Making in /home/phil/447/csci447_s25/kernel +`DISK' is up to date. +qemu-system-riscv64 -machine virt -bios none -m 1G -smp 1 -nographic -global virtio-mmio.force-legacy=false -drive file=DISK,if=none,format=raw,id=x0 -device virtio-blk-device,drive=x0,bus=virtio-mmio-bus.0 -kernel kernel/kernel -gdb tcp::27277 +Initializing scheduler ... +Initializing frame set... +Initializing thread set ... +Initializing process set ... +Initializing fcb set ... +Initializing OpenFile set ... +Initializing pipe set ... +Initializing vertio ... +Initializing filesystem ... +Starting os_main ... +PANIC: Unexpected trap from machine mode! + mepc = 0x800002a8, mcause = 2, mtval=0xe78023 mstatus=0xa00000080 +attach with gdb! +QEMU: Terminated + +$ riscv64-unknown-elf-addr2line -e kernel/kernel 0x800002a8 +/home/phil/447/csci447_s25/kernel/runtime.S:350 + +And that instruction turns out to be "mret", the return from the clock interrupt. + +The following is a error free run of this. + +$ bmake run +if ! [ -e toolbin ] ; then mkdir toolbin ; fi; +(cd tools; bmake install) +(cd toy_fs; bmake) +`toyfs' is up to date. +(cd mkdep; bmake) +`mkdep' is up to date. +(cd toy_fs; bmake install) +(cd mkdep; bmake install) +Making in /home/phil/447/csci447_s25/lib +Making in /home/phil/447/csci447_s25/kernel +`DISK' is up to date. +qemu-system-riscv64 -machine virt -bios none -m 1G -smp 1 -nographic -global virtio-mmio.force-legacy=false -drive file=DISK,if=none,format=raw,id=x0 -device virtio-blk-device,drive=x0,bus=virtio-mmio-bus.0 -kernel kernel/kernel -gdb tcp::27277 +Initializing scheduler ... +Initializing frame set... +Initializing thread set ... +Initializing process set ... +Initializing fcb set ... +Initializing OpenFile set ... +Initializing pipe set ... +Initializing vertio ... +Initializing filesystem ... +Starting os_main ... + +Welcome to Toy OS, hartid = 0 +Assignment 3 ... + +********** Frame Tester ********** +1.3.2.4.5.6.7.8.9.10.12.11.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.30.31.32.33.34.35.36.37.38.39.40.41.42.43.44.45.46.47.48.49.50.51.52.53.54.55.56.57.58.59.60.61.62.63.64.65.66.67.68.69.70.71.72.73.74.75.76.77.78.79.80.81.82.83.85.84.87.86.88.89.91.92.90.93.94.95.96.97.98.99.100.101.102.103.104.105.106.107.108.109.110.111.113.112.114.115.116.117.119.118.120.121.122.123.124.125.126.127.128.129.130.131.132.133.134.135.136.137.138.139.140.161.162.163.164.166.165.167.168.169.170.171.172.173.174.175.177.178.176.179.180.181.182.183.184.185.186.187.188.189.190.191.194.193.192.195.197.196.198.200.199.201.202.203.204.206.205.207.209.208.210.211.212.214.213.215.216.217.218.219.220.221.222.223.224.225.226.227.228.230.231.229.232.233.234.235.236.237.238.239.240.241.242.243.244.245.246.247.248.249.250.252.253.251.254.255.256.257.258.259.260.261.262.263.264.265.266.267.268.269.270.271.273.272.274.275.276.277.278.279.280.281.282.283.284.285.286.287.288.289.290.291.292.293.294.295.296.297.298.299.300.301.302.303.304.305.306.308.307.309.310.311.312.313.314.315.316.317.318.319.320.341.342.343.344.345.346.347.348.349.350.351.353.352.354.356.355.357.358.359.360.361.362.363.364.365.366.367.368.369.370.371.372.373.374.375.376.377.378.379.380.382.381.383.384.385.386.387.388.389.390.391.392.394.395.393.396.397.398.399.400.401.402.403.404.405.406.407.409.408.410.411.412.413.414.415.416.417.418.420.419.421.422.423.425.426.424.427.428.429.430.432.431.433.434.435.436.437.438.439.440.441.442.443.444.445.446.447.448.449.450.451.452.453.455.454.457.456.458.459.460.461.462.463.464.465.466.467.468.469.470.471.472.473.474.475.476.477.478.479.480.481.482.483.484.485.486.487.488.489.490.491.492.493.494.495.496.497.498.499.500.521.523.522.524.525.526.528.527.529.530.531.532.533.534.535.536.537.538.539.540.542.544.543.541.545.546.548.547.549.551.550.553.552.555.554.557.556.559.558.560.561.562.563.564.565.566.567.568.569.570.571.572.573.574.575.576.577.578.579.580.581.582.583.584.585.586.587.588.589.590.591.592.593.594.595.596.597.598.599.600.601.602.603.604.605.606.607.608.609.610.611.612.613.614.615.616.617.618.619.620.621.622.623.624.625.626.627.628.629.630.631.632.633.634.635.636.637.638.639.640.641.642.643.644.645.646.647.648.649.650.651.652.653.654.655.656.657.658.659.660.661.662.663.664.665.666.667.668.669.670.671.672.673.675.674.676.677.678.679.680.701.702.704.703.705.706.707.708.709.711.710.712.713.714.715.716.717.718.719.720.723.722.721.724.725.727.726.728.729.730.731.732.733.734.735.737.736.738.739.741.740.742.744.743.746.747.745.748.749.750.751.752.753.754.756.755.757.758.759.761.760.762.763.764.765.766.767.768.769.770.771.772.773.774.775.776.777.778.780.779.781.782.783.784.785.786.787.788.789.790.791.792.793.794.795.797.796.798.799.800.801.802.803.804.805.806.807.808.809.810.811.812.813.814.815.816.817.818.819.820.821.822.823.825.824.826.827.828.829.830.831.832.833.834.835.836.837.838.839.840.841.842.843.844.845.846.847.848.849.850.851.852.853.854.855.856.857.858.859.860.882.881.884.883.885.886.888.887.890.889.891.892.893.894.895.896.897.898.899.901.900.902.903.904.905.906.907.908.909.910.911.913.912.914.915.916.917.918.919.920.921.922.923.924.925.926.928.927.929.930.931.932.933.934.935.936.937.939.938.940.941.942.943.944.945.946.947.948.949.950.951.952.953.954.955.956.957.958.959.961.960.962.963.964.965.966.967.968.969.970.971.972.973.974.975.976.977.978.979.980.981.982.983.984.985.986.987.988.989.990.991.992.993.994.995.996.997.998.999.1000.1001.1002.1003.1004.1005.1006.1008.1007.1009.1010.1011.1012.1014.1013.1015.1016.1017.1018.1019.1020.1021.1022.1023.1024.1025.1026.1027.1028.1029.1030.1031.1032.1033.1034.1035.1036.1037.1038.1039.1040.1061.1062.1063.1065.1064.1066.1069.1067.1068.1070.1071.1072.1073.1074.1075.1076.1077.1078.1079.1080.1082.1081.1084.1083.1085.1086.1087.1088.1089.1090.1091.1093.1092.1094.1095.1097.1096.1098.1099.1100.1101.1102.1103.1104.1105.1106.1107.1109.1108.1110.1111.1112.1113.1114.1115.1117.1116.1118.1119.1120.1121.1122.1123.1124.1125.1126.1127.1128.1129.1130.1131.1132.1133.1134.1135.1136.1137.1138.1139.1140.1141.1142.1143.1144.1145.1146.1147.1148.1149.1150.1151.1152.1153.1154.1155.1156.1157.1158.1159.1160.1161.1162.1163.1164.1165.1166.1167.1168.1169.1170.1172.1171.1173.1174.1175.1176.1177.1178.1179.1180.1181.1182.1183.1184.1185.1186.1187.1188.1189.1190.1191.1192.1193.1194.1195.1196.1197.1198.1199.1201.1200.1202.1203.1204.1205.1207.1206.1208.1209.1210.1211.1212.1213.1214.1215.1216.1217.1218.1219.1220.1241.1242.1244.1243.1245.1246.1247.1248.1249.1251.1250.1252.1253.1254.1255.1256.1257.1258.1259.1260.1261.1262.1263.1264.1265.1266.1267.1269.1268.1270.1272.1271.1274.1273.1275.1276.1277.1278.1279.1280.1281.1283.1282.1284.1285.1287.1286.1288.1290.1289.1291.1292.1293.1294.1295.1296.1297.1299.1298.1300.1301.1302.1303.1304.1305.1306.1307.1308.1309.1310.1311.1312.1313.1315.1314.1316.1317.1318.1319.1320.1321.1322.1323.1324.1325.1326.1327.1328.1329.1330.1331.1332.1333.1335.1334.1336.1337.1338.1339.1340.1341.1342.1343.1344.1345.1346.1347.1348.1349.1350.1351.1352.1353.1354.1355.1356.1357.1358.1360.1361.1359.1362.1364.1363.1365.1366.1367.1370.1369.1368.1371.1372.1373.1375.1374.1376.1377.1378.1379.1380.1381.1382.1383.1384.1385.1386.1387.1388.1389.1390.1391.1392.1393.1394.1395.1396.1397.1398.1400.1401.1419.1422.1423.1424.1426.1425.1427.1428.1429.1431.1430.1432.1434.1435.1433.1437.1436.1438.1440.1439.1441.1447.1442.1443.1444.1445.1446.1448.1449.1450.1452.1453.1451.1454.1455.1456.1457.1459.1458.1461.1460.1462.1463.1464.1465.1466.1467.1468.1469.1470.1471.1472.1473.1474.1475.1476.1477.1478.1479.1480.1481.1482.1483.1484.1486.1485.1487.1488.1489.1490.1491.1492.1493.1494.1495.1496.1498.1497.1499.1500.1501.1502.1503.1504.1505.1506.1507.1508.1509.1510.1511.1512.1513.1514.1515.1516.1517.1519.1518.1520.1521.1522.1523.1524.1525.1526.1527.1528.1529.1530.1531.1532.1533.1534.1535.1536.1537.1538.1539.1540.1541.1542.1543.1544.1545.1547.1546.1548.1549.1550.1551.1553.1552.1554.1555.1556.1557.1558.1559.1560.1561.1562.1563.1564.1565.1566.1567.1568.1569.1570.1571.1572.1573.1574.1575.1576.1577.1578.1579.1581.1600.1602.1603.1604.1605.1607.1606.1608.1609.1610.1612.1611.1613.1614.1616.1615.1617.1618.1619.1622.1621.1620.1623.1624.1625.1626.1627.1628.1629.1630.1631.1632.1633.1635.1634.1636.1637.1638.1639.1640.1641.1642.1643.1644.1646.1645.1647.1648.1650.1649.1652.1651.1653.1654.1655.1656.1657.1658.1659.1660.1661.1663.1662.1664.1665.1666.1667.1668.1669.1670.1671.1672.1673.1674.1675.1676.1677.1678.1679.1680.1681.1682.1683.1685.1684.1686.1687.1688.1689.1691.1690.1692.1693.1694.1695.1696.1698.1697.1699.1700.1701.1702.1703.1704.1705.1706.1707.1708.1709.1710.1711.1713.1712.1714.1715.1717.1716.1718.1719.1720.1721.1722.1723.1724.1725.1726.1727.1728.1729.1730.1731.1732.1733.1734.1735.1736.1737.1738.1739.1740.1741.1742.1743.1744.1745.1746.1747.1748.1749.1751.1750.1752.1753.1754.1755.1756.1757.1758.1759.1762.1780.1781.1784.1785.1783.1787.1788.1786.1789.1790.1791.1792.1794.1793.1795.1796.1799.1797.1800.1798. +Frame 0, used 0x Frame 1, used 0x Frame 2, used 0x +Frame 3, used 438x Frame 4, used 435x Frame 5, used 429x +Frame 6, used 420x Frame 7, used 414x Frame 8, used 407x +Frame 9, used 396x Frame 10, used 391x Frame 11, used 386x +Frame 12, used 374x Frame 13, used 372x Frame 14, used 367x +Frame 15, used 361x Frame 16, used 353x Frame 17, used 345x +Frame 18, used 342x Frame 19, used 335x Frame 20, used 330x +Frame 21, used 329x Frame 22, used 325x Frame 23, used 319x +Frame 24, used 271x Frame 25, used 262x Frame 26, used 255x +Frame 27, used 141x Frame 28, used 108x Frame 29, used 95x +********** Test Done ********** + +********** Thread Tester ********** +3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.2.22.20.30.31.24.21.23.25.26.32.27.33.39.40.41.28.29.35.34.36.42.44.48.49.50.37.51.38.45.46.52.55.57.43.58.60.53.61.62.56.63.65.67.68.47.70.71.64.72.73.74.69.54.77.78.59.81.82.75.83.76.85.79.86.89.91.92.84.93.66.87.80.94.96.98.101.102.103.95.88.104.97.99.105.108.110.111.112.113.100.114.107.115.109.117.119.120.122.106.116.124.125.90.126.129.130.131.132.133.127.134.135.128.136.138.139.141.142.143.144.123.145.140.146.148.149.151.153.152.154.118.147.156.121.159.160.161.162.163.157.164.150.137.166.169.170.171.172.158.174.167.175.155.176.178.173.181.182.168.183.184.179.185.165.187.177.188.189.186.180.190.192.191.193.195.196.197.194.198.199.200.201. +********** Test Done ********** + +********** Process Tester ********** +5.6.7.8.9.10.2.3.11.4.23.22.24.19.21.12.13.14.25.26.29.28.15.16.17.30.18.20.34.35.38.39.32.40.31.27.41.33.43.44.48.49.50.42.36.51.37.45.52.54.56.58.59.60.61.46.47.53.62.57.67.68.69.70.71.55.63.64.65.73.76.78.79.72.81.66.74.82.75.83.86.88.90.91.77.84.92.85.93.80.95.97.99.101.87.102.94.89.103.96.98.100.108.112.104.113.105.114.106.107.109.115.110.122.123.124.116.111.117.118.119.125.120.132.134.121.126.127.135.130.128.136.129.139.133.131.145.138.137.142.140.143.146.141.155.147.148.144.149.152.150.151.153.156.157.158.154.162.159.160.161.163.166.164.167.165.168.172.170.169.180.173.176.171.174.181.175.177.178.179.188.189.182.185.183.190.186.184.187.191.193.194.192.195.196.197.198.199.200.201. +********** Test Done ********** + +********** OpenFile Tester ********** +3.4.5.2.8.6.9.7.11.10.13.12.14.16.15.17.18.19.21.20.22.23.24.26.25.27.28.29.31.30.32.33.34.36.35.37.39.38.40.41.42.43.45.44.47.46.49.48.50.52.51.53.55.54.56.58.57.59.60.62.61.63.65.66.64.67.69.68.70.71.72.74.73.76.77.75.78.80.79.81.82.83.85.84.86.87.88.90.89.91.92.94.95.93.97.96.98.99.100.102.101.103.105.104.106.108.107.109.111.110.113.112.115.114.116.117.118.119.120.121.122.123.124.125.126.127.128.129.130.131.132.133.134.135.136.138.137.139.140.141.142.143.144.145.146.147.148.149.150.152.151.153.154.155.156.157.158.159.160.161.162.163.164.166.165.167.168.169.170.172.171.173.174.176.175.177.178.180.179.181.183.182.185.184.186.187.188.189.190.191.192.194.193.195.197.196.198.199.200.201. +********** Test Done ********** + +********** FileControlBlock Tester ********** +2.3.4.5.6.7.8.9.10.2!W1.3!W2.5!W3.4!W4.6!W5.7!W6.8!W7.9!W8.10!F12.2!12.3!W1.12.5!W2.12.W3.12.12.12.12.12.10!4!W4.6!W5.7!9!W6.W7.8!W8.F12.12.12.20.12.12.12.20.12.12.12.20.20.20.20.20.20.20. +********** Test Done ********** + +All Assignment 3 tests done. + +I call this a "heisenbug" as I never know when it will strike and stop ToyOS from running. |