yourhead / s3

public info about s3
8 stars 7 forks source link

crash on migration #762

Closed yourhead closed 6 years ago

yourhead commented 6 years ago

A crash can occur during migration -- seems to happen on large files

yourhead commented 6 years ago

Crash can occur during any non-standard startup condition. It's easiest to repeat with a large file and many installed stacks.

The issue at play is the extension override API is causing stacks to load the library early (in this case during the migration process) -- then potentially start a new library load (when the migration finishes). Of course, only one library will remain loaded, the other is deallocated. The allocation/deallocation of the library triggers many malloc/frees inside the openSSL library. At some point this goes south.

It's not clear why the malloc/frees are causing problem, but fixing the root cause (the early/extra/overlapped library loads) ensures this condition never happens.

When the library has not yet loaded, then i shunt the extension override API to always return HTML. This should have no real consequences as the extension override will be re-evaluated at the time the page is published and saved.

It seems like the real source of the issue with the extension override is that RW can't decide who takes precedence: user, rw, plugin, stored file, or default. There are a lot of cooks in that kitchen and it seems like whenever any one of those things changes it forces the single UI for this info to update.

It seems clear that there should be a specified hierarchy. If this were the case it would eliminate the need for RW to query this value even before pages are loaded.

yourhead commented 6 years ago

Fixed in 3.5.5 beta 1