{"push_id":685035579,"size":11,"distinct_size":11,"ref":"refs/heads/cxx","head":"be0fc66544cf92a476e1286fc22c105ffe20e3f0","before":"a8eda14681db9db65a3e29aebd76204957c2155f","commits":[{"sha":"d4b8124211340f4bbd6cd3f08a20e254a769f134","author":{"email":"66a4aaafefe344f5385586b74770760469cbac80@cs.berkeley.edu","name":"Barret Rhoden"},"message":"[PATCH 1/2] Removes NSS and resolv (XCC)\n\nGlibc has a bunch of subdirs, such as nss, nis, inet, and resolv.  Some\nof these won't actually work at runtime.  For instance, resolv uses\nioctl, which will always fail.\n\nAs a deeper problem, many of these subdirs might \"work\", but they\nactually would fail or otherwise not work on Akaros.  They open files\nthat do not exist or attempt operations we do not support.  We've been\nfaking support for these operations since f2ed80b10a.\n\nBeyond the subdirs brought in by f2ed80b10a, there are a bunch of\n\"mandatory\" subdirs, such as pwd, shadow, grp, and gshadow.  These\nprovide interfaces for reading entries from files like /etc/passwd.\nThese all use NSS to generate the code for their functions by including\na file like nss/getXXbyYY.c.\n\nAnyway, this commit removes resolv and nss, and anything (minus inet)\nthat depends on nss.  In lieu of actually removing all of pwd/grp/etc, I\nreplaced them all with stubs.  Since gshadow doesn't have a man page, I\njust stopped building it for now.  We can stub it out later, if\nnecessasry.\n\nOf special note is inet.  We want most of inet - that's in part what the\nBSD shims do: things like gethostbyname.  And gethostbyname2.  And\ngethostbyname2_r.  Inet also includes a lot of headers in netinet/.  So\nwe keep inet as a Subdir (like pwd), and just stub out anything that\nuses nss.\n\nThere isn't anything wrong with nss internally (some people disagree),\nbut the idea here is that anything using nss was probably not right for\nAkaros, and we should do something else.\n\nAn alternative approach is to remove resolv and keep nss around.\nFunctions from e.g. pwd will fail at runtime, unless we create\n/etc/passwd files.  Though nss relies on resolv functions, so it is not\nparticularly simple.  This commit's stub approach may be easier.\n\nAnd yet another approach would be to keep resolv around too, and hack it\nup to try and work.  But I think interposing on the glibc interface is a\nbetter place to work than at some internal function.\n\nThis won't compile without the next patch.","distinct":true,"url":"https://api.github.com/repos/brho/akaros/commits/d4b8124211340f4bbd6cd3f08a20e254a769f134"},{"sha":"d61b9551c69105703146f49ec31296df6e1d1a18","author":{"email":"66a4aaafefe344f5385586b74770760469cbac80@cs.berkeley.edu","name":"Barret Rhoden"},"message":"[PATCH 2/2] Adds some resolv functionality (XCC)\n\nDespite removing resolv, we still need some parts of it.  Things like\ninet_addr() seem fine.  Likewise, we need a netdb.h header.  resolv was\nproviding it; now we provide a modified version manually.  resolv was\nalso providing resolv.h and the arpa nameser headers.  We'll see if\nresolv.h ends up being a problem, since we don't implement any of the\nvarious functions.  Long term, we'll probably need 9ns shims that use CS\nor something.\n\nFully rebuild your toolchain.  I suggest removing the contents of the\ninstallation directory first, since so much stuff was removed.","distinct":true,"url":"https://api.github.com/repos/brho/akaros/commits/d61b9551c69105703146f49ec31296df6e1d1a18"},{"sha":"893ec4836f289c09200789777b56131dbe663a6d","author":{"email":"66a4aaafefe344f5385586b74770760469cbac80@cs.berkeley.edu","name":"Barret Rhoden"},"message":"Moves backtrace_kframe()\n\nIt wasn't arch-dependent, so no need to keep it in x86.","distinct":true,"url":"https://api.github.com/repos/brho/akaros/commits/893ec4836f289c09200789777b56131dbe663a6d"},{"sha":"d7b9d230e503f635135d329a587f449bf7d01081","author":{"email":"66a4aaafefe344f5385586b74770760469cbac80@cs.berkeley.edu","name":"Barret Rhoden"},"message":"Build userspace with -fno-omit-frame-pointer (XCC)\n\nUntil we have a decent debugger, we need to rely on the frame pointer to\ncreate backtraces for user contexts.\n\nRebuild your toolchain.","distinct":true,"url":"https://api.github.com/repos/brho/akaros/commits/d7b9d230e503f635135d329a587f449bf7d01081"},{"sha":"b2356b50a0e782dc5b77abb586f6e3d8a2817445","author":{"email":"66a4aaafefe344f5385586b74770760469cbac80@cs.berkeley.edu","name":"Barret Rhoden"},"message":"Helper to backtrace a user context\n\nYou can backtrace a context, but only if you have one!  And if the\ncontext is somehow messed up or if the stackframe is not using the frame\npointer, then it'll probably die in a horrendous kernel page fault.\n\nNote that when processing as syscall, if the syscall has already\nblocked, then current_ctx is not the context that originally issued the\nsyscall.  *That* context has long-since restarted, due to our async\nsyscalls.\n\nYou can attempt to backtrace the current context like so:\n\tbacktrace_user_ctx(p, current_ctx);\n\nTry putting one of these in sys_block() on either side of the\nkthread_usleep().  The latter will fail, and if it doesn't, it's\nprobably grabbing some arbitrary context.","distinct":true,"url":"https://api.github.com/repos/brho/akaros/commits/b2356b50a0e782dc5b77abb586f6e3d8a2817445"},{"sha":"ad7cbb07636d193f89eae7a54fae21c2bed09601","author":{"email":"66a4aaafefe344f5385586b74770760469cbac80@cs.berkeley.edu","name":"Barret Rhoden"},"message":"x86: changes backtrace to not subtract 1\n\nThat -1 was there for a long time, due to weird issues with our earliest\nbts in some corner cases in the kernel.  The tradeoff is that the\naddresses given aren't accurate (off by 1!), and that make manual symbol\nlookup a little annoying.  For instance, using a user-backtrace, you\ncan't grep an objdump for a particular PC, since the -1 means the\naddress probably doesn't exist.","distinct":true,"url":"https://api.github.com/repos/brho/akaros/commits/ad7cbb07636d193f89eae7a54fae21c2bed09601"},{"sha":"4b3df4391fb776a1da4d37a84b48f0ea5d74ae55","author":{"email":"66a4aaafefe344f5385586b74770760469cbac80@cs.berkeley.edu","name":"Barret Rhoden"},"message":"Implements readdir64{,_t} (XCC)\n\nSince our dirent is a dirent64, these are just wrappers.\n\nOur glibc dirent is still in our sysdep dirent.h header, instead of just\nusing the kernel's kdirent.  There might be some minor issues with\nhaving a lot in fs.h.\n\nRebuild glibc.","distinct":true,"url":"https://api.github.com/repos/brho/akaros/commits/4b3df4391fb776a1da4d37a84b48f0ea5d74ae55"},{"sha":"3da88d8575a8d7bb615326a70d4965ed9f6a83c7","author":{"email":"66a4aaafefe344f5385586b74770760469cbac80@cs.berkeley.edu","name":"Barret Rhoden"},"message":"User interface for fsync and posix_fadvise (XCC)\n\nUsing fcntl() for fsync and fadvise.  Not sure why POSIX/glibc didn't do\nthis already.\n\nPart of it might be that fcntl, despite the ... declaration, supposedly\nalways takes one va_arg of type int, and it's ignored for certain\ncommands (e.g. F_GETFD).  That's pretty silly, so I extended it to take\nup to four args.\n\nRebuild glibc.","distinct":true,"url":"https://api.github.com/repos/brho/akaros/commits/3da88d8575a8d7bb615326a70d4965ed9f6a83c7"},{"sha":"6486ea2483c3fff91831a723578249a5e2e0d5d8","author":{"email":"66a4aaafefe344f5385586b74770760469cbac80@cs.berkeley.edu","name":"Barret Rhoden"},"message":"Adds __h_errno_loc to glibc's ABI (XCC)\n\nA little background:  I was getting a link error compiling something that was\nusing h_errno.  As an example, in tests/hello.c:\n\n\t#include <netdb.h>\n\n\t...\n\n\tprintf(\"XME %p\\n\", h_errno);\n\nBuilding that gives a link error like:\n\tros-kernel/tests/hello.c:19: undefined reference to `__h_errno_location'\n\nh_errno is a macro that expands to deref __h_errno_location().\n\n__h_errno_location() is declared in netdb.h and defined in inet/herrno-loc.c.\nThe symbol is even in libc-2.19.so, so why can't we link against it?\n\nWe can see it in an objdump of libc:\n    00000000000dab30 l     F .text0000000000000016              __h_errno_location\n    00000000000dab30 l     F .text00000000000000160000000000000016              __GI___h_errno_location\n\nBut notice the 'l'.  Now look at some other func we have in glibc:\n    00000000000c7db0 g     F .text000000000000001600000000000001f9              utimensat\n\nThat has a 'g', for global.  For functions to be linkable, they need to be part\nof glibc's ABI (check out my old Documentation/glibc.txt for some info).  Now,\nnormally __h_errno_location is part of the ABI, but we're not building resolv\nanymore.  In resolv's Versions file, we have:\n\nlibc {\n      GLIBC_2.0 {\n        _res;\n\n        # helper functions\n        __h_errno_location;\n\nSince we don't build resolv, we don't have that as part of the abi.  Thus, we\nneed to do it manually in Akaros's Versions.  We'll have to do the same things\nfor other functions that pop up that were part of resolv (or other Subdir's)\nVersions that we implement separately.  Hopefully no one is trying to access\n_res...\n\nRebuild glibc.","distinct":true,"url":"https://api.github.com/repos/brho/akaros/commits/6486ea2483c3fff91831a723578249a5e2e0d5d8"},{"sha":"eabdd9e43d44aa9bef12210f0f9b1dfd32963142","author":{"email":"66a4aaafefe344f5385586b74770760469cbac80@cs.berkeley.edu","name":"Barret Rhoden"},"message":"Allows calls to pthread_sigmask before init\n\nSome libraries that ld loads make pthread calls in their initialization.  This\npatch tracks the changes made to the sigmask, and applies it when the 2LS is up\nand running.\n\nOne issue is that the sigmask is for the pthread only, and not the entire\nprocess.  Hopefully that's what these libraries wanted.  Maybe it isn't.\n\nAnother approach would be to find a safe spot in ld and run vcore_event_init()\nfrom there, such that we get the slim 2LS init done very early.  Then we add a\n2LS op for the slim-init (e.g. pth_slim_init), which does the basics to track\nthe pthread as thread0, but doesn't turn us into an MCP.  This is doable in\npart since the specific 2LS is determined statically, for instance when you\nlink against -lpthread.\n\nIf we do the latter approach, we will still need to call out from the\napplication's _start for staticly linked applications.","distinct":true,"url":"https://api.github.com/repos/brho/akaros/commits/eabdd9e43d44aa9bef12210f0f9b1dfd32963142"},{"sha":"be0fc66544cf92a476e1286fc22c105ffe20e3f0","author":{"email":"66a4aaafefe344f5385586b74770760469cbac80@cs.berkeley.edu","name":"Barret Rhoden"},"message":"Adds a backtrace helper for user backtraces\n\nYou need to echo the Akaros backtrace (e.g. #1 Addr f00 is in BAR) into the\nscript.  You'll also need to customize the script for your system.  I recommend\ncopying it out of scripts/ and onto your own system somewhere.\n\nYou can also source the script, then ctrl-d it, and manually invoke\nprint_glb_func.\n\n$ print_glb_func kern/kfs/bin/hello 0xADDR\n\nMake sure the ADDR is in hex, with a leading 0x.  If all goes well, it'll print\nout the function containing ADDR.","distinct":true,"url":"https://api.github.com/repos/brho/akaros/commits/be0fc66544cf92a476e1286fc22c105ffe20e3f0"}]}