arseniycodes / arseniycodes/socrates

Potential death time parsing bug

Open
#9 3 comments 0 reactions 0 assignees View on GitHub
bug good first issue help wanted
Dominant language
Python
Stars
70
Forks
4
PR merge metrics
No merged PRs in 30d

Description

I had this error once with philo_one:

```
DEATH TIMING

[2 MS] [3 MS] [2 MS] [2 MS] Traceback (most recent call last):
File "./socrates.py", line 281, in
exit(socrates(args.path, args.philo))
File "./socrates.py", line 242, in socrates
test_program(f"{bin_path}/philo_one/philo_one")
File "./socrates.py", line 157, in test_program
if run_starvation_measures(binary) is False:
File "./socrates.py", line 131, in run_starvation_measures
measure_starvation_timing(binary, results)
File "./socrates.py", line 108, in measure_starvation_timing
death_time = int(last_line[:separator_index].strip("\0"))
ValueError: invalid literal for int() with base 10: 'dyld:'
```

When I run the test on my own I have the following output:

```
❯ ./philo_one 3 310 200 100 | cat -e
0 2 has taken fork$
0 2 has taken fork$
0 2 is eating$
2 3 has taken fork$
200 2 is sleeping$
200 3 has taken fork$
200 3 is eating$
200 1 has taken fork$
300 2 is thinking$
311 2 died$
```

I never had this error before.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in socrates.py at measure_starvation_timing, especially the parsing at line 108, and reproduce the reported run with ./philo_one 3 310 200 100. Compare the expected death-output line with the traceback showing dyld: and determine the intended behavior for that input; the issue does not specify an expected fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.