Sublime Forum

Build 4169: Auto Save Session failed me

#1

Hi,

I’ve been a paying customer since 2012, I absolutely love it, a few weeks ago my license expired and I’m waiting for some features I find worth it before renewing again

Yesterday I was doing a poweroff from a fairly freshly installed Ubuntu 24.04 LTS, everything seemed fine, snapd took some time because it was updating something else, Sublime Text is manually installed with the official .deb package

Booting up this morning and launching Sublime Text and all the unsaved / untitled files was gone, my windows were back to a previous state (tabs not in right window etc), it was the first time I have seen this, I’ve been heavily reliant on this feature for many years, unfortunately nothing of that could be saved

I’m not sure what happened, if it didn’t save or if it failed to restore or some other corruption, but the data was not to be found in any of the two Session files, filesystem was clean on boot as well

I also saw another weird thing or two after I gave up on restoring anything, first time I checked the directory it held a Auto Save Session.sublime_text file (but not with my data, unfortunately I didn’t check last modification date, I guess I could have done a better job investigating here), but after another restart it was gone, and I tried to create a new untitled tab and write something in it, it should have saved this file after at most 30 seconds, but it didn’t do that, after another restart a few minutes later for testing the untitled data was gone again, but now when I opened a new untitled tab and wrote something it started to update that file again, and restarting once again it worked with restoring it as normal

I’m now reverting back to Build 4107, this is the version I’ve trusted the longest with the most unsaved / untitled tabs and restarted the most without any problems

I just wanted you to know, maybe you can find something

The changelog seems to indicate there are fixes for data losses after 4107 but maybe they weren’t as resilient as thought, found one maybe related in 4142:
Linux: Added safeguard around nested GTK main loops possibly causing data loss
But could be something else

I’m also setting up a separate backup of Auto Save Session.sublime_text and Session.sublime_text with an interval now

0 Likes

#2

I’m sorry your data was lost. What version of Sublime Text were you using and which distro are you running?

but after another restart it was gone, and I tried to create a new untitled tab and write something in it, it should have saved this file after at most 30 seconds, but it didn’t do that, after another restart a few minutes later for testing the untitled data was gone again

The fact this happened multiple times leads me to believe it may not be directly related to Sublime Text. I would strongly suggest running a test on your storage medium, if just to rule that out as a cause. To clarify were these restarts of Sublime Text or your OS?

Additionally just to confirm: Does your storage device have a fair amount of free space?

0 Likes

#3

What version of Sublime Text were you using and which distro are you running?

I was using Sublime Text 4 - Build 4169 on Ubuntu 24.04 x86_64

I could make a test, any one in particular? I don’t know which one to run

The whole computer is brand new with a new WD Black SN850X, running ext4 in default Ubuntu configuration, so I would doubt it but I’ve been wrong before

To clarify were these restarts of Sublime Text or your OS?

Restarts of Sublime Text, haven’t restarted the OS after booting up this morning

Additionally just to confirm: Does your storage device have a fair amount of free space?

Yes it is only using 7%, 811G free

/dev/nvme0n1p2 915G 58G 811G 7% /

0 Likes

#4

I could make a test, any one in particular? I don’t know which one to run

The two things to check are:

  • Open the Disks utility (gnome-disks on the command line), select the disk and under the menu benchmark the disk using the default settings. You should see a >3GB/s read rate and ~0.12msec of latency - I have a SN750 and that’s what I’m getting.
  • Run sudo smartctl -a /dev/nvme0 to get SMART self-report data from the SSD. You may have to install that tool using sudo apt install smartmontools. It should report errors; I’d be happy to look over the output if you’d like. Do this last, as the other checks may cause errors to show here.

Restarts of Sublime Text, haven’t restarted the OS after booting up this morning

That’s worrying. I haven’t seen any reports of that happening in the 11 months since that version released, so I have a hard time seeing Sublime Text being the cause here since you’re doing the single most basic thing. Given it’s a brand new SSD I do think it’s more likely to be a hardware fault, hopefully the tests are conclusive.

0 Likes

#5

Disks utility says 5.5 GB/s and 0.17 msec, I didn’t change any number of samples or anything

The smartctl output is this

Summary

smartctl 7.4 2023-08-01 r5530 [x86_64-linux-6.8.0-40-generic] (local build)
Copyright © 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Number: WD_BLACK SN850X 1000GB
Serial Number: ===REDACTED===
Firmware Version: 620361WD
PCI Vendor/Subsystem ID: 0x15b7
IEEE OUI Identifier: 0x001b44
Total NVM Capacity: 1,000,204,886,016 [1.00 TB]
Unallocated NVM Capacity: 0
Controller ID: 8224
NVMe Version: 1.4
Number of Namespaces: 1
Namespace 1 Size/Capacity: 1,000,204,886,016 [1.00 TB]
Namespace 1 Formatted LBA Size: 512
Namespace 1 IEEE EUI-64: 001b44 4a41ac7d2c
Local Time is: Wed Oct 9 16:03:34 2024 CEST
Firmware Updates (0x14): 2 Slots, no Reset required
Optional Admin Commands (0x0017): Security Format Frmw_DL Self_Test
Optional NVM Commands (0x00df): Comp Wr_Unc DS_Mngmt Wr_Zero Sav/Sel_Feat Timestmp Verify
Log Page Attributes (0x1e): Cmd_Eff_Lg Ext_Get_Lg Telmtry_Lg Pers_Ev_Lg
Maximum Data Transfer Size: 128 Pages
Warning Comp. Temp. Threshold: 90 Celsius
Critical Comp. Temp. Threshold: 94 Celsius
Namespace 1 Features (0x02): NA_Fields

Supported Power States
St Op Max Active Idle RL RT WL WT Ent_Lat Ex_Lat
0 + 9.00W 9.00W - 0 0 0 0 0 0
1 + 6.00W 6.00W - 0 0 0 0 0 0
2 + 4.50W 4.50W - 0 0 0 0 0 0
3 - 0.0250W - - 3 3 3 3 5000 10000
4 - 0.0050W - - 4 4 4 4 3900 45700

Supported LBA Sizes (NSID 0x1)
Id Fmt Data Metadt Rel_Perf
0 + 512 0 2
1 - 4096 0 1

=== START OF SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

SMART/Health Information (NVMe Log 0x02)
Critical Warning: 0x00
Temperature: 32 Celsius
Available Spare: 100%
Available Spare Threshold: 10%
Percentage Used: 0%
Data Units Read: 1,859,024 [951 GB]
Data Units Written: 2,836,150 [1.45 TB]
Host Read Commands: 8,154,646
Host Write Commands: 46,023,998
Controller Busy Time: 268
Power Cycles: 7
Power On Hours: 85
Unsafe Shutdowns: 1
Media and Data Integrity Errors: 0
Error Information Log Entries: 0
Warning Comp. Temperature Time: 0
Critical Comp. Temperature Time: 0

Error Information (NVMe Log 0x01, 16 of 256 entries)
No Errors Logged

Self-test Log (NVMe Log 0x06)
Self-test status: No self-test in progress
No Self-tests Logged

Oh and the written data (1.45 TB) and read should probably be 800+ GB less at the accident since I accidentally wrote a image.dd file with an ext4 rescue tool in my home after it crashed and I started to read the whole disk and create a image of it on the same filesystem, even though it warned against that, so my bad

0 Likes

#6

Ye and I do run an 13th Gen Intel® Core™ i7-13700H, the 13th and 14th gen have had some issues, not every model, so I’m not sure mine is even affected, it could be, and that could be the problem here

0 Likes

#7

Could you run the short smart test using sudo smartctl -t short /dev/nvme0 and then get the self-report data again - it may take a few minutes to run.

I do run an 13th Gen Intel® Core™ i7-13700H

From what I understand the issues with 13th and 14th gen cause the CPU to occasionally just do the wrong thing, like a bitflip. I wouldn’t rule it out completely, but I would expect issues caused by that to not happen more than once so easily.

0 Likes

#8

Another thing to check is the dmesg logs using sudo dmesg | grep nvme.

0 Likes

#9

Summary of the short smart test (I only added the last bit that was changed from previous output)

smartctl

Self-test Log (NVMe Log 0x06)
Self-test status: No self-test in progress
Num Test_Description Status Power_on_Hours Failing_LBA NSID Seg SCT Code
0 Short Completed without error 85 - - - - -

here is dmesg

dmesg

[ 1.873236] nvme 0000:01:00.0: platform quirk: setting simple suspend
[ 1.874010] nvme nvme0: pci function 0000:01:00.0
[ 1.910820] nvme nvme0: 20/0/0 default/read/poll queues
[ 1.917645] nvme0n1: p1 p2
[ 4.226094] EXT4-fs (nvme0n1p2): mounted filesystem xxxxxxxx-xxxx-4xxx-xxxx-9828e9ecd98b ro with ordered data mode. Quota mode: none.
[ 4.635238] EXT4-fs (nvme0n1p2): re-mounted xxxxxxxx-xxxx-4xxx-xxxx-9828e9ecd98b r/w. Quota mode: none.
[ 6.072355] block nvme0n1: No UUID available providing old NGUID

The power on hours are pretty weird, this system was installed in early August, and have been pretty much running non stop, but I guess it is hybernating the disk or something and doesn’t count those hours maybe

Could you make a function, so I could save my Session and Auto Save Session manually to a path of my choosing also? That would be an feature I would find worth renewing for, I’ve got trust issues with Auto Saving now (whether it is hardware or software in my case), maybe also have a flag/argument in the cli where I can choose the path of the files to restore, that would be nice

0 Likes

#10

Just to be sure I would run the long test as well, but that can take multiple hours (sudo smartctl -t long /dev/nvme0). Unfortunately I’m at a loss for any other causes of this, sorry.

0 Likes

#11

Sure I put on a long test as well, I’ll get back when it is done

I understand it is impossible to know what is causing it

Could you consider the feature where I can manually save those files to a place? Would be nice to do saving from both GUI and CLI, CLI could have option for both writing the file to fs or stdout so I can pipe it myself, and CLI could also have a load option for the files where it restore from a non-default path on start

0 Likes

#12

Doesn’t look like anything there either

smartctl

Self-test Log (NVMe Log 0x06)
Self-test status: No self-test in progress
Num Test_Description Status Power_on_Hours Failing_LBA NSID Seg SCT Code
0 Extended Completed without error 86 - - - - -
1 Short Completed without error 85 - - - - -

0 Likes

#13

If you want to keep backups of the session file the simplest thing would be to write a bash script that copies it from the default location - you can do this while ST is running as it saves the session every 30 seconds and on exit. Another way to get an extra session file is to use a sublime project - unsaved files are stored both in the sublime-workspace file and the main session file.

The specific functionality you’re asking for is unfortunately not compatible with how sessions are managed.

0 Likes

#14

Well that is was what I said I was going to do, copy it from its default location

I also said I noticed a bug when it didn’t save the file at all, the file was not there, in fact it was removed, despite I was creating new untitled files and wrote some stuff in them it was not created again, in this case there are no Auto Save Session file to copy, whether if its a hardware problem or a software problem I don’t really care, hence my requested feature so I know it is actually saved when I want

Do you mean it is not compatible to save or to load? I don’t see how that would be not compatible, could you elaborate? Its a function running with an interval that saves the file, if you can call that function manually with some parameters or make an copy of the function which takes some parameters to where to save instead, the memory that constructs the whole internal state and that is used to save the files should be possible to reuse to save somewhere else. But I understand my request to do this is not of any priority

Anyway I’m reverting back to an older build from 2021 (4107), this is the version I’ve been running the most without any problems, build 4169 was just something I recently tried, the bug could have come in any version between those two, or it might have always been there and it just never happened before, or it could be a hardware problem

0 Likes

#15

Do you mean it is not compatible to save or to load? I don’t see how that would be not compatible, could you elaborate? Its a function running with an interval that saves the file, if you can call that function manually with some parameters or make an copy of the function which takes some parameters to where to save instead, the memory that constructs the whole internal state and that is used to save the files should be possible to reuse to save somewhere else.

You can already manually save session data using a workspace file under Project > Save Workspace As…. Opening a workspace will restore the window and its unsaved files.

As for the session files you’d have to name 5 of them and doing so incorrectly would really easily result in data loss, so I don’t think adding the ability to control those files beyond where the data directory is makes much sense.

0 Likes