Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#361 closed defect (fixed)

chrome: settings lost if browser crashes

Reported by: pbosakov Assignee:
Priority: P2 Milestone: Adblock-Plus-1.8-for-Chrome-Opera-Safari
Module: Platform Keywords:
Cc: smultron45@…, trev, greiner Blocked By:
Blocking: Platform:
Ready: no Confidential: no
Tester: Verified working: no
Review URL(s):

http://codereview.adblockplus.org/5113028861231104/

Description

Environment

Windows XP SP2
Chrome 34.0.1847.116 m
Adblock Plus 1.7.4
Bulgarian list+EasyList

How to reproduce

  1. Run Chrome on a PC with a limited amount of RAM and no swap file
  2. Use Chrome until it crashes due to low memory (e.g. opening too many tabs)
  3. Restart Chrome

Observed behaviour

Adblock Plus settings (filter subscription, etc.) lost

Expected behaviour

Adblock Plus should retain its settings after a browser crash, like all other Chrome add-ons do.

Change History (12)

comment:1 Changed 6 years ago by mapx

  • Cc smultron45@… added

comment:2 Changed 6 years ago by mapx

  • Priority changed from Unknown to P2

comment:3 Changed 6 years ago by mapx

  • Summary changed from settings lost if browser crashes to chrome: settings lost if browser crashes

comment:4 Changed 6 years ago by trev

  • Cc trev greiner added

comment:5 follow-up: Changed 5 years ago by greiner

  • Resolution set to worksforme
  • Status changed from new to closed

I tested different kinds of low-memory scenarios but couldn't reproduce this issue. For instance with the following test setup I was able to crash Chrome and Adblock Plus but the settings were always left intact.

256MB RAM (no paging file)
Windows XP SP3
Chrome 34.0.1847.116 m
Adblock Plus 1.7.4

@pbosakov Have you checked whether Adblock Plus was the only extension that loses its settings? If yes, could you please list your extensions and indicate which of those (if any) suffer from the same issue?

comment:6 in reply to: ↑ 5 ; follow-up: Changed 5 years ago by trev

Replying to greiner:

@pbosakov Have you checked whether Adblock Plus was the only extension that loses its settings? If yes, could you please list your extensions and indicate which of those (if any) suffer from the same issue?

That's unlikely - not too many extensions use the FileSystem API, and localeStorage probably isn't affected.

Did you try crashing (killing?) Chrome after changes like subscription update or disabling a subscription?

comment:7 Changed 5 years ago by pbosakov

Thanks, now I notice that indeed it does not happen every time. Apparently there are other factors involved. I will let you know if I find a sure way to reproduce the issue.

comment:8 in reply to: ↑ 6 Changed 5 years ago by greiner

  • Component changed from Unknown to Platform
  • Resolution worksforme deleted
  • Status changed from closed to reopened

Replying to trev:

Did you try crashing (killing?) Chrome after changes like subscription update or disabling a subscription?

With only a few MB left in RAM and toggling a subscription repeatedly off and on the extension eventually crashes (not necessarily the whole browser) and on restart all filterlists are gone while other settings (those stored via localStorage) are still there.

In my tests I was able to reproduce this behavior on each try and therefore I reopen this issue and continue my investigation based on that.

comment:9 Changed 5 years ago by greiner

  • Review URL(s) modified (diff)
  • Status changed from reopened to reviewing

comment:10 Changed 5 years ago by trev

  • Resolution set to fixed
  • Status changed from reviewing to closed

comment:11 Changed 5 years ago by trev

For reference, the analysis performed by greiner indicated that truncating a file makes Chrome write all pending changes to disk whereas an actual write operation kept the data in cache and only wrote it to disk at some later point. Our code overwriting a file was originally calling truncate(0) and writing the data then - a crash after the write operation would cause the cache with the file data to be lost and the file would stay at zero size. The new code is writing the data first and only truncating the file after that, it no longer seems to suffer from this issue.

Version 0, edited 5 years ago by trev (next)

comment:12 Changed 5 years ago by trev

  • Milestone set to Adblock-Plus-for-Chrome-Opera-Safari-next
Note: See TracTickets for help on using tickets.