Repository navigation
zos: successfully build c-ares codebase on z/OS systems - #390
Conversation
* Change to build c-ares on z/OS. * Change to build unit tests. * Fixed formatting, removed MVS check from ares_setup.h and added a check to ares.h. * Change to build c-ares on z/OS. * Change to build unit tests. * Fixed formatting, removed MVS check from ares_setup.h and added a check to ares.h. * adding the remaining z/OS changes. * Made minor changes to follow code guidelines and optimize indexing. * Minor fixes to code. * Minor code style fix. * Move MVS specifc includes to top. * Add MVS check to include a header file. Co-authored-by: DHRUMIL <DHRUMIL@ZOSCAN2B.torolab.ibm.com>
* Change to build c-ares on z/OS. * Change to build unit tests. * Fixed formatting, removed MVS check from ares_setup.h and added a check to ares.h. * Change to build c-ares on z/OS. * Change to build unit tests. * Fixed formatting, removed MVS check from ares_setup.h and added a check to ares.h. * adding the remaining z/OS changes. * Made minor changes to follow code guidelines and optimize indexing. * Minor fixes to code. * Minor code style fix. * Move MVS specifc includes to top. * Add MVS check to include a header file. Co-authored-by: DHRUMIL <DHRUMIL@ZOSCAN2B.torolab.ibm.com>
|
looks pretty good. Just need a couple of fixups.
Then a question ... why the default_malloc override? Are there actually instances where you've seen c-ares call malloc(0) and it matter? |
Yes, on z/OS malloc(0) returns 0, while on others it returns a valid pointer. As it is used in the linked list overriding it was safer as the other platforms would not be affected and this also allows future code to be added without worrying about z/OS functionality. Also for CARES_USE_LIBRESOV, I have added a check for ZOS in CMakeLists.txt as per your request, but I'm confused as to how to add a check for z/OS in configure.ac where CARES_USE_LIBRESOV is being set for apple. Could you help out with it? |
|
|
|
I haven't seen the CMakelists.txt modification, once that is added to this PR, I can then tell you what needs to happen in autotools to do the equivalent check... |
|
Regarding autotools support for z/OS, I'd think in configure.ac after this: you could use |
Can you be more specified in regards to the test failures? Is there a backtrace? Can you show what line in the tests they failed on? We'd need to know the code path if it is crashing due to this to know if its something in nodejs's assumptions or something deep inside c-ares. |
|
Also, does the c-ares test suite work for you on z/OS the way it is right now (without the malloc workaround)? I just performed a local hack to have ares_malloc(0) return NULL always and print out a message if this condition is hit. At least none of the conditions in the test suite appear to have hit this at all. That doesn't mean its not possible in some code path not in the test suite, of course. |
|
Yes, I ran the c-ares test-suite with and without the malloc workaround and there are no hits in either cases. I can provide you with a more detailed analysis of the failure soon. |
|
I'm going to go ahead and merge this and treat the malloc(0) as a different issue. Infact, I'll probably follow-up with a commit to make the default malloc implementation return NULL on 0 always to catch any possible bugs. Maybe we can get a report of an issue on another system with NodeJS. |
Port c-ares to z/OS. Fix By: Dhrumil Rana (@dhrumilrana)
This PR is for building c-ares on z/OS systems. The PR makes changes couple of header files to introduce MVS checks for z/OS specific code.