class: title # Worm Lab ## CSC 213 – October 8, 2025 --- # Agenda for Today 1. Department Events 2. Upcoming Work 4. Worm Lab 5. Wrap Up --- # Department Events ## Rosenfield Program: Marisa Kabas .indent[ Wednesday, October 8th at 4pm in HSSC A1231 ] ## CS Extra: Finding Internships and Entry Level Jobs .indent[ Thursday, October 9th at 4:15pm in Noyce 3821 Refreshments at 4pm in the CS Commons ] *To receive 0.25% extra credit, send an email to let me know you attended no more than 48 hours after the event.* --- class: section, blue # Upcoming Work --- # Lab: Malloc **Due:** Wednesday, October 8th by 11:59pm **Late Deadline:** Wednesday, October 15th by 11:59pm ## Questions **Why does my allocator make programs crash on startup?** Almost all programs make one very large allocation during startup. You'll need to handle requests for more than 2048 bytes before you can run test programs, even inside gdb. **What should we do to debug if the allocator makes programs crash during startup?** Your best bet is to add logging. It helps to know what sizes are being requested, what your allocator is doing, and the resulting pointer that you return. You can use `snprintf` and `log_message` to do this safely: ```c char buffer[256]; snprintf(buffer, 256, "xxmalloc(%d) called\n", size); log_message(buffer); ``` --- class: section, blue # Lab --- class: section, gray # Demo: Working with `ucontext_t` --- class: section, green # Lab Time --- class: section, blue # Wrap Up --- # Reminders ## Lab The malloc lab is due tonight for full credit, or next week with the late deduction. ## Assignment No assignment this week. ## Need Help? I have open office hours from 1:15–2pm today, or drop in to the mentor session from 7:30–8:30pm this evening. ## Reading *No reading for the next class.*