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
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)

See Also:
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

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.

Note You need to log in before you can comment on or make changes to this bug.