==69556== Helgrind, a thread error detector ==69556== Copyright (C) 2007-2017, and GNU GPL'd, by OpenWorks LLP et al. ==69556== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info ==69556== Command: ./philo 3 610 200 100 10 ==69556== ==69556== ---Thread-Announcement------------------------------------------ ==69556== ==69556== Thread #3 was created ==69556== at 0x49AE282: clone (clone.S:71) ==69556== by 0x48712EB: create_thread (createthread.c:101) ==69556== by 0x4872E0F: pthread_create@@GLIBC_2.2.5 (pthread_create.c:817) ==69556== by 0x4842917: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) ==69556== by 0x40180E: launch (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4011FD: main (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== ==69556== ---------------------------------------------------------------- ==69556== ==69556== Thread #3: lock order "0x4A812D8 before 0x4A811E8" violated ==69556== ==69556== Observed (incorrect) order is: acquisition of lock at 0x4A811E8 ==69556== at 0x483FEDF: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) ==69556== by 0x401B7C: eat (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x401AC3: philo_exec (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4842B1A: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) ==69556== by 0x4872608: start_thread (pthread_create.c:477) ==69556== by 0x49AE292: clone (clone.S:95) ==69556== ==69556== followed by a later acquisition of lock at 0x4A812D8 ==69556== at 0x483FEDF: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) ==69556== by 0x401BE3: eat (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x401AC3: philo_exec (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4842B1A: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) ==69556== by 0x4872608: start_thread (pthread_create.c:477) ==69556== by 0x49AE292: clone (clone.S:95) ==69556== ==69556== Lock at 0x4A812D8 was first observed ==69556== at 0x4843D9D: pthread_mutex_init (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) ==69556== by 0x40168D: lst_add_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4015AD: init_chain_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4012ED: init (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4011D5: main (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== Address 0x4a812d8 is 24 bytes inside a block of size 176 alloc'd ==69556== at 0x483C893: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) ==69556== by 0x40163C: lst_add_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4015AD: init_chain_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4012ED: init (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4011D5: main (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== Block was alloc'd by thread #1 ==69556== ==69556== Lock at 0x4A811E8 was first observed ==69556== at 0x4843D9D: pthread_mutex_init (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) ==69556== by 0x40168D: lst_add_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4015AD: init_chain_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4012ED: init (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4011D5: main (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== Address 0x4a811e8 is 24 bytes inside a block of size 176 alloc'd ==69556== at 0x483C893: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) ==69556== by 0x40163C: lst_add_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4015AD: init_chain_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4012ED: init (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4011D5: main (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== Block was alloc'd by thread #1 ==69556== ==69556== ==69556== ---Thread-Announcement------------------------------------------ ==69556== ==69556== Thread #2 was created ==69556== at 0x49AE282: clone (clone.S:71) ==69556== by 0x48712EB: create_thread (createthread.c:101) ==69556== by 0x4872E0F: pthread_create@@GLIBC_2.2.5 (pthread_create.c:817) ==69556== by 0x4842917: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) ==69556== by 0x40180E: launch (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4011FD: main (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== ==69556== ---------------------------------------------------------------- ==69556== ==69556== Thread #2: lock order "0x4A811E8 before 0x4A813C8" violated ==69556== ==69556== Observed (incorrect) order is: acquisition of lock at 0x4A813C8 ==69556== at 0x483FEDF: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) ==69556== by 0x401B7C: eat (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x401AC3: philo_exec (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4842B1A: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) ==69556== by 0x4872608: start_thread (pthread_create.c:477) ==69556== by 0x49AE292: clone (clone.S:95) ==69556== ==69556== followed by a later acquisition of lock at 0x4A811E8 ==69556== at 0x483FEDF: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) ==69556== by 0x401BE3: eat (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x401AC3: philo_exec (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4842B1A: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) ==69556== by 0x4872608: start_thread (pthread_create.c:477) ==69556== by 0x49AE292: clone (clone.S:95) ==69556== ==69556== Lock at 0x4A811E8 was first observed ==69556== at 0x4843D9D: pthread_mutex_init (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) ==69556== by 0x40168D: lst_add_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4015AD: init_chain_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4012ED: init (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4011D5: main (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== Address 0x4a811e8 is 24 bytes inside a block of size 176 alloc'd ==69556== at 0x483C893: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) ==69556== by 0x40163C: lst_add_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4015AD: init_chain_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4012ED: init (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4011D5: main (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== Block was alloc'd by thread #1 ==69556== ==69556== Lock at 0x4A813C8 was first observed ==69556== at 0x4843D9D: pthread_mutex_init (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) ==69556== by 0x40168D: lst_add_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4015AD: init_chain_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4012ED: init (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4011D5: main (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== Address 0x4a813c8 is 24 bytes inside a block of size 176 alloc'd ==69556== at 0x483C893: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) ==69556== by 0x40163C: lst_add_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4015AD: init_chain_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4012ED: init (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4011D5: main (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== Block was alloc'd by thread #1 ==69556== ==69556== ==69556== ---Thread-Announcement------------------------------------------ ==69556== ==69556== Thread #4 was created ==69556== at 0x49AE282: clone (clone.S:71) ==69556== by 0x48712EB: create_thread (createthread.c:101) ==69556== by 0x4872E0F: pthread_create@@GLIBC_2.2.5 (pthread_create.c:817) ==69556== by 0x4842917: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) ==69556== by 0x40180E: launch (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4011FD: main (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== ==69556== ---------------------------------------------------------------- ==69556== ==69556== Thread #4: lock order "0x4A813C8 before 0x4A812D8" violated ==69556== ==69556== Observed (incorrect) order is: acquisition of lock at 0x4A812D8 ==69556== at 0x483FEDF: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) ==69556== by 0x401B7C: eat (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x401AC3: philo_exec (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4842B1A: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) ==69556== by 0x4872608: start_thread (pthread_create.c:477) ==69556== by 0x49AE292: clone (clone.S:95) ==69556== ==69556== followed by a later acquisition of lock at 0x4A813C8 ==69556== at 0x483FEDF: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) ==69556== by 0x401BE3: eat (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x401AC3: philo_exec (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4842B1A: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) ==69556== by 0x4872608: start_thread (pthread_create.c:477) ==69556== by 0x49AE292: clone (clone.S:95) ==69556== ==69556== Lock at 0x4A813C8 was first observed ==69556== at 0x4843D9D: pthread_mutex_init (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) ==69556== by 0x40168D: lst_add_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4015AD: init_chain_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4012ED: init (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4011D5: main (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== Address 0x4a813c8 is 24 bytes inside a block of size 176 alloc'd ==69556== at 0x483C893: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) ==69556== by 0x40163C: lst_add_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4015AD: init_chain_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4012ED: init (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4011D5: main (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== Block was alloc'd by thread #1 ==69556== ==69556== Lock at 0x4A812D8 was first observed ==69556== at 0x4843D9D: pthread_mutex_init (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) ==69556== by 0x40168D: lst_add_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4015AD: init_chain_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4012ED: init (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4011D5: main (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== Address 0x4a812d8 is 24 bytes inside a block of size 176 alloc'd ==69556== at 0x483C893: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) ==69556== by 0x40163C: lst_add_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4015AD: init_chain_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4012ED: init (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== by 0x4011D5: main (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) ==69556== Block was alloc'd by thread #1 ==69556== ==69556== 1 3 has taken a fork 11 3 has taken a fork 12 3 is eating 26 2 has taken a fork 215 3 is sleeping 216 1 has taken a fork 217 2 has taken a fork 217 2 is eating 316 3 is thinking 419 3 has taken a fork 419 1 has taken a fork 420 1 is eating 420 2 is sleeping 521 2 is thinking 620 2 has taken a fork 621 1 is sleeping 623 3 has taken a fork 623 3 is eating 721 1 is thinking 824 1 has taken a fork 824 3 is sleeping 825 2 has taken a fork 826 2 is eating 925 3 is thinking 1025 2 is sleeping 1026 3 has taken a fork 1026 1 has taken a fork 1027 1 is eating 1126 2 is thinking 1227 2 has taken a fork 1228 3 has taken a fork 1228 3 is eating 1229 1 is sleeping 1329 1 is thinking 1430 1 has taken a fork 1430 2 has taken a fork 1431 2 is eating 1435 3 is sleeping 1535 3 is thinking 1631 3 has taken a fork 1632 1 has taken a fork 1632 1 is eating 1633 2 is sleeping 1733 2 is thinking 1833 2 has taken a fork 1833 1 is sleeping 1834 3 has taken a fork 1834 3 is eating 1934 1 is thinking 2034 1 has taken a fork 2034 3 is sleeping 2035 2 has taken a fork 2035 2 is eating 2134 3 is thinking 2236 3 has taken a fork 2236 1 has taken a fork 2237 1 is eating 2237 2 is sleeping 2337 2 is thinking 2439 2 has taken a fork 2440 3 has taken a fork 2440 3 is eating 2440 1 is sleeping 2541 1 is thinking 2641 1 has taken a fork 2641 2 has taken a fork 2642 2 is eating 2642 3 is sleeping 2742 3 is thinking 2843 1 has taken a fork 2843 1 is eating 2843 3 has taken a fork 2844 2 is sleeping 2944 2 is thinking 3042 2 has taken a fork 3043 3 has taken a fork 3043 3 is eating 3044 1 is sleeping 3144 1 is thinking 3244 1 has taken a fork 3245 3 is sleeping 3245 2 has taken a fork 3246 2 is eating 3345 3 is thinking 3447 3 has taken a fork 3448 1 has taken a fork 3448 1 is eating 3450 2 is sleeping 3550 2 is thinking 3649 2 has taken a fork 3649 3 has taken a fork 3649 3 is eating 3650 1 is sleeping 3751 1 is thinking 3850 3 is sleeping 3851 2 has taken a fork 3851 2 is eating 3852 1 has taken a fork 3951 3 is thinking 4051 3 has taken a fork 4052 1 has taken a fork 4053 1 is eating 4053 2 is sleeping 4154 2 is thinking 4253 2 has taken a fork 4254 3 has taken a fork 4254 3 is eating 4255 1 is sleeping 4355 1 is thinking 4456 1 has taken a fork 4456 3 is sleeping 4456 2 has taken a fork 4457 2 is eating 4556 3 is thinking 4658 3 has taken a fork 4658 2 is sleeping 4658 1 has taken a fork 4658 1 is eating 4758 2 is thinking 4859 2 has taken a fork 4859 3 has taken a fork 4859 3 is eating 4860 1 is sleeping 4961 1 is thinking 5059 1 has taken a fork 5059 2 has taken a fork 5060 2 is eating 5061 3 is sleeping 5161 3 is thinking 5260 3 has taken a fork 5261 2 is sleeping 5262 1 has taken a fork 5262 1 is eating 5361 2 is thinking 5464 1 is sleeping 5465 3 has taken a fork 5465 3 is eating 5466 2 has taken a fork 5565 1 is thinking 5666 1 has taken a fork 5666 2 has taken a fork 5666 2 is eating 5667 3 is sleeping ==69556== ==69556== Use --history-level=approx or =none to gain increased speed, at ==69556== the cost of reduced accuracy of conflicting-access information ==69556== For lists of detected and suppressed errors, rerun with: -s ==69556== ERROR SUMMARY: 28 errors from 3 contexts (suppressed: 60416 from 121)