Skip to content

fix crash due to mutexes init error & add threads names for debug#131

Merged
ca333 merged 3 commits intoKomodoPlatform:devfrom
DeckerSU:patch-mutex
May 13, 2020
Merged

fix crash due to mutexes init error & add threads names for debug#131
ca333 merged 3 commits intoKomodoPlatform:devfrom
DeckerSU:patch-mutex

Conversation

@DeckerSU
Copy link
Copy Markdown
Contributor

@tonymorony
this PR should be tested once again before merge, it's related to iguana crash like this:

iguana: ../nptl/pthread_mutex_lock.c:433: __pthread_mutex_lock_full: Assertion `INTERNAL_SYSCALL_ERRNO (e, __err) != ESRCH || !robust' failed.

also, it adding thread names for each iguana thread. example:

(gdb) info threads
  Id   Target Id         Frame 
  1    Thread 0x7f78dcd08740 (LWP 34530) "iguana" 0x00007f78db0fc30d in nanosleep ()
    at ../sysdeps/unix/syscall-template.S:84
  2    Thread 0x7f78d65f5700 (LWP 34533) "iguana_rpcloop" 0x00007f78dbb8b76d in accept ()
    at ../sysdeps/unix/syscall-template.S:84
* 3    Thread 0x7f78d5df4700 (LWP 34534) "dpow_loop" 0x00007f78db065428 in __GI_raise (sig=sig@entry=6)
    at ../sysdeps/unix/sysv/linux/raise.c:54
  4    Thread 0x7f78d55f3700 (LWP 34535) "dpow_psockloop" 0x00007f78db0fc30d in nanosleep ()
    at ../sysdeps/unix/syscall-template.S:84
  5    Thread 0x7f78d4ad1700 (LWP 34540) "iguana_rpcloop" 0x00007f78db137a13 in epoll_wait ()
    at ../sysdeps/unix/syscall-template.S:84
  6    Thread 0x7f77a219e700 (LWP 34731) "iguana_rpcloop" 0x00007f78db0fc30d in nanosleep ()
    at ../sysdeps/unix/syscall-template.S:84
  18   Thread 0x7f77588bb700 (LWP 34877) "dpowsm_ETOMIC" 0x00007f78db0fc30d in nanosleep ()
    at ../sysdeps/unix/syscall-template.S:84
  20   Thread 0x7f77437fe700 (LWP 34879) "dpowsm_BOTS" 0x00007f78db0fc30d in nanosleep ()
    at ../sysdeps/unix/syscall-template.S:84
  21   Thread 0x7f7742ffd700 (LWP 34880) "dpowsm_MORTY" 0x00007f78db0fc30d in nanosleep ()
    at ../sysdeps/unix/syscall-template.S:84
  23   Thread 0x7f7741ffb700 (LWP 34884) "dpowsm_DEX" 0x00007f78db0fc30d in nanosleep ()
    at ../sysdeps/unix/syscall-template.S:84

kolobus and others added 3 commits April 23, 2020 02:59
Since LIBC 2.28 fmul exists in math.h, without this commit
we will have following errors during build with _GNU_SOURCE
define:

In file included from OS_portable.h:80,
                 from OS_nonportable.c:34:
../includes/curve25519.h:43:9: error: conflicting types for 'fmul'
 bits320 fmul(const bits320 in2,const bits320 in);
         ^~~~
- myinfo->notarymutex and myinfo->dpowmutex seems sometimes
initialised not correctly. as a result we had following
debug messages:

[ Decker ] ./dpow/dpow_network.c.1480 (dpow_addnotary): ip = 149.56.30.227
[ Decker ] ./dpow/dpow_network.c.1481 (dpow_addnotary): err_unlock = 22
[ Decker ] ./dpow/dpow_network.c.1418 (dpow_addnotary): ip = x.x.x.x
[ Decker ] ./dpow/dpow_network.c.1419 (dpow_addnotary): err_lock = 22
[ Decker ] ./dpow/dpow_network.c.1480 (dpow_addnotary): ip = x.x.x.x
[ Decker ] ./dpow/dpow_network.c.1481 (dpow_addnotary): err_unlock = 22
[ Decker ] ./dpow/dpow_network.c.1418 (dpow_addnotary): ip = 149.56.30.227

where 22 means [EINVAL]
The value specified by mutex does not refer to an initialized mutex object.

And finally it leads to app crash:

iguana: ../nptl/pthread_mutex_lock.c:433: __pthread_mutex_lock_full: Assertion `INTERNAL_SYSCALL_ERRNO (e, __err) != ESRCH || !robust' failed.

So, we changed these mutexes to:

myinfo->dpowmutex -> def_dpowmutex
myinfo->notarymutex -> def_notarymutex

with initialisation with PTHREAD_MUTEX_INITIALIZER .
@ca333 ca333 requested a review from tonymorony May 13, 2020 14:39
@ca333 ca333 merged commit 2bea399 into KomodoPlatform:dev May 13, 2020
@imylomylo
Copy link
Copy Markdown
Contributor

seems to be working for last 4 hours, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants