Projects

Ticket #645 (closed defect: fixed)

Opened 23 months ago

Last modified 23 months ago

Segmentation Fault using File::sysseek

Reported by: foranje@… Owned by: lsansonetti@…
Priority: blocker Milestone: MacRuby 0.6
Component: MacRuby Keywords:
Cc:

Description

Using the sysseek method of a file always seems to result into a Segmentation fault using MacRuby. Using the same code with regular Ruby works fine.

test.rb

file = File.new("test.txt")
file.sysseek(2, IO::SEEK_SET)
print file.sysread(5)
file.close

test.txt

blaatblaatblaatblaatblaat

Result when executing the file using MacRuby:

Segmentation fault

If I comment out the sysseek line, it gives no error. So the sysseek seems to be the issue.

Change History

Changed 23 months ago by martinlagardette@…

Laurent, the stack trace is the following:

Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   libSystem.B.dylib             	0x00007fff8773f886 __kill + 10
1   libSystem.B.dylib             	0x00007fff877dfeae abort + 83
2   libmacruby.dylib              	0x000000010004317d rb_bug + 205 (error.c:229)
3   libmacruby.dylib              	0x00000001000be660 sigbus + 0 (signal.c:378)
4   libSystem.B.dylib             	0x00007fff8775180a _sigtramp + 26
5   libobjc.A.dylib               	0x00007fff875e96e5 _class_isMetaClass + 11
6   libobjc.A.dylib               	0x00007fff875ec466 class_isMetaClass + 9
7   libmacruby.dylib              	0x0000000100067444 rb_num2long + 388 (ruby.h:1185)
8   libmacruby.dylib              	0x0000000100059c7b rb_io_seek + 43 (io.c:562)
9   libmacruby.dylib              	0x000000010014b98b rb_vm_dispatch + 6635 (dispatcher.cpp:449)
10  ???                           	0x0000000101100138 0 + 4312793400
11  libmacruby.dylib              	0x000000010015f4bf rb_vm_run + 351 (vm.cpp:3976)
12  libmacruby.dylib              	0x00000001000451e9 ruby_run_node + 73 (eval.c:201)
13  macruby                       	0x0000000100000d28 main + 152 (main.cpp:40)
14  macruby                       	0x0000000100000c88 start + 52

Is that the problem with the NSNumber bridge?

Changed 23 months ago by lsansonetti@…

  • status changed from new to closed
  • resolution set to fixed
  • milestone set to MacRuby 0.6

Should be fixed in r3903.

Note: See TracTickets for help on using tickets.