mosen / mysides

A command line application for managing OS X Finder sidebar favourites

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Segmentation fault: 11, when running mysides

jimratliff opened this issue · comments

When running the following script, I get a series of "Segmentation faults: 11". (Each of these is also accompanied by "neq all".) That doesn't mean anything to me. Any idea what I should do next?

`#!/usr/bin/env bash
echo "Define address for MYSIDES and get name of current user."

MYSIDES=/usr/local/bin/mysides

dir=$(whoami)

echo "I have determined the current user to be $dir ."

echo "Remove All My Files entry."

$MYSIDES remove All\ My\ Files file:///System/Library/CoreServices/Finder.app/Contents/Resources/MyLibraries/myDocuments.cannedSearch/

echo "Remove iCloud Drive entry."

$MYSIDES remove iCloud x-apple-finder:icloud

echo "Remove Desktop entry."

$MYSIDES remove Desktop file:///Users/${dir}/Desktop

echo "Remove Documents entry."

$MYSIDES remove Documents file:///Users/${dir}/Documents

echo "======================= I have completed my task"`

Here is the output from Terminal:

Redux:~ admin$ su - remotetarget2 -c /Users/admin/dotfiles/5_Script_to_edit_Finder_Sidebar_Favorites_using_mysides.sh

Password:

Entering script /Users/admin/dotfiles/5_Script_to_edit_Finder_Sidebar_Favorites_using_mysides.sh .

Define address for MYSIDES and get name of current user.

I have determined the current user to be remotetarget2 .

Remove All My Files entry.

neq all

/Users/admin/dotfiles/5_Script_to_edit_Finder_Sidebar_Favorites_using_mysides.sh: line 40: 7269 Segmentation fault: 11 $MYSIDES remove All\ My\ Files file:///System/Library/CoreServices/Finder.app/Contents/Resources/MyLibraries/myDocuments.cannedSearch/

Remove iCloud Drive entry.

neq all

/Users/admin/dotfiles/5_Script_to_edit_Finder_Sidebar_Favorites_using_mysides.sh: line 44: 7271 Segmentation fault: 11 $MYSIDES remove iCloud x-apple-finder:icloud

Remove Desktop entry.

neq all

/Users/admin/dotfiles/5_Script_to_edit_Finder_Sidebar_Favorites_using_mysides.sh: line 52: 7272 Segmentation fault: 11 $MYSIDES remove Desktop file:///Users/${dir}/Desktop

Remove Documents entry.

neq all

/Users/admin/dotfiles/5_Script_to_edit_Finder_Sidebar_Favorites_using_mysides.sh: line 56: 7273 Segmentation fault: 11 $MYSIDES remove Documents file:///Users/${dir}/Documents

======================= I have completed my task

Thanks in advance if you have some time to give this some thought!

commented

The segmentation fault means it's crashing essentially.
I will have to look into the special iCloud and canned search items because i think they need to be dealt with in a different way. I'll get back to you on that one.

Thanks! I should have mentioned for clarity/definitiveness that I'm running 10.11.5.

The commands I used have apparently been used successfully by others, so I don't know why it would start crashing for me, unless it's something that changed in an incremental 10.11.x update.

I am also getting the seg fault:


$mysides list
Dropbox -> file:///Users/admin/Dropbox/
All My Files -> file:///System/Library/CoreServices/Finder.app/Contents/Resources/MyLibraries/myDocuments.cannedSearch/
iCloud -> x-apple-finder:icloud
domain-AirDrop -> nwnode://domain-AirDrop
Applications ->  @file:///Applications/
Desktop -> file:///Users/admin/Desktop/
Documents -> file:///Users/admin/Documents/
Downloads -> file:///Users/admin/Downloads/
Movies -> file:///Users/admin/Movies/
Music -> file:///Users/admin/Music/
Pictures -> file:///Users/admin/Pictures/

Segmentation fault: 11

Edit: This only appears to affect some users on the machine. I'm running 10.11.5

commented

Yes it seems to be related to 10.11.5 or newer.
Having a look. Hopefully apple hasn't completely removed this API now.

commented

All I can say at the moment is that it runs over the end of the list and tries to free a null pointer.
I'll come back to it shortly guys.

I am also experiencing this issue as well. Running OSX 10.11.6.

The only slight difference is the segmentation fault only appears to happen when I run it manually. If the script is triggered by a JAMF Login policy at login time it executes just fine.

It is impossible to manually run it now though. Thanks for taking a look, hopefully apple has left you with a quick fix for it.

hey,

thanks for the really nice project. Was looking for something like that for longer ;)

Ran into the same issue. Hope it helps anyone, running

sfltool clear

before solved the problem for me on latest sierra beta.

Thanks tiiiecherle, it looks like "sfltool clear" is not valid syntax for 10.11.6, it must be something new included in Sierra. Unless you know some other way to input that or possible something is missing.
Thanks!

Any possible updates on the horizon? Appreciate the work on the project, wish i knew the code to help out.

commented

Hi there @TexasITAdmin I'll re-examine the code this weekend. To be honest im a little stumped but i'll have a hard look at the issue.

Hey, I found a really good working solution for me on the latest Sierra GM, but it requires the latest mysids build from GitHub as it contains the mysides remove all function that is working pretty great.

I put together this script which is working really well that also deals with a few issues of the rest of the finder sidebar. Reboot afterwards. Do not use the installer that the script suggests as it is not the git version of mysides. I only put it in for the future.

https://github.com/tiiiecherle/osx_install_config/blob/master/11_system_and_app_preferences/11e_finder_sidebar.sh

It is now part of my project https://github.com/tiiiecherle/osx_install_config which tries to make configuration and backup and clean installs as easy and reliable as possible and the system config script (11b) is the most complete one I know of. Perhaps there is something in for you.

Would be nice if there would be feedback and / or help, comment, pull request, ... to solve the remaining stuff.

Thanks again for mysides, really helps me out with the finder config ;) Hope you keep it up. Have a nice weekend everyone.

commented

I believe that the segfault has been eliminated. Hopefully I haven't reintroduced a memory leak.
I added a test for sidebar listing and I'm no longer getting the same issue. Please pull down and try it out.

hey,

thanks for the update. the issue seems to be gone but the
mysides remove all
option seems to not work any more in 1.0.1

I compiled a version inbetween 1.0.0 and 1.0.1 and it was working great than.

Would be nice if you could fix it.

Thanks in advance

commented

Sure, I'll track it down in the next couple of days. m

Hi.
I'm running Sierra 10.12.2, I have compiled a binary 1.0.1 and after it works once, I have now the neq all + Segmentation fault:11 error. At best, it works one time per log in for the command :
/usr/local/bin/mysides remove iCloud x-apple-finder:icloud
I see this one running once :
/usr/local/bin/mysides remove domain-AirDrop nwnode://domain-AirDrop
But now it does not work anymore, even after a new log in.

Best regards.

commented

I'm not sure that my sides will continue to work because apple changed the way the API worked. It's now only accessible to sfltool. I'll have another look though.

I also get "Segmentation fault: 11" on macOS 10.13.6...

I'm getting a "Segmentation fault: 11" as well when one of my favorites has a NULL URL.

I figured out a possible workaround on Ventura by accident. Not sure if useful for others.
See new issue with different error text (for easier search):
zsh: segmentation fault mysides list on Ventura – Workaround -> Rearrange before list #29

Issue:

After running mysides list the terminal output stoped after 3 item with error
zsh: segmentation fault mysides list
and a finder window stating unexpected quit of mysides (screenshot, exact message not available).

Workaround

  • I tried to rearrange the first item not listed after the error by dragging it 2 steps further down in the Favorites list.
  • After reissuing mysides list the whole list including this item was listed again.

Possible causing

  • Maybe the old stored format was rewritten on change, leading to be better accessible via a changed API.

I will come back later to add more experience if something changes

Installed version

I am using mysides installed at /usr/local/bin/mysides (creation date 26 Sep 2016, size 49.356 bytes)
Installed using brew install mysides --cask under Mojave or Catalina on an Intel Machine, migrated to Apple Silicon M1 under Monterey, now at Ventura 13.5.2 (22G91)

...
installer: Package name is mysides-1.0.1
...

See my recent updates on the origin of the segmentation fault errors in #29 and how to kinda workaround better now.