-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scotty Improvements #1&2 - modernize build system, fix configure for -address and -port #26
Comments
At this moment I have two branches in my clone of FlightAwares Scotty repository which build on Debian Jessie, FreeBSD 11 and Mac OS X Yosemite with Tcl stubs enabled.
Some of the included tests for Tnm run, sunrpc beeing notably an exeption since it segfaults.
Interestingly, tkined segfaulted on a FreeBSD w/o X-org installed in the call to TkpGetSubfonts(), I was able to contact J. Schönwalder and Mark Newnham. Ideas is to merge the work of Mark |
At this moment I have a fork of the FlightAware scotty repository which hopefully complies with the Scotty has been split into two individual directories: tnm and tkined. Inside each directory you can do:
Tnm has received most love, you can run make test to run the testsuite, which should terminate successfully on Debian jessie, FreeBSD 11 and Mac OSX 10.10.5. The TODO file in each directory lists all problems encountered with the software, there will be much |
On Tnm::udp:
In case 2. it is supposed to use Note that the remote data The very simple approach of my patch is to:
Notes:
|
I just created a pull reqest with what I think is a completion of the given tasks. Scotty needs some love though, but with the new build this should be easier to manage now. For the upd bounty I have ideas for alternative implementations/funcionality, but maybe you try this |
It needs some cleanup. I was going through the commits and noticed that there were some places where files were moved to backup files, and then new copies of files inserted. There's three backup files actually checked in to the repo: tkined/generic/tkiPort.h~ Can you clean that up, or at least verify that noting of value was lost? |
Oh! Fixed that one, nothing lost here. Will countercheck right now, if all files are here against the original version. |
"make test" in Tnm should be pulling in the version in the source tree, not the installed version, because that's what you're testing.
|
Files are all there. "make test": The original scotty works that way, it explicitely requires you to install first. The reason is, you need However I think you are right and will rewrite this part of the Makefile accordingly. Do you think Note: nmtrapd seems not to be used by the tests. |
Ah, OK. There's a "make check" that seems to run out of the current directory, but it is SEGV-ing in scotty for me. $ make check Stop. |
That is, because it uses the C - scotty. C - scotty currently segfaults, I have added tclscotty to |
Seems like there's a bit of work to do on this still. |
Yes, most of the items in the TODO files are already present in the original source from where I started, I need feedback where the priorities are. Do you need smx? libsmi integration? |
We need something that is functionally complete and has no regressions on FreeBSD and Linux compared with the FlightAware version. What items in TODO are in the code you started from, and what items are new? Mac OS X may be required too. |
To find out exactly what are the differences I will run the tests and compare. May I suppose you are Is it ok to start testing with tclscotty? The original C scotty has no stub support and is quite a rewrite of |
If you have to run the tests using tclscotty, then the Makefile should probably be running them that way too. Possibly the original scotty could be deprecated, if it's that obsolete. I'll check whether that's actually required. |
Please comment on development and testbed environments. |
Creating a new C-scotty was easier then I thought - it's already commited to my scotty repository. The Tnm library hardcodes the absolute path to itself and uses it to construct further paths from Find attached test logs made with a current checkout of FlightAwares' scotty repository on a FreeBSD 11 After this I installed my current version and run tests with
|
FreeBSD 10.3, 11.0 |
Ubuntu 16.10 |
Can we agree on starting from FreeBSD 11. I would like you to run |
Most of our environment is 10.3. I'm not sure I have an 11 environment I can test in. |
No problem: I'll set it up on 10.3. |
Do you have a 32 bit or 64 bit envorinment? The mib-7.14 mib format test (failure) would probably |
VM I'm using for testing is: FreeBSD vm-resuna1 10.3-RELEASE FreeBSD 10.3-RELEASE #0 r297264: Fri Mar 25 02:10:02 UTC 2016 root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64 I noticed the mib format failures and they seem not a big deal. Same with most of the netdb failures. I don't think the bounty needs that kind of existing stuff to be cleaned up. |
The new code doesn't seem to be pulling in configuration right, in particular it's redefining socklen_t when it shouldn't be. unix/config.h is being generated with #define HAVE_SOCKLEN_T 1 But it looks like nothing is pulling that info into tnmInt.h so it's going: #ifndef HAVE_SOCKLEN_T Which is why I think... when you build you get a bunch of stuff like this: In file included from unix/nmtrapd.c:36:0: |
Great :) |
Aha, just checked the old version, it had the same problem. I'll work with Karl on that. |
Original code uses config.h, however it did not pick it up everywhere correctly so I disabled config.h Anywhere: HAVE_SOCKLEN_T is definitely defined on the compiler commandline. I will go through Note that virtually no code has been changed. Just the autconf/configure/Makefile.in stuff. |
I understand, that OOM is not the case here. Your patch resolves the situation of a missing domain part in the return value of Tcl_GetHostName(). In our test environments it is unlikely to get an OOM. But how should situations be handled, where memory is allocated but the result is not checked? |
|
ckstrdup calls ckalloc; ckalloc panics if it is OOM; caller doesn't need to do anything? |
The behavior of "info hostname" on Linux and FreeBSD is also inconsistent. |
I propose to initialize to recognizable invalid values, just like done with the user name or the os. The original code uses the rather not standard res_ninit() function, which essentially reads Tcl_GetHostName() on unix uses either uname(2) or gethostname(). The result with respect to the domain part depends on configuration, libc and operating system. So: "unkown" and ""? |
Hostname is not an issue. Whatever is returned by Tcl_GetHostName() is absolutely fine. It seems to be all [info hostname] does. It doesn't need to work on Windows, at all, but Linux, I think if we can have it work there we should have it work there. Possibly something like:
|
It is absolutely no problem to revert to the original version. In fact I stumbled about res_ninit() only But I can't stop ranting: If your system is not configured respectively (resolv.conf has no domain entry), res_ninit() will not give you a domain either. IMHO it should be documented, how to set up the system on each OS to get the right thing out of Tcl_GetHostName() and rely on one centralized functionality which can be managed in the core instead of using just another heuristic which depends on os specific features. |
On Windows Tcl_GetHostName() uses the GetComputername() function, which returns the NetBIOS name of the local computer. So it is not supposed, that there be a domain name attached. I think I stand corrected: Let's get the hostname with Tcl_GetHostName and the Internet domain name with a function provided by the Internet savvy Tnm library. |
The machine I'm testing this on has a "search" line in resolv.conf, but no "domain" line. This is what dhcpd puts there on both FreeBSD and Linux. Looking at the source to the version of res_ninit() on OS X and in glibc, in both cases it seems to be using the "search" line. In fact it uses search by preference, only falling back to domain if search isn't there. So there's no configuration issue. These systems are correctly configured. |
If you want to write the code to pull in the domain name using Tcl code from the Tnm library, as a fallback if Tcl_GetHostName() doesn't return a domain part, that's probably OK. In that case you should probably leave tnm(domain) unset in the "C" code and check on it later once you're mucking about in Tcl anyway. |
Wouldn't the proper fix be to have an autoconf check for res_ninit() and make the code you removed from the Linux platform-dependent routine conditional on HAVE_RES_NINIT? |
That would be a possibility. Also there are workarounds to find out the default domain if res_ninit() is not available. Sidenote: Read what resolv.conf(5) has to say about the search line... |
As of now I have reverted the code for setting the tnm(domain) variable completely to the original, to avoid more interference when testing. I have done a general cleanup to eliminate most compiler warnings and put config.h into place. The build is now more quiet. The I attach my respective logs from FreeBSD 10.3/amd64 and Ubuntu 16.10/i686 make_check_freebsd10.3.log.txt |
Our Linux boxes are x86_64/amd64 |
I'll get with Karl this afternoon to see about testing your fork. I notice a bunch of errors on the FreeBSD side related to UDP sockets with an address and port. Are they related to the work you're doing with the UDP bounty? Eg:
|
Good to hear. If you are ready, please consider to look at the The udp errors in the test are unrelated to the changes. The tests are made for a Linux network stack. FreeBSD apparently does not allow to send and receive on the same udp port at the same time. There are other test with similar problems, e.g. using an arbitrary IP number out of 127.0.0.0/8, which works on Linux but not on other operating systems, unless you define an IP alias on the loopback interface. |
OK, I've reviewed the UDP errors in the tests. I noticed this comment:
|
Comment is mine. Tests up to udp-9.1 are from the original scotty. I didn't want to modify them much in order to maintain comparability. Testgroups 10 and 11 are for the new functionality. The tests work on the Linux network stack, I will adapt them to work on FreeBSD too. |
If it's not a huge push-up, I think it would be better to make the previous tests consistent rather than not testing them on FreeBSD, since that's our primary platform and you're modifying 10 and 11 anyway. |
Updated udp tests and ran them on FreeBSD10.3/amd64, Debian Jessie, Ubuntu 16.10, MacOSX Yosemite. Will need to update the documentation for the new
|
Coincidentally, I just made some changes in the base scotty to make it handle trailing . in host name lookups like the stock resolver. Can you pull these patches in? flightaware/scotty@85022ae PS: It's using res_mkquery/res_send instead of res_search to provide more control over the process, per Karl. PPS: Thanks for the Mac fix, I'll check it out today. |
On Sierra I get these errors.
Edit: See http://wiki.tcl.tk/22108 |
I just have pulled in your commits from #26 (comment), do you have one for _Tcl_GetErrorLine handy? Maybe this will get me to go with Tcl8.5 too. In a minute I will test my recent patches for Tnm::dns on MacOSX and take a look on the menu issue. |
I stuck the mod from the wiki into the files with the problem, but I haven’t sat down and gone “well, it should probably be in tnmSnmp.h or maybe config.h or blah blah blah”... you know, what’s the *right* place to put the thing.
Since you’ve had your nose in this more than me lately, I figure I’ll defer that to your judgement.
|
Thats fine with me. |
With the last commit, I could build and run tests of scotty on:
The missing operating systems from your list would essentially be: Debian Sid, macOS Sierra. Other OSses tested:
I'm in contact with Minix3, and hope they get me a working rpcgen/rcp implementation to test here too. The |
I've merged this into flightaware/scotty master. |
Do we have stub support in this release? |
Everything is compiled with USE_TCL_STUBS and linked against tclstub8.6. |
I am starting to work on the Scotty build system to update it to current TEA (3.10), taking into account the comments in #7 .
The text was updated successfully, but these errors were encountered: