Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Re-checking the ReactOS project - a large report (viva64.com)
79 points by AndreyKarpov on April 2, 2013 | hide | past | favorite | 18 comments



From the title, I was expecting to read a review of ReactOS looking at whether it would be viable as a day-to-day OS. This leaves me a little bit disappointed.


Okay, I'll write that review:

No.

It's unstable, it lacks support for any filesystem but FAT32, it lacks meaningful driver compatibility with Windows, it doesn't support multiple users, it doesn't support major APIs like thread pools/WMI/WDDM, its TCP stack is nascent, there is no SMB support...

I want this project to succeed, but it needs a lot of love to get there.


One of the NULL dereference diagnostics looks spurious:

  DomainName = &PolicyAccountDomainInfo->DomainName;
  SidNameUse = (PolicyAccountDomainInfo != NULL ?
                SidTypeGroup : SidTypeUser);
This does not, in fact, dereference PolicyAccountDomainInfo, but simply performs some pointer arithmetic. It’s bad style, agreed, but should be entirely harmless to execute.


Doing anything with invalid pointers is UB in C++. It might be fine now, but it might not work in 5 years, when compiled with a newer compiler.

E.g. a sufficiently clever, malicious compiler could reason that because you are doing pointer arithmetic involving PolicyAccountDomainInfo->, the pointer must be valid and then it might get rid of the null check and branch in the second line. I remember not so long ago there was a vulnerability in Linux kernel because of exactly this kind of "malicious" optimisation performed by gcc.


As others have commented, the Linux incident involved an actual dereferencing of the pointer.

The way I read http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf top of page 89 and footnote 102 on that page is that this is NOT undefined behavior in C, and though I haven’t checked the corresponding language in the C++ standard, I would think it’s not undefined in C++ either.



Exactly, though in the case I bet you're remembering, the pointer was dereferenced before the null check so the latter was optimized out.

http://lwn.net/Articles/342330/


Are there good low-end tools for C/C++? I've been doing iOS development and I recently decided to write some of my code in C++ so it would be portable to Android and Blackberry.



If you’ve been working on iOS you already have it installed http://clang-analyzer.llvm.org


Yes, Xcode with clang is really nice. After reading Carmack's blog, however, I'm sure more can be done. He actually like's Microsoft's compiler. Wonder if it's worth running code through it?


Hmm, don't ReactOS developers use IDEs? Or do C++ IDEs lack advanced static analysis features?


It depends. Some of us use Visual Studio. Some of us use gedit.


If you do use Visual Studio, it would be interesting to know what do you think about its static analysis (or absence of)


I might be completely wrong but Visual Studio's static analysis for C++ is not very smart


Interesting project. Is it fairly easy to get up and running as a contributor?


Yes! There's a single build environment (RosBe) to download (for both Windows and *NIX), then you just need to do an svn checkout (svn is included in the environment), and then make a patch and submit it for some bug.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: