-
Notifications
You must be signed in to change notification settings - Fork 45
Report compile time and runtime glibc version #76
Conversation
Use dlsym() to lookup gnu_get_libc_version() in case the runtime is not GNU C Library.
test/common.js
Outdated
const libcMatch = libcRE.exec(sysInfoSection); | ||
if (libcMatch != null) { | ||
const libcPath = libcMatch[1]; | ||
const child = child_process.spawnSync(libcPath, { encoding: 'utf8' }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're executing libc.so.6 here? That actually works on your system?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works on mine (linux):
% /lib/x86_64-linux-gnu/libc.so.6
GNU C Library (Ubuntu GLIBC 2.24-3ubuntu2) stable release version 2.24, by Roland McGrath et al.
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 6.2.0 20161005.
Available extensions:
crypt add-on version 2.1 by Michael Glad and others
GNU Libidn by Simon Josefsson
Native POSIX Threads Library by Ulrich Drepper et al
BIND-8.2.3-T5B
libc ABIs: UNIQUE IFUNC
For bug reporting instructions, please see:
<https://bugs.launchpad.net/ubuntu/+source/glibc/+bugs>.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, I see glibc has a __libc_main
entry point in its ELF header but that only works when the .so has the executable bit set. I don't know if that is something you can rely on but it is the case on the three Linux systems (Debian, Ubuntu, Fedora) in my household.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The official FAQ says:
If you want to find out about the version from the command line simply run the libc binary. This is probably not possible on all platforms but where it is simply locate the libc shared library and start it as an application.
I've changed the test to use strings
.
src/node_report.cc
Outdated
out << std::endl << "node-report version: " << NODEREPORT_VERSION | ||
<< " (built against Node.js v" << NODE_VERSION_STRING; | ||
#if defined(__GLIBC__) | ||
out << ", glibc "<< __GLIBC__ << "." << __GLIBC_MINOR__; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space after "?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
LGTM, landing this shortly |
Use dlsym() to lookup gnu_get_libc_version() in case the runtime is not GNU C Library. PR-URL: #76 Reviewed-By: Richard Chamberlain <richard_chamberlain@uk.ibm.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Landed as d44c1c7 |
Fixes #74.
Sample output after change:
Uses dlsym() to lookup gnu_get_libc_version() in case the runtime is not GNU C Library.