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

rOprOprOp created an issue. See original summary.

rop’s picture

Issue summary: View changes
cilefen’s picture

Have you got any suggestions for what should happen instead?

rop’s picture

not 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

rop’s picture

Issue summary: View changes
cilefen’s picture

So 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?

rop’s picture

Well 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.

cilefen’s picture

I mean that there is no valid use case for a self-referencing library definition.

rop’s picture

I understand and there is not of course, you are right.
That was not the point though.

cilefen’s picture

I think we are saying the same thing.

rop’s picture

I think we are saying the same thing.

:-)

Version: 8.4.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Branches prior to 8.8.x are not supported, and Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev
rop’s picture

Status: Active » Closed (won't fix)