Bug 17894 - SIGABRT when running "mozroots --import"
Summary: SIGABRT when running "mozroots --import"
Status: RESOLVED INVALID
Alias: None
Product: Runtime
Classification: Mono
Component: General ()
Version: 3.2.x
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-02-19 17:07 UTC by Juraj Skripsky
Modified: 2014-04-04 12:02 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED INVALID

Description Juraj Skripsky 2014-02-19 17:07:08 UTC
Every time I'm running "mozroots --import", I get a SIGABRT and the stacktrace below.
I'm using Mono from master (04a08edc14f039dcee / Feb 19th) on Fedora 20 (x86_64).

(Setting the environment var MONO_DEBUG to "dont-free-domains" makes no difference.)


[js@quad mono-edge]$ mozroots --import
Mozilla Roots Importer - version 4.0.0.0
Download and import trusted root certificates from Mozilla's MXR.
Copyright 2002, 2003 Motus Technologies. Copyright 2004-2008 Novell. BSD licensed.

Downloading from 'http://mxr.mozilla.org/seamonkey/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1'...
Importing certificates into user store...
Import process completed.

Error destroying handle 0x40b mutex due to 16

Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Threading.InternalThread.Thread_free_internal (System.Threading.InternalThread,intptr) <0xffffffff>
  at System.Threading.InternalThread.Finalize () <0x0001b>
  at (wrapper runtime-invoke) object.runtime_invoke_virtual_void__this__ (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

	/usr/local/bin/mono() [0x4b68d8]
	/lib64/libpthread.so.0(+0xf750) [0x7fa901355750]
	/lib64/libc.so.6(gsignal+0x39) [0x7fa900fbcc39]
	/lib64/libc.so.6(abort+0x148) [0x7fa900fbe348]
	/usr/local/bin/mono() [0x6345f5]
	/usr/local/bin/mono() [0x634692]
	/usr/local/bin/mono() [0x608db8]
	/usr/local/bin/mono() [0x60a4a4]
	/usr/local/bin/mono() [0x5890e6]
	[0x40ef14fc]

Debug info from gdb:

Mono support loaded.
[New LWP 28271]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
0x00007fa9013520c9 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
  Id   Target Id         Frame 
  2    Thread 0x7fa8f8b30700 (LWP 28271) "mono" 0x00007fa901355309 in waitpid () from /lib64/libpthread.so.0
* 1    Thread 0x7fa901e727c0 (LWP 28270) "mono" 0x00007fa9013520c9 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0

Thread 2 (Thread 0x7fa8f8b30700 (LWP 28271)):
#0  0x00007fa901355309 in waitpid () from /lib64/libpthread.so.0
#1  0x00000000004b6960 in mono_handle_native_sigsegv (signal=<optimized out>, ctx=<optimized out>) at mini-exceptions.c:2299
#2  <signal handler called>
#3  0x00007fa900fbcc39 in raise () from /lib64/libc.so.6
#4  0x00007fa900fbe348 in abort () from /lib64/libc.so.6
#5  0x00000000006345f5 in monoeg_g_logv (log_domain=0x0, log_level=G_LOG_LEVEL_ERROR, format=<optimized out>, args=args@entry=0x7fa8f8b2f6d8) at goutput.c:175
#6  0x0000000000634692 in monoeg_g_log (log_domain=log_domain@entry=0x0, log_level=log_level@entry=G_LOG_LEVEL_ERROR, format=format@entry=0x70acf0 "Error destroying handle %p mutex due to %d\n") at goutput.c:185
#7  0x0000000000608db8 in _wapi_handle_unref_full (handle=0x40b, ignore_private_busy_handles=ignore_private_busy_handles@entry=0) at handles.c:1087
#8  0x0000000000609ed7 in _wapi_handle_unref (handle=<optimized out>) at handles.c:1138
#9  0x000000000060a4a4 in CloseHandle (handle=<optimized out>) at handles.c:1311
#10 0x00000000005890e6 in ves_icall_System_Threading_InternalThread_Thread_free_internal (this=0x7fa901de02d0, thread=<optimized out>) at threads.c:1044
#11 0x0000000040ef14fc in ?? ()
#12 0x00007fa8f40025d0 in ?? ()
#13 0x00007fa8f8b2fba8 in ?? ()
#14 0x00000000416d7000 in ?? ()
#15 0x00007fa8f8b2fae0 in ?? ()
#16 0x00007fa8f8b2fa70 in ?? ()
#17 0x000000000140e670 in ?? ()
#18 0x000000000140e670 in ?? ()
#19 0x00007fa8f8b2fba8 in ?? ()
#20 0x00007fa901de02d0 in ?? ()
#21 0x00007fa8f8dd0cfc in System.Threading.InternalThread:Finalize (this=...) at /usr/local/src/mono-edge/mcs/class/corlib/System.Threading/Thread.cs:233
#22 0x00000000416d7049 in ?? ()
#23 0x00007fa901de02d0 in ?? ()
#24 0x000000000140e670 in ?? ()
#25 0x000000000140e670 in ?? ()
#26 0x00007fa8f8b2fb68 in ?? ()
#27 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7fa901e727c0 (LWP 28270)):
#0  0x00007fa9013520c9 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x000000000060aaaa in _wapi_handle_timedwait_signal_handle (handle=handle@entry=0x4fc, timeout=timeout@entry=0x7fff2468cf60, alertable=alertable@entry=1, poll=poll@entry=0) at handles.c:1565
#2  0x000000000061dea9 in WaitForSingleObjectEx (handle=handle@entry=0x4fc, timeout=timeout@entry=2000, alertable=alertable@entry=1) at wait.c:198
#3  0x00000000005a9aeb in mono_domain_finalize (domain=domain@entry=0x140e670, timeout=timeout@entry=2000) at gc.c:380
#4  0x000000000041bd4b in mini_cleanup (domain=0x140e670) at mini.c:7680
#5  0x000000000048c799 in mono_main (argc=3, argv=<optimized out>) at driver.c:2038
#6  0x00007fa900fa8d65 in __libc_start_main () from /lib64/libc.so.6
#7  0x0000000000419d65 in _start ()

=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

Aborted (core dumped)
Comment 1 Zoltan Varga 2014-02-20 13:21:41 UTC
I can't reproduce this on debian amd64 using mono master.
Comment 2 Juraj Skripsky 2014-02-23 22:07:11 UTC
Thank you for looking into this.

I have now git-bisected the problem. The following commit seems to have introduced the crashes (at least on Fedora 20):

a0afa38296b8a3b0382bf34ce777357d2553c0f0 is the first bad commit
commit a0afa38296b8a3b0382bf34ce777357d2553c0f0
Author: Zoltan Varga <vargaz@gmail.com>
Date:   Mon Jan 13 04:00:58 2014 +0100

    Move the mono_thread_create () function into utils/mono-threads.h/c, change/simplify its signature a bit.

:040000 040000 890d912302e937cc41f9b68853a39c1d2265b1b3 7c5335e00154df051eac14cb9cfa5e1510b5a798 M	mono


With all subsequent revisions a full build fails most of the time with runtime crashes.

Is there anything I can do to help with the debugging?
Comment 3 Zoltan Varga 2014-02-24 16:04:25 UTC
Thanks for tracking down the commit. Its hard to debug this without being able to reproduce it.
Comment 4 Zoltan Varga 2014-02-24 18:24:51 UTC
a0afa38296b8a3b0382bf34ce777357d2553c0f0 was a faulty commit, 285f815fc5faa59d3be1f70b7427f91e4eaa461e fixed it.
Comment 5 Juraj Skripsky 2014-04-04 12:02:47 UTC
I've just compiled Mono on two freshly installed Fedora 20 systems and there's no SIGABRT. Most probably, the source of the SIGABRT was in the configuration of my previous system...

Closing, sorry for the noise!