Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception running megafuse #57

Open
junalmeida opened this issue Aug 19, 2016 · 3 comments
Open

Exception running megafuse #57

junalmeida opened this issue Aug 19, 2016 · 3 comments

Comments

@junalmeida
Copy link

junalmeida commented Aug 19, 2016

terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_S_construct null not valid

My upstartjob:

description "MegaFuse"
author      "Marcos Junior"

start on (local-filesystems and net-device-up IFACE!=lo)
stop on runlevel [!2345]

respawn

pre-start script
        test -x /usr/bin/MegaFuse || exit 0
end script

exec /usr/bin/MegaFuse -c /etc/megafuse.conf -f -o allow_other -o uid=1000 >/var/log/mega.log 2>/var/log/mega.err.log
@Human
Copy link

Human commented Jul 26, 2017

FWIW, I'm having a similar issue, also with -f -o allow_other -o uid=1000. When I become root via sudo or su, I don't get the above error (sometimes I get a Segmentation fault, though). However, sometimes it works. It always gets the above error when run as a daemon (monit runs a script that invokes MegaFuse if needed).

@junalmeida Did you ever find a fix for this?

@Human
Copy link

Human commented Jul 26, 2017

Steps to reproduce:

sudo su
env -i PATH=/bin:/usr/bin:/sbin:/usr/sbin /bin/sh
MegaFuse -c /path/to/megafuse.conf -f -o allow_other

The env line re-creates the shell environment typically available to daemons.

@Human
Copy link

Human commented Jul 26, 2017

After comparing two shell environments - one where the above error happens 100% of the time and one where it happens 0% of the time - I found a workaround. If you add HOME to your shell's environment, this error goes away.

Put this line before any MegaFuse invocation:

export HOME=/root

Without looking at the source code, I'd guess that something involved in processing the fuse parameters requires knowing what $HOME is, assumes it's non-null, then tries to assign it to a String.

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

No branches or pull requests

2 participants