Bug 58790 - SIGSEGV in System.IO.MonoIO.FindFirstFile when starting KeePass 2.x using Mono 5.2
Summary: SIGSEGV in System.IO.MonoIO.FindFirstFile when starting KeePass 2.x using Mon...
Status: NEEDINFO
Alias: None
Product: Runtime
Classification: Mono
Component: io-layer (show other bugs)
Version: 5.2 (2017-04)
Hardware: PC Linux
: --- normal
Target Milestone: Future Cycle (TBD)
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-08-15 20:33 UTC by David Lechner
Modified: 2017-10-11 18:02 UTC (History)
4 users (show)

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


Attachments
stacktrace (91.34 KB, text/plain)
2017-08-15 20:33 UTC, David Lechner
Details
Simple test case. (522 bytes, text/x-csharp)
2017-08-17 18:16 UTC, David Lechner
Details


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 for Bug 58790 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEEDINFO

Description David Lechner 2017-08-15 20:33:05 UTC
Created attachment 24208 [details]
stacktrace

System: Ubuntu 16.04

I just upgraded to...

Mono JIT compiler version 5.2.0.215 (tarball Mon Aug 14 15:46:12 UTC 2017)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           __thread
	SIGSEGV:       altstack
	Notifications: epoll
	Architecture:  amd64
	Disabled:      none
	Misc:          softdebug 
	LLVM:          supported, not enabled.
	GC:            sgen (concurrent by default)

from the Xamarin PPA. Using KeePass 2.36 from https://launchpad.net/~jtaylor/+archive/ubuntu/keepass

When I launch keepass2, mono crashes with SIGSEGV. I'll attach the stack trace (it's long).
Comment 1 Ludovic Henry 2017-08-16 18:18:30 UTC
Hello,

There is not enough information in the stacktrace you provided: the native one doesn't contain the thread that called FindFirstFile and triggered the SIGSEGV.

Could you come up with a reproduction case that is smaller? Otherwise, how reliable is the crash? And could you please provide a series of step I can take to reproduce?

Thank you
Comment 2 David Lechner 2017-08-16 19:00:54 UTC
I'll try to see what I can do to get a simpler test case, but in the mean time...

100% reproducible. KeePass 2.x crashes on startup.

Steps to reproduce.

- Install Ubuntu 16.04
- Install Mono as described by http://www.mono-project.com/download/#download-lin-ubuntu
- Install Keepass 2.x from the PPA https://launchpad.net/~jtaylor/+archive/ubuntu/keepass
- Launch KeePass 2.x

I haven't actually tried with a clean install, so may require having a "most recently used" file list or something like that.
Comment 3 David Lechner 2017-08-17 18:15:24 UTC
Digging in a bit more, I have found that the problem only occurs when there is a broken FUSE mount. In particular, I was using sshfs. Somehow, the remote host was reset without the filesystem being unmounted. When KeePass tries to enumerate the root directory of that filesystem, the crash occurs.

Unfortunately, I don't know of a way to purposely break sshfs to repeat the exact conditions, so we can just leave this bug as NEEDINFO until I figure it out. It could be that a newer version of sshfs will fix the problem too.
Comment 4 David Lechner 2017-08-17 18:16:36 UTC
Created attachment 24279 [details]
Simple test case.
Comment 5 Rodrigo Kumpera 2017-10-11 18:02:54 UTC
Hi David,

I think an easy way to accomplish that is to disconnect from the network after successfully mounting it.


Another thing, it would be great if you could install the mono debug symbols package in your system so we can correctly see where it's crashing.