Skip to content

Instantly share code, notes, and snippets.

View methodmissing's full-sized avatar

Lourens Naudé methodmissing

View GitHub Profile
static void
rb_kill_thread(th, flags)
rb_thread_t th;
int flags;
{
if (th != curr_thread && th->safe < 4) {
rb_secure(4);
}
if (th->status == THREAD_TO_KILL || th->status == THREAD_KILLED)
return;
# sudo dtruss -c 'ruby requires.rb'
# .....
#
# lstat("/opt/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.7/lib/rubyeventmachine\0", 0xBFFFB2E0, 0x1000) = -1 Err#2
# lstat("/opt/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.7/lib/rubyeventmachine.rb\0", 0xBFFFB2E0, 0x1000) = -1 Err#2
# lstat("/opt/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.7/lib/rubyeventmachine.rbw\0", 0xBFFFB2E0, 0x1000) = -1 Err#2
# lstat("/opt/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.7/lib/rubyeventmachine.so\0", 0xBFFFB2E0, 0x1000) = -1 Err#2
# lstat("/opt/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.7/lib/rubyeventmachine.bundle\0", 0xBFFFB2E0, 0x1000) = 0 0
# lstat("/opt/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.7/lib/rubyeventmachine.dll\0", 0xBFFFB2E0, 0x1000) = -1 Err#2
# lstat("/opt/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.7/lib/rubyeventmachine.sl\0", 0xBFFFB2E0, 0x1000) = -1 Err#2
# sudo dtruss -c 'ruby requires.rb'
# .....
#
# stat("/opt/local/lib/ruby/vendor_ruby/1.8/i686-darwin9.5.1/rubyeventmachine.rb\0", 0xBFFFF2D0, 0x1000) = -1 Err#2
# stat("/opt/local/lib/ruby/vendor_ruby/1.8/i686-darwin9.5.1/rubyeventmachine.bundle\0", 0xBFFFF2D0, 0x1000) = -1 Err#2
# stat("/opt/local/lib/ruby/vendor_ruby/rubyeventmachine.rb\0", 0xBFFFF2D0, 0x1000) = -1 Err#2
# stat("/opt/local/lib/ruby/vendor_ruby/rubyeventmachine.bundle\0", 0xBFFFF2D0, 0x1000) = -1 Err#2
#
# .....
#
(gdb) imr_st_insert
Breakpoint 1 at 0x863e8: file st.c, line 289.
Reading symbols for shared libraries +++... done
Breakpoint 1, st_insert (table=0x100780, key=2913, value=744718) at st.c:289
289 hash_val = do_hash(key, table);
$1 = {
type = 0xb1a3c,
num_bins = 11,
num_entries = 0,
(gdb) imr_st_insert
Breakpoint 1 at 0x863e8: file st.c, line 289.
Reading symbols for shared libraries +++... done
Breakpoint 1, st_insert (table=0x100780, key=2913, value=744718) at st.c:289
289 hash_val = do_hash(key, table);
$1 = {
type = 0xb1a3c,
num_bins = 11,
num_entries = 0,
lstat("/opt/local/lib/ruby/gems/1.8/gems/erubis-2.6.0/lib/eventmachine\0", 0xBFFFB2F0, 0x1000) = -1 Err#2
lstat("/opt/local/lib/ruby/gems/1.8/gems/erubis-2.6.0/lib/eventmachine.rb\0", 0xBFFFB2F0, 0x1000) = -1 Err#2
lstat("/opt/local/lib/ruby/gems/1.8/gems/erubis-2.6.0/lib/eventmachine.rbw\0", 0xBFFFB2F0, 0x1000) = -1 Err#2
lstat("/opt/local/lib/ruby/gems/1.8/gems/erubis-2.6.0/lib/eventmachine.so\0", 0xBFFFB2F0, 0x1000) = -1 Err#2
lstat("/opt/local/lib/ruby/gems/1.8/gems/erubis-2.6.0/lib/eventmachine.bundle\0", 0xBFFFB2F0, 0x1000) = -1 Err#2
lstat("/opt/local/lib/ruby/gems/1.8/gems/erubis-2.6.0/lib/eventmachine.dll\0", 0xBFFFB2F0, 0x1000) = -1 Err#2
lstat("/opt/local/lib/ruby/gems/1.8/gems/erubis-2.6.0/lib/eventmachine.sl\0", 0xBFFFB2F0, 0x1000) = -1 Err#2
lstat("/opt/local/lib/ruby/gems/1.8/gems/erubis-2.6.0/lib/eventmachine.jar\0", 0xBFFFB2F0, 0x1000) = -1 Err#2
lstat("/opt/local/lib/ruby/gems/1.8/gems/erubis-2.5.0/lib/eventmachine\0", 0xBFFFB2F0, 0x1000) = -1 Err#2
lstat("/opt/local/lib/ru
213-138-233-65:amqp lourens$ ruby -v
ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-darwin9.5.1]
213-138-233-65:amqp lourens$ irb
irb(main):001:0> Marshal.dump []
=> "\004\b[\000"
irb(main):002:0> exit
213-138-233-65:amqp lourens$ jirb
irb(main):001:0> Marshal.load "\004\b[\000"
=> []
irb(main):002:0> exit
#include "ruby.h"
#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <signal.h>
#include <fcntl.h>
#ifdef _POSIX_ASYNCHRONOUS_IO
#include <aio.h>
#ifdef HASH_LOG
static int collision = 0;
static int init_st = 0;
static void
stat_col()
{
FILE *f = fopen("/tmp/col", "w");
fprintf(f, "collision: %d\n", collision);
fclose(f);
1 4716462572 st_init_strtable_with_size ->
1 4716462587 st_init_table_with_size ->
1 4716462598 new_size ->
1 4716462611 new_size <-
1 4716462625 st_init_table_with_size <-
1 4716462634 st_init_strtable_with_size <-
1 4716462653 st_init_numtable_with_size ->
1 4716462662 st_init_table_with_size ->
1 4716462669 new_size ->
1 4716462675 new_size <-