einsteinx2 / WaveBox

A free, open source personal media server written in C# and available on all platforms thanks to the Mono framework. GPL3 Licensed.
waveboxapp.com
GNU General Public License v3.0
32 stars 15 forks source link

Multiple libraries crashes WaveBox #129

Open benjmiller86 opened 11 years ago

benjmiller86 commented 11 years ago

WaveBox crashes after startup if using multiple libraries. Web UI doesn't load either.

Syntax seems to looks okay in config. I have tried both of these with same results:

"mediaFolders": ["/Volumes/OAKWOOD/FLAC/","/Volumes/OAKWOOD/MP3/"], "mediaFolders": ["/Volumes/OAKWOOD/FLAC","/Volumes/OAKWOOD/MP3"],

Here is my log. Is pastie the best way to do this?

http://pastie.org/8156586

mdlayher commented 11 years ago

Looks like the native fsevents stuff for OSX that @einsteinx2 was working on.

http://gist.github.com/ is a good place to post logs, because there is no wrapping of lines, which makes output a little bit cluttered.

einsteinx2 commented 11 years ago

Ya I'm probably not sending the array correctly to the unmanaged code or something. I'll fix it.

einsteinx2 commented 11 years ago

I think this is fixed now. @benjmiller86 can you pull and build and see if this still happens for you?

einsteinx2 commented 11 years ago

This is weird, it seems to happen sometimes, but then I restart wavebox and it's fine again. I'm going to go over my FSEvents code again with a fine toothed comb, but I'm not sure if it's an issue with the C# p/invoke or with the native code.

benjmiller86 commented 11 years ago

After pulling latest changes, still having troubles with multiple libraries

Same crash

https://gist.github.com/benjmiller86/50bad55ac5a57194a32a#file-nohup-out

mdlayher commented 11 years ago

Do you have trailing slashes in your media folders in your ~/.wavebox/wavebox.conf? If so, that may be the problem. I fixed it a few days ago with #130. If you do have trailing slashes, try removing ~/.wavebox/wavebox.db, removing the slashes, and trying to run WaveBox again.

EDIT: I notice you tried both cases above, but give it another shot now after removing your database, and see what happens. I had a similar problem on Linux, and this fixed it.

benjmiller86 commented 11 years ago

@mdlayher That was it! Perhaps there should be a note in the config comment to nix the trailing slashes?

Thanks

mdlayher commented 11 years ago

@benjmiller86 I put in a patch to fix this recently, and can confirm that it works both with and without the trailing slash on the latest git build, on Linux 64-bit. The next set of tarballs should have the patch for sure.

benjmiller86 commented 11 years ago

This is nuts...

Woke up, couldn't reopen WaveBox. Same error still persisting. I even tried dumping the build and started over.

Dumped the .db, adding/removing slashes, etc, this is so weird. Same error/abort when using multiple libraries

Tried pulling any updates. None available...

mdlayher commented 11 years ago

I'm still unable to replicate your issue on my setup, even after playing around a bit with media folders and such. Could you please delete Wavebox.Server/bin/Debug/wavebox_log.txt, run WaveBox, then post that log along with your ~/.wavebox/wavebox.conf?

The only thing I can figure is that your build is still somehow out of date, or that Ben's filesystem watching changes for OSX are introducing a new issue into the codebase.

benjmiller86 commented 11 years ago

Yeah still no luck. I have attached log and conf

Do you want to remote in?

http://pastie.org/8171126 http://pastie.org/8171131

mdlayher commented 11 years ago

Yep, it's the native FSevents stuff on OSX. @einsteinx2 , this is all you.

einsteinx2 commented 11 years ago

Ya @mdlayher I'll handle it, I need to modify my objc test app that uses the fsevents lib to test multiple paths, then have @benjmiller86 try that and see if it crashes. If it doesn't, then it's got to be something funky C# is doing when interoping.

einsteinx2 commented 11 years ago

Interesting development on this. I can reproduce this if I watch 2 directories with FSEvents using the same dylib but with my test app, and then I start WaveBox. Or conversely, if I have WaveBox running and then start the test app. So perhaps there is something we need to handle regarding that.

einsteinx2 commented 11 years ago

@benjmiller86 I found out how to get better crash logs. Can you open the Console app and look on the left for any logs that start with mono. You can right click them and click Reveal in Finder to show them. Just zip up all the mono ones. Then I can better debug it.

benjmiller86 commented 11 years ago

@einsteinx2 Here you go:

http://pastie.org/8237803

http://pastie.org/8237804

einsteinx2 commented 11 years ago

Thanks, those are much more helpful. Ya it looks like the issue is always when actually setting the directories to be monitored, though your crash is slightly different than mine, but on the same line.

I'm going to rewrite it in Objective-C using an FSEvents wrapper so I can have cleaner, higher level code. No more pointer juggling. I'll do some testing on my side once I rewrite it then add it to the repo.

mdlayher commented 11 years ago

Assigning to Ben because he's handling FSEvents.