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

Bug: Segfault when running 'onedrive --display-sync-status' when run as 2nd process #2103

Closed
votdev opened this issue Aug 19, 2022 · 10 comments · Fixed by #2105
Closed

Bug: Segfault when running 'onedrive --display-sync-status' when run as 2nd process #2103

votdev opened this issue Aug 19, 2022 · 10 comments · Fixed by #2105
Labels
Bug Something isn't working Fixed Unable to reproduce
Milestone

Comments

@votdev
Copy link

votdev commented Aug 19, 2022

Describe the bug

When onedrive is running in monitor mode via systemd and a onedrive --display-sync-status is executed, a segfault occurs.

# /usr/bin/onedrive --confdir /var/cache/onedrive --display-sync-status
Configuration file successfully loaded
Configuring Global Azure AD Endpoints

ERROR: onedrive application is already running - check system process list for active application instances

Segmentation fault
Aug 18 10:05:36 omv6box kernel: onedrive[35844]: segfault at 0 ip 0000000000000000 sp 00007fffbef901f8 error 14 in onedrive[55cecd80f000+224000]
Aug 18 10:05:36 omv6box kernel: Code: Unable to access opcode bytes at RIP 0xffffffffffffffd6.

Operating System Details

Debian 11

Client Installation Method

From 3rd Party Source (PPA, OpenSuSE Build Service etc)

OneDrive Account Type

Personal

What is your OneDrive Application Version

2.4.20

What is your OneDrive Application Configuration

sync_dir = "/srv/dev-disk-by-uuid-2a159653-6f1b-4abd-a3b7-c5b1d718e2c2/test/"
sync_dir_permissions = "750"
sync_file_permissions = "640"
disable_notifications = "true"
local_first = "false"
no_remote_delete = "false"
download_only = "true"
upload_only = "false"
skip_dotfiles = "false"
monitor_interval = "300"
monitor_fullscan_frequency = "12"
rate_limit = "0"

What is your 'curl' version

n/a

Where is your 'sync_dir' located

Local

What are all your system 'mount points'

n/a

What are all your local file system partition types

n/a

How do you use 'onedrive'

n/a

Steps to reproduce the behaviour

See above

Complete Verbose Log Output

n/a

Screenshots

n/a

Other Log Information or Details

See above

Additional context

No response

@abraunegg
Copy link
Owner

abraunegg commented Aug 19, 2022

@votdev
Despite attempting to, I am unable to replicate this issue at all .. so potentially this is something 'unique' to Debian or even OMV - unsure.

Additionally, segfaulting with the Ubuntu|Debian packages is also a known issue due to how LDC is packaged and used for those distributions:

Regardless of this, please can you test the following PR to potentially resolve your issue:

git clone https://github.com/abraunegg/onedrive.git
cd onedrive
git fetch origin pull/2105/head:pr2105
git checkout pr2105
./configure; make clean; make;

To build the client successfully, you will need to also install the following dependencies as per https://github.com/abraunegg/onedrive/blob/master/docs/INSTALL.md#dependencies-ubuntu-18x---ubuntu-22x--debian-9---debian-11---x86_64

To run the PR, you need to run the client from the PR build directory:

./onedrive <any options needed>

To install the PR, you will need to perform sudo make install to install the PR version.

When running the PR, your version should be: onedrive v2.4.20-21-g7d01e43 or greater.

@abraunegg
Copy link
Owner

@votdev
Any update in testing this PR?

@votdev
Copy link
Author

votdev commented Aug 24, 2022

@votdev Any update in testing this PR?

Sorry, no. Will test asap.

@abraunegg
Copy link
Owner

@votdev
Any update in testing this PR?

@bart-swennen
Copy link

bart-swennen commented Aug 30, 2022

I have tested this PR - it solves the segv fault - some additional info: the segv fault only occurs when another instance of onedrive is running - when no other instance is running, the original version also works as expected:

=> My original version (from https://download.opensuse.org/ repo):

$ /usr/bin/onedrive --version
onedrive v2.4.20-1+np1

$ /usr/bin/onedrive --display-sync-status
Configuration file successfully loaded
Configuring Global Azure AD Endpoints

ERROR: onedrive application is already running - check system process list for active application instances

Segmentation fault (core dumped)
$ 

=> My PR version:

$ ./onedrive --version
onedrive v2.4.20-28-ge806e41

$ ./onedrive --display-sync-status
Configuration file successfully loaded
Configuring Global Azure AD Endpoints

ERROR: onedrive application is already running - check system process list for active application instances

$ 

@abraunegg
Copy link
Owner

@bart-swennen
Thanks for the confirmation - will mark this as 'fixed' and merge into 'master'

@abraunegg abraunegg changed the title Bug: Segfault when running 'onedrive --display-sync-status' Bug: Segfault when running 'onedrive --display-sync-status' when run as 2nd process Aug 30, 2022
@bart-swennen
Copy link

Maybe not the right place to ask this, but is --display-sync-status intended to work when another instance is running ? Or is this solely meant as 'stand-alone' inquiry and is there another way to ask a running instance for its current state ?

@rrodrigueznt
Copy link

@bart-swennen

Maybe not the right place to ask this, but is --display-sync-status intended to work when another instance is running ? Or is this solely meant as 'stand-alone' inquiry and is there another way to ask a running instance for its current state ?

Please, search for status in this page.

@abraunegg
Copy link
Owner

@bart-swennen

Maybe not the right place to ask this, but is --display-sync-status intended to work when another instance is running ? Or is this solely meant as 'stand-alone' inquiry and is there another way to ask a running instance for its current state ?

You can run it at the same time as a running instance, however with the following caveat:

  • It will use a --dry-run cache copy, thus will always be behind in what is the accurate true state

To get the correct and accurate sync status, it is best to stop any existing process and run the command - then this is reporting the correct sync state 100% of the time.

@abraunegg
Copy link
Owner

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Repository owner locked as resolved and limited conversation to collaborators Sep 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Something isn't working Fixed Unable to reproduce
Projects
None yet
4 participants