Commit e26e9d0
committed
Address review round 2: checkpoint reject, thread-safe pid/ports, drop dead binding
- checkpoint(): a popen() Process owns the handle, so checkpoint (SIGSTOP +
ptrace freeze) now rejects with _reject_if_popen() instead of reaching
past the Process for a handle that is None on the sandbox — consistent
with wait/pause/resume/kill.
- Sandbox.pid / Sandbox.ports: delegate to the Process (Process.pid is
lock-guarded + cached; new Process.ports() reads the handle under the
lock and reports {} while a wait() holds it). Previously both did a raw
FFI read of the Process's handle via _live_handle(), racing a concurrent
wait() free. Extracted _read_port_mappings() shared by both.
- Removed the now-unused sandlock_handle_kill ctypes binding: Process.kill
signals the group by pid (killpg), so the FFI kill has no caller.
Tests: checkpoint() rejects a popen Process; Sandbox.pid/ports delegate to
the live Process and return None/{} after it is reaped.1 parent 3ac2df6 commit e26e9d0
3 files changed
Lines changed: 62 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | 336 | | |
342 | 337 | | |
343 | 338 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
560 | 560 | | |
561 | 561 | | |
562 | 562 | | |
563 | | - | |
564 | | - | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
565 | 569 | | |
566 | 570 | | |
567 | | - | |
| 571 | + | |
568 | 572 | | |
569 | 573 | | |
570 | 574 | | |
| |||
1207 | 1211 | | |
1208 | 1212 | | |
1209 | 1213 | | |
1210 | | - | |
1211 | | - | |
1212 | | - | |
1213 | | - | |
1214 | | - | |
1215 | | - | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
1216 | 1220 | | |
1217 | | - | |
1218 | | - | |
1219 | | - | |
1220 | | - | |
1221 | | - | |
1222 | | - | |
| 1221 | + | |
1223 | 1222 | | |
1224 | 1223 | | |
1225 | 1224 | | |
| |||
1244 | 1243 | | |
1245 | 1244 | | |
1246 | 1245 | | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
1247 | 1250 | | |
1248 | 1251 | | |
1249 | 1252 | | |
| |||
1255 | 1258 | | |
1256 | 1259 | | |
1257 | 1260 | | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
1258 | 1277 | | |
1259 | 1278 | | |
1260 | 1279 | | |
| |||
1394 | 1413 | | |
1395 | 1414 | | |
1396 | 1415 | | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
1397 | 1425 | | |
1398 | 1426 | | |
1399 | 1427 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
280 | | - | |
| 280 | + | |
| 281 | + | |
281 | 282 | | |
282 | 283 | | |
283 | 284 | | |
| |||
287 | 288 | | |
288 | 289 | | |
289 | 290 | | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
290 | 308 | | |
291 | 309 | | |
292 | 310 | | |
| |||
0 commit comments