Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
Operating Systems Linux

Linus Torvalds Injects Tabs To Thwart Kconfig Parsers Not Correctly Handling Them (phoronix.com) 117

Michael Larabel reports via Phoronix: Within yesterday's Linux 6.9-rc4 release is an interesting little nugget by Linus Torvalds to battle Kconfig parsers that can't correctly handle tabs but rather just assume spaces for whitespace for this kernel configuration format. Due to a patch having been queued last week to replace a tab with a space character in the kernel tracing Kconfig file, Linus Torvalds decided to take matters into his own hand for Kconfig parsers that can't deal with tabs... Torvalds authored a patch to intentionally add some tabs of his own into Kconfig for throwing off any out-of-tree/third-party parsers that can't correctly handle them. Torvalds added these intentional hidden tabs to the common Kconfig file for handling page sizes for the kernel. Thus sure to cause dramatic and noticeable breakage for any parsers not having tabs correctly.
This discussion has been archived. No new comments can be posted.

Linus Torvalds Injects Tabs To Thwart Kconfig Parsers Not Correctly Handling Them

Comments Filter:
  • Thus sure to cause dramatic and noticeable breakage for any parsers not having tabs correctly. What is "dramatic" about it? Is adding that "dramatic" an AI writing style or is it a subtle thing which I as a non-native English speaking person don't grasp?
    • by caseih ( 160668 )

      Well he wants the breakage to be noticed so that coders will fix their parser bugs. So in this case, yes, "dramatic" is an appropriate word. Maybe not the best choice, but it works. If the breakage was subtle and minor, it might go unnoticed by some of the authors of the bad parsers. At least that's how I read it.

    • Sometimes a creating a hard break is the only way to get people to make the necessary code updates.

      Iâ(TM)ll intentionally do this in my own code sometimes, so I know what I need to be fixing. Treat this a pressurisation test.

    • by gweihir ( 88907 )

      Nothing "dramatic" here. Just stupid writing that tries to make everything earth-shattering, as is so common today,

  • Can anyone give a reference for Unix on tabs and spaces? Foud this while trying to make a python point,"Tabs or spaces, but you have to handle both".

    Tabs are replaced (from left to right) by one to eight spaces such that the total number of characters up to and including the replacement is a multiple of eight (this is intended to be the same rule as used by Unix). The total number of spaces preceding the first non-blank character then determines the lineâ(TM)s indentation. Indentation cannot be split

    • by gweihir ( 88907 )

      man isspace_l

    • IME many things expect only spaces, but most config files with lots of spaces will tolerate tabs. The really core classic UNIX stuff either expects spaces or uses some other delimiter entirely, and possibly even doesn't have indentation or comments. It was designed for brevity.

  • by gweihir ( 88907 ) on Monday April 15, 2024 @10:16PM (#64397152)

    These people must be the most stupid or lazy fucks. Obviously, tabs are whitespace. Obviously, you need to be able to handle them in a config file.

    I am fully with Linus on this one. These idiots need to clean up their act.

  • by szo ( 7842 ) on Tuesday April 16, 2024 @01:30AM (#64397338)

    Is there more than one parser for KConfig?

    • Is there more than one parser for KConfig?

      The other's were written by a group who call themselves "The nights who saaaaay NIH"

      • *knights. WTF does english have words which sound the same but are spelled differently.

        • 1. We stopping saying the letters, for laziness.
          2. We didn't update the spelling, for laziness.

          Nothing is stopping you from going around saying "K'Nih-gh (gurgle sound)-T". Or go with writing "nite" for both.
          But what about that vowel-consonant-e thing? English should have a way of denoting a long letter without having to snuggle up to a consonant and have a third-wheel e tagging along, "I'm silent," Yeah, that's what they all say at first. But you weren't, were you, "so called" "silent"-e? It took those sno

          • Nothing is stopping you from going around saying "K'Nih-gh (gurgle sound)-T". Or go with writing "nite" for both.

            Shame. Shame is stopping me from saying K'nights :-)

        • English is my first language (and only, as I suck at learning more), but I have trouble spelling... stuff like this. I always try to look up, comic book sounds e.g. argh and the like. A Monety Pythyon quote will tend to be confusing to non-native English speakers, and honestly, I find it hilarious, but I'm not sure "I get it". I love British comedies but I don't get everything the first time.

          As for the article, seems like an easy way to prevent lazy parsing . I would hope Linus has laid out some idea/plan

          • Yeah I'm a non-native speaker. ... And thanks for not pointing out the additional grammatical mistake I made. XD

  • by shibbie ( 619359 ) on Tuesday April 16, 2024 @02:06AM (#64397368)
    I did a similar kind of thing a few years ago.
    Big project, warned another dev not to take some lazy ass approach and creating a God object instead of doing it properly.
    I added a unit test that counted fields under some circumstances.
    Test would run fine even in dev scenarios, the minute it made it to main line CI all hell broke loose.
    Test wasn't pointless btw, it said something akin to "Don't add new fields to this object, you'll break the flaky deserialisation in (external system) and you'll also cause issues with size of the object in (xyz scenarios)."
    That developer was exceptionally pissed with me because his feature didn't go out that sprint, had it done it would have destabilised the flaky as fuck anyway tech debt ridden prod system relied on by thousands of people, so he had to change his solution since the error was now visible to all other project devs. That's what Linus should have done and blocked it from mainline merge.
  • The link does not point to the proper commit ("Kconfig: add some hidden tabs on purpose")on either Phoronix or Slashdot. Here's the proper link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d5cf50dafc9dd5faa1e61e7021e3496ddf7fd61e [kernel.org]
  • If itâ(TM)s documented then Linus is absolutely free to make changes to a file so that it is in the same format with the same meaning before and after the change. Doesnâ(TM)t exactly sound like a world moving change to me, a parser that cannot handle tabs should be changed in a very short time.
    • by ledow ( 319597 )

      If it's undocumented, third-party integrators should be asking for such and/or KNOWING that their integration could break at any time and that they should therefore do a lot more sanity-checking.

  • Small brain: Four spaces
    Large brain: Tabs
    Galaxy brain: Both

A committee takes root and grows, it flowers, wilts and dies, scattering the seed from which other committees will bloom. -- Parkinson

Working...