# emacs issue



## CptnBlues63 (Aug 14, 2020)

uname -a = FreeBSD 12.1-STABLE FreeBSD 12.1-STABLE r356611 GENERIC  amd64

Everything was working fine and then a couple days ago I did the "pkg update/pkg upgrade"  after doing that, my emacs stopped working.  Whenever I try to run it I get the following:

*ld-elf.so.1: /usr/local/bin/emacs: Undefined symbol "fflush_unlocked@FBSD_1.6"*

I like to think I've done due diligence in researching this via google but have found nothing helpful.  

Please help, I really need my emacs back.....

TIA


----------



## CptnBlues63 (Aug 14, 2020)

CptnBlues63 said:


> uname -a = FreeBSD 12.1-STABLE FreeBSD 12.1-STABLE r356611 GENERIC  amd64
> 
> Everything was working fine and then a couple days ago I did the "pkg update/pkg upgrade"  after doing that, my emacs stopped working.  Whenever I try to run it I get the following:
> 
> ...



Sorry, I should add, I tried "pkg update/pkg upgrade" again and the following appeared:

*Message from emacs-nox-27.1,3:

--
The major version of editors/emacs was bumped from 26 to 27.  To upgrade
dependent packages, run these commands with superuser privileges:

    # sh
    # for i in $(pkg query -g %n '*-emacs26*'); do \
        nn=$(echo "$i" | sed -e 's/emacs26/emacs27/'); \
        pkg set -yn "$i":"$nn"; \
      done;
    # pkg upgrade*

so I tried doing that and nothing changed.


----------



## Deleted member 63539 (Aug 14, 2020)

CptnBlues63 said:


> uname -a = FreeBSD 12.1-STABLE FreeBSD 12.1-STABLE r356611 GENERIC  amd64


Ah, STABLE. Could it be the problem? You should run a RELEASE, not STABLE.


----------



## jb_fvwm2 (Aug 15, 2020)

deinstall emacs, install emacs-devel? Just to test as a temporary fix.


----------



## CptnBlues63 (Aug 18, 2020)

Ok so what's the difference between *stable* and *release*?  Why would release be better to run than stable? 

I'll see if pkg offers emacs-devel and try installing that.  

Just FYI, I did deinstall emacs-nox and reinstalled it but that didn't work either.


----------



## a6h (Aug 18, 2020)

gh_origin said:


> Ah, STABLE. Could it be the problem? You should run a RELEASE, not STABLE.


Where did you get that from?



CptnBlues63 said:


> Ok so what's the difference between *stable* and *release*?


-RELEASE only gets security updates.
-STABLE gets security updates and and new features.

*Switching* to ports' latest branch may fix your problem. There's one ports tree. It's same for all FreeBSD versions. You can switch between different port branches. The default is quarterly branch. You can switch to latest branch to get latest ports and/or to fix potential problems with ports:

Create FreeBSD.conf file in this path
/usr/local/etc/pkg/repos/FreeBSD.conf

>>> To get ports from quarterly branch (default):

/usr/local/etc/pkg/repos/FreeBSD.conf

```
FreeBSD: { url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", enabled: yes }
```

`pkg update`

>>> To get ports from latest branch (latest update):

/usr/local/etc/pkg/repos/FreeBSD.conf

```
FreeBSD: { url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",    mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", enabled: yes }
```

`pkg update`


----------



## a6h (Aug 19, 2020)

CptnBlues63 said:


> Ok so what's the difference between *stable* and *release*? Why would release be better to run than stable?


STFW/DYOR in chronological order:

SRC: Release and Stable, stable/* and releng/*








						Release or stable?
					

I always installed -RELEASE branch. I was wondering it was the cutting edge FreeBSD software around (but the beta), now someone say it could be better to install -STABLE and apparently they fixed the memory leak bug in -STABLE and not in -RELEASE.  Which is the right branch to install to have a...




					forums.freebsd.org
				











						Solved - [Solved] Clarification on releng
					

Could anyone please clarify what the RELENG branch is? I understand that the all the work is done in CURRENT. Then there is STABLE, where the ABI wont change. And then a snapshot(?) is done into a separate branch which will be RELEASE? RELEASE gets regularly binary updates, while CURRENT and...




					forums.freebsd.org
				




Ports: FreeBSD ports system is not Linux packaging system








						Updating ports in 9.3-RELEASE
					

Hello,  I'm updating a system from 9.2 to 9.3. The base OS update was fine, but using portsnap to update the ports tree seems to take it into the realm of 10.0, not 9.3.  One example: --->  Checking for the latest package of 'devel/libffi' --->  Found a package of 'devel/libffi'...




					forums.freebsd.org
				




SRC: -STABLE, -RELENG and -RELEASE








						Difference between /releng and /stable, today.
					

What's the difference between the source at  https://svn0.us-west.freebsd.org/base/releng/10.3/  and  https://svn0.us-west.freebsd.org/base/stable/10/  today?  Since 10.3 is the latest release, they should be the same? no?




					forums.freebsd.org
				











						Solved - Understanding releases
					

I'm currently running the 10.3-RELEASE so I will need to upgrade within the next 6 months. Naturally, I wish to minimise the number of such upgrades without losing timely security support. I am therefore struggling to understand the information at https://www.freebsd.org/security/security.html...




					forums.freebsd.org
				




Ports: Latest and Quarterly








						So, what's up with Latest vs Quarterly FreeBSD pkg repos?
					

Hi,   so I did a dumb thing - I am trying to get better about it, but I'm fairly upgrade-happy and I'm bad about taking snapshots.  You'd think having both ZFS AND ESXi for my 3 FreeBSD VMs I would stop 5 seconds to take a snapshot before upgrading.   But no, I powered right ahead, added the...




					forums.freebsd.org
				











						Is it possible to get the ports tree that pkg uses to build binaries, as opposed to the current ports tree?
					

I do hope this questions hasn't been asked before, but I've seen no indication that is has.  Here is my dilemma: I have two packages (google-authenticator and nginx) where I literally need to change only 5 lines of code in the source before compiling. Otherwise, binary packages work very well...




					forums.freebsd.org
				











						Is FreeBSD "pkg" command pointing to latest repository?
					

I'm trying to install the current latest version of JDK 8.  When I searched on "https://www.freebsd.org/ports/index.html", I found JDK 8 update 181. And, looking into the "Age" of the files, it was updated only 3 days ago.  However, when I search from within FreeBSD using pkg search, I could...




					forums.freebsd.org
				











						Pkg quarterly to Latest
					

I have the normal FreeBSD.conf for pkg installed on FreeBSD-RELEASE  FreeBSD: { url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", enabled: yes }  To get newer pkgs, I have to change ‘quarterly’ to ‘latest’...




					forums.freebsd.org
				











						Why do i have to use latest packages vs quarterly in order to get security updates?
					

Hi,  there is a new version of Firefox 73, which fixes some serious bugs, released yesterday.  https://www.mozilla.org/en-US/security/advisories/mfsa2020-05/  I wanted to update it but learned that the fixes didn't go to quarterly packages, so i had to change pkg to fetch the latest packages...




					forums.freebsd.org
				











						Solved - Tracking latest packages ports branch
					

I know that for the quarterly packages exist a quarterly ports branch, which only receive security updates. So my question is: is there a branch of ports for the latest packages or the latest packages are built from the current ports ("rolling release")? The first reason for my question is: as a...




					forums.freebsd.org
				











						Find out the quartly branch from which packages are installed?
					

I'm looking for a way to automatically install a ports tree that matches the current package repo.  Note for those who are about to say that people should avoid mixing ports and packages:  You can't.  There are many ports that cannot be packaged for licensing reasons (audio/lame...




					forums.freebsd.org
				











						What is the last ports update to 10.4?
					

I am trying to get a SAMBA43 AD-DC moved to a more recent version.  4.3 was the last vesion of samba_server that would provision on FreeBSD before 4.10.15 and so we had to keep it running.  Samba-4.3 was last available on FreeBSD-10.3, which we have kept running in a BHyve vm specifically for...




					forums.freebsd.org


----------



## eternal_noob (Aug 19, 2020)

Hi,


vigole said:


> STFW/DYOR in chronological order:


very interesting read, i have one question though. Is using RELEASE with latest packages the same as using STABLE? Where are the differences if any?


----------



## a6h (Aug 19, 2020)

FreeBSD version (kernel/world) and ports (packages) are different animals. Those are not related.


----------



## CptnBlues63 (Aug 19, 2020)

vigole said:


> Where did you get that from?
> 
> 
> -RELEASE only gets security updates.
> ...



First off, thanks for the help.  I tried both and neither worked, I still get the same error message when I try to use emacs.

Also, thanks for the info on stable/release....I think I'll stick with stable.  I've been running it for years without issue. (prior to this of course)

Any other ideas I can try?


----------



## Jose (Aug 19, 2020)

Maybe you got bit by this:


			Packages with versions in their names (e.g. py37- or -emacs26-)
		


What does `pkg info | grep emacs` report?


----------



## a6h (Aug 19, 2020)

CptnBlues63 said:


> First off, thanks for the help. I tried both and neither worked, I still get the same error message when I try to use emacs.


Generally these problems is going to solved with next update. It could be due to the bug, wrong/missing/old library, etc. Hard to debug and trace-back. In this situation I tend to wait till next update. If you have time and prefer to investigate this problem, take a look at ld-elf.so.1(1) and ldd(1). 


CptnBlues63 said:


> I think I'll stick with stable. I've been running it for years without issue.


That's great. If you're not on a production server, staying on -STABLE is best approach.


----------



## CptnBlues63 (Aug 20, 2020)

Jose said:


> Maybe you got bit by this:
> 
> 
> Packages with versions in their names (e.g. py37- or -emacs26-)
> ...



I install the "nox" version because I'm running a bare bones (no gui) box I use for some basic monitoring and something I can remote into for accessing my switches (this BSD box has an interface on a client subnet which I can access from VPN and another on my management subnet which allows me ssh access to my switches)

pkg info | grep emacs
emacs-nox-27.1,3               GNU editing macros (No X flavor)


----------



## CptnBlues63 (Aug 20, 2020)

vigole said:


> Generally these problems is going to solved with next update. It could be due to the bug, wrong/missing/old library, etc. Hard to debug and trace-back. In this situation I tend to wait till next update. If you have time and prefer to investigate this problem, take a look at ld-elf.so.1(1) and ldd(1).
> 
> That's great. If you're not on a production server, staying on -STABLE is best approach.



One of my coworkers is the reason I'm running FreeBSD instead of Linux.  He's been running Free/OpenBSD for decades and has forgotten more about BSD than I'll ever know (all the rest of our admins are linux guys).  I would have asked him but he's on vacation.  He is back next week so I'm going to bug him as soon as he has a minute.  

So here's something weird I noticed today.  I use MobaXterm from my windows PC at home to connect to my FreeBSD box.  If I'm correct, putty is the ssh client built into MobaXterm.  In any case, if I connect with my user acccount (always) and try to run emacs, it locks up and I have to kill the session.  If I su up to root from my user account and run emacs, I get the same error message, but it doesn't lock up.  Weird.

Once I get a chance to get my coworkers help, if he can fix it, I'll post back in this thread what he did to make it work.


----------



## Jose (Aug 21, 2020)

CptnBlues63 said:


> ...If I'm correct, putty is the ssh client built into MobaXterm...


I have _very_ little experience with Moba, but my vague recollection is that it's much heavier than that. Seemed more like a cygwin reimplement-posix-in-windows kind of thing.


----------



## monwarez (Aug 27, 2020)

This seems related to 









						MFC r357284, r357419: stdio unlocked · freebsd/freebsd-src@9bc8f31
					

r357284: stdio: provide _unlocked variants of fflush, fputc, fputs, fread, fwrite  fflush_unlocked is currently desired in ports by sysutils/metalog, and redefined as the locked fflush.  fputc_unlo...




					github.com
				




Which may suggest that emacs was build with a more recent version of 12-STABLE than what you have to run it.

Currently on 12-RELEASE there is no fflush_unlocked in stdio.h

So I guess that the fixes would be to update to a revision after the related MFC


----------



## CptnBlues63 (Sep 2, 2020)

So my friend is back from vacation and I sent him a link to this thread and told him about my issue.  He upgraded my kernel and emacs now works properly.

Here's what he upgraded me to:

FreeBSD 12.2-PRERELEASE FreeBSD 12.2-PRERELEASE r365008 GENERIC  amd64


----------

