Skip to content

Instantly share code, notes, and snippets.

$ cat /proc/self/maps
00400000-0040b000 r-xp 00000000 ca:01 262273 /bin/cat
0060a000-0060b000 r--p 0000a000 ca:01 262273 /bin/cat
0060b000-0060c000 rw-p 0000b000 ca:01 262273 /bin/cat
02241000-02262000 rw-p 00000000 00:00 0 [heap]
7f9cf96ec000-7f9cf98a7000 r-xp 00000000 ca:01 397466 /lib/x86_64-linux-gnu/libc-2.19.so
7f9cf98a7000-7f9cf9aa6000 ---p 001bb000 ca:01 397466 /lib/x86_64-linux-gnu/libc-2.19.so
7f9cf9aa6000-7f9cf9aaa000 r--p 001ba000 ca:01 397466 /lib/x86_64-linux-gnu/libc-2.19.so
7f9cf9aaa000-7f9cf9aac000 rw-p 001be000 ca:01 397466 /lib/x86_64-linux-gnu/libc-2.19.so
7f9cf9aac000-7f9cf9ab1000 rw-p 00000000 00:00 0
/*
* This was a grand experiment - I would evaluate students based on the only
* meaningful metric, amount of memory they actually used. This would make slab
* allocators more interesting, as they could potentially be more efficient in
* larger programs. Unfortunately, it is *exceptionally* hard to measure the
* current memory usage of a program, and even harder to do so portably.
*
* The most promising approach was getrusage(2). This library call is available
* on Mac OSX and Linux, and offers the ability to get the maximum resident set
* size. At first blush this was promising, but unfortunately there were some
/*
* Copyright (c) 2014 by Alex Reece <awreece@gmail.com>. All rights reserved.
*/
#include <stdbool.h>
#include "debug.h"
#include "treap.h"
#include "util.h"
jarvis:~$ sudo puppet agent --test
Warning: Setting templatedir is deprecated. See http://links.puppetlabs.com/env-settings-deprecations
(at /usr/lib/ruby/vendor_ruby/puppet/settings.rb:1139:in `issue_deprecation_warning')
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Could not retrieve fact='apt_updates', resolution='<anonymous>': can't convert nil into Integer
Could not retrieve fact='apt_security_updates', resolution='<anonymous>': can't convert nil into Integer
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find class foo_bar at /etc/puppet/manifests/site.pp:6 on node jarvis.XXX.com
Warning: Not using cache on failed catalog
[pid 22365] stat("/etc/puppet/manifests/site.pp", {st_mode=S_IFREG|0644, st_size=104, ...}) = 0
[pid 22365] stat("/etc/puppet/modules/foo_bar/manifests/init.pp", {st_mode=S_IFREG|0644, st_size=49, ...}) = 0
[pid 22365] rt_sigprocmask(SIG_SETMASK, ~[HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE TERM CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS RTMIN RT_1], NULL, 8) = 0
[pid 22365] rt_sigprocmask(SIG_SETMASK, ~[HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE TERM CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS RTMIN RT_1], NULL, 8) = 0
[pid 22365] rt_sigprocmask(SIG_SETMASK, ~[HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE TERM CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS RTMIN RT_1], NULL, 8) = 0
[pid 22365] sendto(5, "<27>Nov 18 13:21:59 puppet-maste"..., 132, MSG_NOSIGNAL, NULL, 0) = 132
[pid 22365] rt_sigprocmask(SIG_SETMASK, ~[HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE TERM CONT STOP TS
# This Apache 2 virtual host config shows how to use Puppet as a Rack
# application via Passenger. See
# http://docs.puppetlabs.com/guides/passenger.html for more information.
# You can also use the included config.ru file to run Puppet with other Rack
# servers instead of Passenger.
# you probably want to tune these settings
PassengerHighPerformance on
PassengerMaxPoolSize 12
service { 'jarvis':
ensure => running,
binary => '/opt/devops-gate/projects/jarvis/jarvis/run.sh'
}
/*
* Copyright (c) 2014 by Alex Reece <awreece@gmail.com>. All rights reserved.
*/
#include <assert.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
warning: core file may not match specified executable file.
[New LWP 9365]
Core was generated by `/bin/sh ./wrapper.sh'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007f79b558767a in wait4 () at ../sysdeps/unix/syscall-template.S:81
81 ../sysdeps/unix/syscall-template.S: No such file or directory.
(gdb) bt
#0 0x00007f79b558767a in wait4 () at ../sysdeps/unix/syscall-template.S:81
#1 0x00007f79b5abce0c in ?? ()
#2 0x00007f79b5abe49d in ?? ()
% gdb ./a.out core
GNU gdb (Ubuntu 7.7-0ubuntu3.1) 7.7
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see: