Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
cache system
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
5 Jun 2015 at 15:12 UTC
Updated:
3 Dec 2015 at 17:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
berdirNote: Until #2501183: LocaleLookup cache ID is using numeric indexes of the roles field, not role ID's is fixed, you actually need 100 roles or so for a user to trigger this ;) But it will be easier after that.
Comment #2
alexpottI think this is a major bug given that we have no limit on cid length.
Comment #3
jhedstromWe actually have a test now that is throwing this exception, but not failing. #2535774: Error handler swallows catchable fatal errors surfaces this failing.
Comment #4
jhedstromProbably not the best test in the world, but it illustrates the hidden exception.
Comment #5
jhedstromThis exception is actually not due to cid length, but rather to invalid characters. Hashing here would solve both length and characters.
Comment #6
catchComment #8
jhedstromThis adds a more appropriate integration test of the cache collector. I added a
@todobecause I'm not sure why a cache get would still work after the destruct method is called. This method is what writes to the semaphore table (by way of lock), so we want that in the test.Comment #10
jhedstromThis adds a cid/lock normalization method. It is copied directly from
DatabaseBackend, and might make more sense as a static utility method somewhere.Comment #11
dawehnerNevermind my review ... you copied existing code from the cache backend, so both points are not valid.
IMHO we usually don't require to have mb enabled, right? I guess when mb is not enabled we could just go with the hash directly?
gg
Do we really need a cryptographic hash? Isn't it enough to go with something like sha512?
Comment #12
berdirThere's an existing issue about mb_check_encoding() that results in completely broken sites without mbstring, so I actually that we shouldn't add it in more places until that's fixed.
If we move that code into a helper somewhere then we can discuss to refactor/fix that in the existing other issue but if not, then we should do it correctly i think.
Comment #14
dawehnerSee #2560123: mbstring_check_encoding() in cache database backend doesn't actually work ...
Comment #15
xjmLet's change this to assert a 200 instead. Asserting that there is no error text is not a reliable way to provide coverage as it can yield false positives.
Comment #16
effulgentsia commentedDiscussed with @xjm, and we agree that fixing conditions that trigger exceptions is a great thing to do prior to release, so long as doing so isn't disruptive, which this doesn't appear to be.
Comment #17
jhedstromre #15: That test was mainly meant to illustrate the error existed (in our current tests, before tests for this issue were specifically added). I'll reroll to check for a 200.
Comment #18
jhedstromNevermind, the original error isn't caught by checking for a 200 (that's one reason it has remained hidden in our tests). It properly fails once #2535774: Error handler swallows catchable fatal errors is applied. We can either leave this explicit check for the error message, or remove it entirely since there are now explicit tests here?
(Setting to RTBC to get xjm's attention)
Comment #21
catchGiven this unblocks the error handler issue, committed/pushed to 8.0.x as is.
Let's improve the test coverage in the other issue though.