Can "which" in the sentence modify a remote subject?

I am working on a research paper, and would like to know whether the following sentence is grammatically correct

"Dependency bugs are pervasive, which manifest whenever a piece of code accesses a missing asset, e.g. modules, libraries, or file names."

Above "dependency bugs" is a common name referring to a kind of software defects. My question is that, can "which" in the sentence modify the remote subject, namely "dependency bugs", or maybe "which" can only modify "pervasive" (which would become a grammar issue as "pervasive" is an adjective).


Solution 1:

The phrase that begins with "which" modifies the phrase that precedes it. Therefore, the sentence is ungrammatical, because "manifest" has a singular subject: "[The fact that] dependency bugs are pervasive."

A correct sentence with similar syntax would be: "Dependency bugs are pervasive, which is why we are careful to..."

The real problem here is that you're trying to link two complete and separate sentences with "which."

"Dependency bugs are pervasive" - that's a complete sentence.

"Dependency bugs manifest whenever..." - that's another complete sentence.

You can join these two ideas, but because they're separate, one should be included as a parenthetical: "Dependency bugs, which are pervasive, manifest whenever..."