Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
Google Chrome Chromium Microsoft Open Source Programming

Chromium Being Ported To VC++, Scrubbed of Compiler Bugs 93

jones_supa writes: Moving a big software project to a new compiler can be a lot of work, and few projects are bigger than the Chromium web browser. In addition to the main Chromium repository, which includes all of WebKit, there are over a hundred other open-source projects which Chromium incorporates by reference, totaling more than 48,000 C/C++ files and 40,000 header files. As of March 11th, Chromium has switched to Visual C++ 2015, and it doesn't look like it's looking back. The tracking bug for this effort currently has over 330 comments on it, with contributions from dozens of developers. Bruce Dawson has written an interesting showcase of some VC++ compiler bugs that the process has uncovered. His job was to investigate them, come up with a minimal reproduce case, and report them to Microsoft. The Google and Microsoft teams get praise for an excellent symbiotic relationship, and the compiler bugs have been fixed quickly by the Visual Studio team.
This discussion has been archived. No new comments can be posted.

Chromium Being Ported To VC++, Scrubbed of Compiler Bugs

Comments Filter:
  • Why? (Score:1, Insightful)

    by guruevi ( 827432 )

    Most developers know VC++ compilers are full of bugs and weird stuff. Why didn't they just stay with the compilers that are well supported across all platforms?

    • Re:Why? (Score:4, Interesting)

      by Anonymous Coward on Friday March 25, 2016 @10:36AM (#51776217)

      All compilers have 'weird bugs and stuff' - staying with compilers 'that are well support across all platforms' is another matter altogether. I'm not sure why you are asserting the fact that VC++ has bugs - your text reads as if you are trying to convey it's the only compiler that does contain bugs, therefore you can't fathom as to why on earth a development team would move from one dev platform to another because of the bugs. Because it's Microsoft, it must be shit right? That's what you're saying?

      • Re: (Score:1, Insightful)

        by guruevi ( 827432 )

        I'm not saying they are the only compiler with bugs, it's just that VC++ is known (at least in academia that write shitty software to begin with) to generate a lot more errors/bugs for software that's not directly Win32 related than eg. GCC or Clang. Not sure what the rationale was behind going to a closed software compiler with possible patent issues/assertions.

        • Re:Why? (Score:5, Insightful)

          by Anonymous Coward on Friday March 25, 2016 @11:44AM (#51776729)

          A lot of times compiler bugs fall into categories that aren't bugs at all. 1. Stuff that people think is standard C, but it's really a GCC-ism. 2. Stuff people didn't know about standard C, such as the order of argument evaluation being unspecified. 3. Default settings on one compiler being forgiving and/or handling uninitialized variables in a particular way, and the other compiler not being so forgiving.

          I can't remember who said so first, but it's generally given that the first people to scream "compiler bug" are usually doing something wrong with their code. I wouldn't be surprised if a lot of the people in academia who you say write shitty software are doing that kind of thing. "Oh! compiler bug!" Nope. You just had something that "worked on my machine" and now it doesn't.

          • Re: (Score:2, Informative)

            by Anonymous Coward

            I have ported around thru a bunch of different compilers over the years a few codebases.

            I can count on one hand the number of VC compiler bugs I have come across. They are seriously nasty to root out as my assumption is the compiler is usually right. MS usually had it fixed in under a week with a hotfix. When you buy visual studio you get some fairly top notch support.

            Now the other bugs. I lost count of. All of those were usually a misunderstanding of how C/C++ works. A few cases were like you said GC

            • by Anonymous Coward

              >> Also most optimizer compiler bugs come down to you passing in the same memory space as two different parameters into a function. Dont do that.
              This is called memory aliasing. And compilers are usually pessimistic about optimizing when memory references can't be identified to be of each other.
              Just do not use "restrict" keyword if you are not sure. https://en.wikipedia.org/wiki/Restrict

        • by armanox ( 826486 )

          I don't know, GCC has a lot of quirks that make it a pretty poor standard to code by. By making it compile with VC++ they open the door to elminiting the GCC workarounds, and possibly open the door for more platforms. As someone who has tried to port software in the past, GCC is really a thorn in my side.

          • by tlhIngan ( 30335 )

            I don't know, GCC has a lot of quirks that make it a pretty poor standard to code by. By making it compile with VC++ they open the door to elminiting the GCC workarounds, and possibly open the door for more platforms. As someone who has tried to port software in the past, GCC is really a thorn in my side.

            Another benefit is using multiple compilers helps find tricky bugs due to assumptions in the programming language.

            Enabling all warnings can easily help find those parts of code that are iffy but look normal

    • I expect it is a point of optimization.
      While VC++ may have a bunch of bugs, it may be due to over optimization, for faster performance on Windows Platforms.

      • by Megol ( 3135005 )

        Microsofts compilers have always been conservative when it comes to optimization. And frankly in most cases a smart compiler using the best optimization possible* will be at most a few percentages faster than the one that only does basic optimizations (like register allocation, common subexpression elimination etc.).

        GCC and Clang/LLVM have switched to the idea that all undefined types of code shouldn't produce what is likely to be the programmers intent like C compilers of old, nor should they flag undefine

    • If an opensource developer must target Windows he or she can use clang with VS 2015 community edition [microsoft.com] just fine or vim?

      Still it is good to use a standards compliant api and c++ that is not tied too heavy on one product.

      In other news
      But the big elephant in the room is the switch to VC2015 means the death of XP and Vista.

      Is Chrome dropping support for XP finally? Will these users get ransomware from using an unpatched and unsupported browser now if Chromium (the foundation of Chrome) is not compatible?

    • Most developers know VC++ compilers are full of bugs and weird stuff. Why didn't they just stay with the compilers that are well supported across all platforms?

      I do cross-platform development for code that has to run on everything (literally). It's plain C, not C++, so I'm saved from seeing various bugs by that. The VC++ compilers are some of the least buggy compilers I've ever used. I've actually never found a compiler by in VC++ 6.0 in nearly 20 years of use. In contrast, gcc is one of the buggiest (mainstream) compilers I've used, every new release seems to contain a new collection of code-generation bugs.

      In terms of more obscure compilers, even gcc pales i

  • I thought this wasn't allowed and they had to choose Linux or OSX
  • by mrthoughtful ( 466814 ) on Friday March 25, 2016 @10:26AM (#51776169) Journal

    Can't see anything but your reflection..

  • by QuietLagoon ( 813062 ) on Friday March 25, 2016 @10:33AM (#51776211)

    ...there are over a hundred other open-source projects which Chromium incorporates by reference, totaling more than 48,000 C/C++ files and 40,000 header files....

    That's a lot of files for a single, relatively trivial application..

    • Re:That's huge! (Score:5, Insightful)

      by Carewolf ( 581105 ) on Friday March 25, 2016 @11:16AM (#51776505) Homepage

      Chrome is not an application. It is an entire operating system, that just happens to include a browser. Think of it as ChromeOS VM.

      • by Dragonslicer ( 991472 ) on Friday March 25, 2016 @11:44AM (#51776733)

        Chrome is not an application. It is an entire operating system, that just happens to include a browser.

        How does it compare to emacs?

        • /hat tip

        • It's GUI-based instead of ncurses-based, and is scripted with Javascript instead of Lisp.

          • by Dragonslicer ( 991472 ) on Friday March 25, 2016 @12:08PM (#51776931)

            It's GUI-based instead of ncurses-based

            Moderate advantage to Chrome on that one, I think.

            and is scripted with Javascript instead of Lisp.

            Err, we'll call that one a draw.

            • Emacs is GUI based, it's only ncurses based if you're using it from a terminal. For GUI is it not tied to one particular type of GUI either.

              Lisp is a real language with lots of history and theory, JavaScript is a hack, it's not a draw it's a clear advantage to Emacs there.

              • by Anonymous Coward

                Emacs Lisp is sort of a special beast. It only looks like Lisp to people that don't program in other Lisp varieties.

              • by fnj ( 64210 )

                Emacs is GUI based, it's only ncurses based if you're using it from a terminal.

                Or if you are using the one built without X support. I wouldn't have that bloat on my system for a fucking TEXT EDITOR. Not even on a system which has X; let alone a server with no X.

                • I really like my Aquamacs though. Also having multiple open windows is nice. Using it only from a terminal would feel clumsy, even though that's what I used to do.

      • Chrome is not an application.

        https://www.chromium.org/Home [chromium.org]

        .
        "...Chromium is an open-source browser project ..."

        • Chrome is not an application.

          https://www.chromium.org/Home [chromium.org]

          .

          "...Chromium is an open-source browser project ..."

          Which is why I weighted my words and went with Chrome which is mainly a branded binary from the Chromium project. Where "Chromium" can be either the application or the project.

    • by Anonymous Coward

      There's nothing "relatively trivial" about the modern web browser. A modern JIT optimizing javascript engine and basic class libraries alone make it as complicated as many compilers. DOM implementation + layout + rendering is also hugely complex. Quick and efficient local caching, plus history recall requires the complexity of a mid-range database server.

      There are many more parts I haven't even touched on.

  • It used to be full of bugs, but they bought some of the best people. Working on Webkit is a pain in the arse. Huge compile times, and no documentation worth talking about.
  • How about they fix all the crappy unaligned casts all over the place so I can actually compile the source on alternative architectures and have it work (among other issues with that code that pose difficulties for cross platform work).
    • The compiler only targets x86, used to do arm too, look at embedded compilers if you want to see some horrible bugs.
      • Yes, it does... that was exactly my critique... I wish they hadn't gotten lazy and only targeted x86 because it works pretty well.
      • by DaHat ( 247651 )

        No it doesn't. At last check it supports building code which targets x86, x64, ARM and ARM64.

    • > they
      You're free to provide these fixes yourself if you care.
      • Well, I could you're right. But it would be a lot of work because the code is littered with issues (unless you only care about x86). But there is also FireFox, which compiles and runs quite well on a variety of architectures with minimal patching aside from a few optional dependencies that I just leave out. I don't have a strong enough need for it to DIY (and it could be a fair point if people say that just proves that they don't need to target anything else, but IMO if they had just done it from the sta
      • I don't know if you've looked at what it takes to set up a developer environment for Chromium, but that [chromium.org], to me, seems like a hell of a lot of time investment. It might be worth it if you really wanted something done, but for me that's crossing the line into "I want to be paid for that kind of work," and verging on, "You couldn't pay me to work on that." I don't have a lot of comparative experience with complex build environments, and it does seem to be well documented, but still...it seems quite the ordeal.

        • I'm not going to look, but simply knowing that the thing work on multiple systems and have a gazillion of dependencies, I'm certain it is a nightmare to set up.
          But that's the point; if someone who need these big changes to happen won't go through it (and I completely understand why, it's not a reproach), asking for the people that didn't need these changes to work on them is kinda rude.
        • quoting from that link:

          an account with sudo access You need root access to run the chroot command and to modify the mount table. NOTE: Do not run any of the commands listed in this document as root â" the commands themselves will run sudo to get root access when needed.

          There should be some harsh physical punishment for the idiots that put sudo calls in Makefiles. And for sudo-heads in general. Why would you need root just to build some fucking binary, should it be a hello-world or your browser/os of

    • Just fix your crappy hardware to support unaligned access.
  • by Anonymous Coward

    So Chromium is switching from an older version of VC-- to a newer version and this is considered news for nerds? WTF /.?

  • Mozilla Firefox has a "bug" open for same purpose and there are several reasons for the switch, build performance increase and increased security.

    https://bugzilla.mozilla.org/s... [mozilla.org]

Every nonzero finite dimensional inner product space has an orthonormal basis. It makes sense, when you don't think about it.

Working...