Systemic crash on DEATH TIMING

Open Beginner friendly
#16 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
62/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
python
Domain
testing

Research direction

Start in philo/socrates/socrates.py, especially measure_starvation_timing at the traceback location around line 121. Reproduce the DEATH TIMING output and inspect how its timestamp is parsed; done means the starvation test handles the shown timestamp format without raising ValueError.

Written by the indexing model from the issue text.

Description

DEATH TIMING

0ms: philo 1 is thinking
0ms: philo 1 has taken a fork
0ms: philo 1 has taken a fork
0ms: philo 1 is eating
0ms: philo 3 is thinking
0ms: philo 3 has taken a fork
0ms: philo 2 is thinking
200ms: philo 1 is sleeping
200ms: philo 2 has taken a fork
200ms: philo 3 has taken a fork
200ms: philo 3 is eating
300ms: philo 1 is thinking
311ms: philo 1 died
Traceback (most recent call last):
  File "/home/maplepy/git/cc/philosophers/philo/socrates/socrates.py", line 302, in <module>
    exit(socrates(args.path, args.philo))
  File "/home/maplepy/git/cc/philosophers/philo/socrates/socrates.py", line 258, in socrates
    test_program(f"{bin_path}/philo/philo")
  File "/home/maplepy/git/cc/philosophers/philo/socrates/socrates.py", line 177, in test_program
    if run_starvation_measures(binary) is False:
  File "/home/maplepy/git/cc/philosophers/philo/socrates/socrates.py", line 151, in run_starvation_measures
    results.append(measure_starvation_timing(binary))
  File "/home/maplepy/git/cc/philosophers/philo/socrates/socrates.py", line 121, in measure_starvation_timing
    start_time = int(first_line[:separator_index])
ValueError: invalid literal for int() with base 10: '0ms:'
Dominant language
Python
Stars
70
Forks
4
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from arseniycodes/socrates

All issues in arseniycodes/socrates

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.