{"push_id":694924314,"size":10,"distinct_size":10,"ref":"refs/heads/enhancement/thread-safety","head":"6be06f0c65adf523c6e3959636da875c16c6eb13","before":"a361f523b84ee8f6c0dc30b560428e62af0820c7","commits":[{"sha":"ad3ac85a5438f4ffd843af2c1bf2446ac8e67b5f","author":{"email":"877aa88ea7852ca3a9489ba565345c1e8d15febb@a2o.si","name":"Bostjan Skufca"},"message":"test/threads: bugfix, invalid library path","distinct":true,"url":"https://api.github.com/repos/bostjan/snoopy/commits/ad3ac85a5438f4ffd843af2c1bf2446ac8e67b5f"},{"sha":"d4894b2f7a44dfb6a96488d1d90d76fe84edc440","author":{"email":"877aa88ea7852ca3a9489ba565345c1e8d15febb@a2o.si","name":"Bostjan Skufca"},"message":"TSRM: remove stale function comment","distinct":true,"url":"https://api.github.com/repos/bostjan/snoopy/commits/d4894b2f7a44dfb6a96488d1d90d76fe84edc440"},{"sha":"f8f7bfc9f629821be6123ce0b86a6106b0c1425f","author":{"email":"877aa88ea7852ca3a9489ba565345c1e8d15febb@a2o.si","name":"Bostjan Skufca"},"message":"TSRM: Remove dynamic mutex initialization - replace with static.\n\nReason:\nIt causes segfaults as it is attempted by multiple threads.\n\nUsing only mutex_lock() seems to work fine. It seems to work with or without\nstatic initializers, but we add it for the sake of completeness.","distinct":true,"url":"https://api.github.com/repos/bostjan/snoopy/commits/f8f7bfc9f629821be6123ce0b86a6106b0c1425f"},{"sha":"e818a425177fc01782728165d80bdebc22958bd7","author":{"email":"877aa88ea7852ca3a9489ba565345c1e8d15febb@a2o.si","name":"Bostjan Skufca"},"message":"TSRM: Wrap with mutex also all LIST_FOREACH blocks\n\nReason:\nIf nodes are added/removed by one thread while other thread is FOREACHing\nthem, there might be a chance thatn ListNode->next points to invalid location,\nand dereferencing it causes segmentation fault.","distinct":true,"url":"https://api.github.com/repos/bostjan/snoopy/commits/e818a425177fc01782728165d80bdebc22958bd7"},{"sha":"1557aad50393d0fe52b55150e5e36dfdbedf2bdf","author":{"email":"877aa88ea7852ca3a9489ba565345c1e8d15febb@a2o.si","name":"Bostjan Skufca"},"message":"TSRM: when counting threads, move check for uninitialized repo inside mutex block\n\nReason:\nOne thread might uninitialize repo in between and then accessing\n->count member causes segmentation fault.\n\nTHIS IS A KNOWINGLY BROKEN COMMIT!\n\nMoving check into mutex block would be a normal thing to do, but doing so\ncauses a deadlock for which I can not figure out the source/condition ATM.\n\nNext commit will fix this issue with a workaround, which was stumbled upon\naccidentally and actually I do not know why it works. Will look into it.","distinct":true,"url":"https://api.github.com/repos/bostjan/snoopy/commits/1557aad50393d0fe52b55150e5e36dfdbedf2bdf"},{"sha":"165a2f48213c87cc294d7bba122493f8a7e675ca","author":{"email":"877aa88ea7852ca3a9489ba565345c1e8d15febb@a2o.si","name":"Bostjan Skufca"},"message":"Threading: add new test to repeatedly check for segmentation fault. Not included in test suite by default.\n\nReason for creating:\nThere were some threading issues with Snoopy (resolved in previous commit) which\nrequired multiple invocations to be triggered. It occured on every 30th invocation\non average (number determined manually, using \"feeling\" and \"memory\" meter).\n\nReasons for not including it in standard test suite:\nIt takes significant amount of time (10-30 seconds) compared to other\ntests (0.1-1 second). If threading issue is suspected, it might be\nrun manually to try to trigger and confirm it.","distinct":true,"url":"https://api.github.com/repos/bostjan/snoopy/commits/165a2f48213c87cc294d7bba122493f8a7e675ca"},{"sha":"f8b43a4e3608f4533fc66c5ac628580d04222460","author":{"email":"877aa88ea7852ca3a9489ba565345c1e8d15febb@a2o.si","name":"Bostjan Skufca"},"message":"TSRM: Switched static mutex initialization to pthread_once()+recursive mutex, swithed dynamic threadRepo list initialization to static.\n\nReason for pthread_once+recursive:\nIf recursive mutex is not supported, than attention must be paid to\nprevent accidental double locking. With recursive mutex, this worry\ngoes away. Additionally, we will only ever have 2 or max 3 levels of\nlocking here, so no real performance penalty.\n\nReason for static threadRepo init:\nBefore it was static, one might call getThreadCount() and then that\nfunction would need to check whether repo exist, do it with mutex,\nall this hassle for little benefit (spare 3 pointers which were\nmalloc()-ed when first thread initialized Snoopy).\nNow, threadRepo List structure is always present and ->count member\nis always of correct value. Mutex is still used thought, for the\nsake of consistency.","distinct":true,"url":"https://api.github.com/repos/bostjan/snoopy/commits/f8b43a4e3608f4533fc66c5ac628580d04222460"},{"sha":"8692c7a2ae8f549e7f3b2026f206640adb1fd96b","author":{"email":"877aa88ea7852ca3a9489ba565345c1e8d15febb@a2o.si","name":"Bostjan Skufca"},"message":"Test/threads/segfault: reenable test in test suite, faster; test now uses mutex for counting threads.\n\nAll output that was going on in loops was disabled, so threading implementation\nis tested under higher pressure - less output handling, faster it has to be doing\nthe thread management tasks (mutexes, etc).\n\nTest runs now in under a second so there is no reason to not enable it in general\ntest suite.\n\nAlso, bumped threads to 200 in test.","distinct":true,"url":"https://api.github.com/repos/bostjan/snoopy/commits/8692c7a2ae8f549e7f3b2026f206640adb1fd96b"},{"sha":"3523070df43e43c7bb713162a0a82bc0949ab9f0","author":{"email":"877aa88ea7852ca3a9489ba565345c1e8d15febb@a2o.si","name":"Bostjan Skufca"},"message":"Tests/bootstrap: print output on PASS if provided","distinct":true,"url":"https://api.github.com/repos/bostjan/snoopy/commits/3523070df43e43c7bb713162a0a82bc0949ab9f0"},{"sha":"6be06f0c65adf523c6e3959636da875c16c6eb13","author":{"email":"877aa88ea7852ca3a9489ba565345c1e8d15febb@a2o.si","name":"Bostjan Skufca"},"message":"lib/liblc/.../list.c: fix bug when pointers to list entries that were removed were not set to NULL\n\nFinally, this was the reason for all deadlocks in thread-safe Snoopy\nimplementation. When you look at the code, if you remove node from either\nlist start or end, the corresponding pointers at first (for prev node) or last\n(for next node) node were not set to null. This caused foreach to go into\ninfinite loop.\nThe list implementation is shit, if I judge it by this error. But, as it is\nFOSS, I guess we got what we paid for :)","distinct":true,"url":"https://api.github.com/repos/bostjan/snoopy/commits/6be06f0c65adf523c6e3959636da875c16c6eb13"}]}