Summary
Adding a dependency in libraries.yml which references itself causes apache to crash (repeatedly 'core dumped')
to reproduce:
in - e.g.- THEME.libraries.yml add:
mylibrary:
css:
theme: css/style.css: {}
js:
js/script.js: {}
dependencies:
- core/jquery
- THEME/mylibrary
notice the dependency on itself.
expected
exception / error / warning
Instead
apache keeps trying
20x
[core:notice] [pid 25323] AH00051: child pid 25785 exit signal Segmentation fault (11), possible coredump in /etc/apache2
System Details
ubuntu 14.4
apache 2.4.7
php 5.6.33-1+ubuntu14.04.1+deb.sury.org+1
Zend Engine v2.6.0
Zend OPcache v7.0.6-dev
drupal 8.4.4
Comments
Comment #2
rop commentedComment #3
cilefen commentedHave you got any suggestions for what should happen instead?
Comment #4
rop commentednot how to technically implement it best, no, but like I said, you'd expect a warning or an error. No?
I mean obviously it is a silly thing to do but an easy mistake to make.
It took me quite some effort to find what caused apache to halt.
It should be possible to catch such an error before.
like within Drupal\Core\Asset\LibraryDependencyResolver
Comment #5
rop commentedComment #6
cilefen commentedSo the issue is that although there isn't a use-case, something should detect the self-reference and throw an exception instead. Is that accurate?
Comment #7
rop commentedWell you could read it like that I guess.
I think it could be usefull to help prevent an easy to make mistake or at least resolve it more quickly.
more like a safety rail perhaps.
I mean sure we can't prevent every mistake from happening but I think this one can be caught in drupal quite easily before it gets a lot more difficult to debug.
But read it as you like. I thought it was worth mentioning.
It think it would be nicer if you'd get a message instead of a blank page with no meaningfull errors in any of your logs.
I don't think you would call any error catching a 'use case' ? More like 'user friendly' perhaps.
Comment #8
cilefen commentedI mean that there is no valid use case for a self-referencing library definition.
Comment #9
rop commentedI understand and there is not of course, you are right.
That was not the point though.
Comment #10
cilefen commentedI think we are saying the same thing.
Comment #11
rop commentedI think we are saying the same thing.
:-)
Comment #15
rop commented