![]() ![]() It also avoids messing up when the pipes are dup'ed * Always open file descriptors 0/1/2 to avoid clobbering files In order to avoid calling multiple functions during initialization and to reproduce the bug easily, I decided to put several debug prints right in the beginning of the main() function, which is located in common-main.c in the case of git: int main(int argc, const char **argv) If somebody wants to follow my steps, here is the diff to make compiler happy: Through trial and error, as well as using hints from the hall (IRC channel), all compile time errors were fixed. However almost always there are undocumented pitfalls in such step-by-step tutorials, and I immediately encountered one of them: Setting up mingw32 toolchain went smoothly and I just started building. I've followed this step-by-step tutorial and in order to compile compatible git version I've selected this branch: Jun 03 20:16:51 (of course if you also are able to compile that git with symbols and all the stuff, it would be very nice) ActionĪfter that I decided to compile git straight from the source, so I'll be able to print variables of the interest "on the fly" directly to the console. Jun 03 20:16:30 what are you breaking today? ![]() Jun 03 20:16:24 x86corez: ollydbg should work on ROS. Jun 03 20:16:09 that's everything but standardized function. Jun 03 20:16:04 probably I would need an user-mode debugger. Jun 03 20:15:56 well, with such a name "xstrndup" it's not surprising it's its own implementation Jun 03 20:15:35 so I can't simply hook it xD But subsequently everything was not so obvious. The variable name suggests that the actual value is derived from argv - usually it contains the executable name in zero index. Jun 03 19:06:44 ok, so what's the values of argv0 and slash on windows vs. Jun 03 19:06:22 xstrndup returns NULL %-) Jun 03 19:06:02 argv0_path = xstrndup(argv0, slash - argv0) The question is why it's FALSE on ROS but TRUE on Windows. Jun 03 19:04:57 yes I know, I've seen the code yesterday. Once I obtained all this information I've sent some messages to the IRC channel: Jun 03 19:04:36 hbelusca: It was not too hard to locate the actual code block where unhandled exception happened: char *system_path(const char *path)Īnd argv0_path variable value is assigned by this code: const char *git_extract_argv0_path(const char *argv0)Īrgv0_path = xstrndup(argv0, slash - argv0) Please contact the application's support team for more information.įortunately git is an open source project, and it helped a lot in our investigation. This application has requested the Runtime to terminate in an unusual way. c, L i n e 2 3Į x p r e s s i o n : a r g v 0 _ p a t h P r o g r a m : C : \ P r o g r a m F i l e s \ G i t \ m i n g w 3 2 \ b i n \ g i t. Occasionally it displayed a broken message with an assertion: git.exe clone -v "" "C:\Documents and Settings\Administrator\Bureau\minocaos" But once you try git clone or even just git -version in most cases the console just remains empty. For instance, when you run git without additional parameters, it displays the help message in the console without any problems. Testing was done in the ReactOS Command Prompt, external symptoms of the problem were rather ambiguous. Since ReactOS target platform is Windows Server 2003, Git version 2.10.0 was chosen for the investigation - it's the last one supporting Windows XP and 2003. Jun 03 18:53:34 (the git assertion part only). Jun 03 18:53:13 That would help having a good ROS self-hosting system with git support. The story begins with the following messages from the ReactOS Development IRC channel: Jun 03 18:52:56 Anybody want to work on some small problem? If so, can someone figure out why this problem happens on ReactOS? :D Let me introduce the main figures in this story who actually fixed the bug preventing Git from running in ReactOS - the French developer Hermès Bélusca-Maïto (or just Hermes with hbelusca nickname) and of course me (with x86corez nickname). This article is an english version of my very first article on russian. Quite interesting case of fixing the problem in ReactOS in which I was directly involved.Possibility of building ReactOS in ReactOS.Lack of technical articles in the ReactOS hub.This is my first english article on Habr which I made due to several reasons: My name is Stanislav and I like to write code. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |