Projects

Ticket #357 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

NSLog causes "BAD_EAX_ACCESS" on 10.6

Reported by: mitchell.hashimoto@… Owned by: lsansonetti@…
Priority: blocker Milestone: MacRuby 0.5
Component: MacRuby Keywords:
Cc: mitchell.hashimoto@…, dylan@…

Description

I simply added an NSLog to rb_main.rb prior to NSApplicationMain to attempt to log some dummy data ("Foo") and it crashes with BAD_EAX_ACCESS everytime. When I remove that line, it runs fine.

This is on 10.6 Snow Leopard with the latest head (commit e3c2cbc6bac26594d3a722cfcc652cad11fcd524 in git-svn).

# Loading the Cocoa framework. If you need to load more frameworks, you can
# do that here too.
framework 'Cocoa'

# Loading all the Ruby project files.
dir_path = NSBundle.mainBundle.resourcePath.fileSystemRepresentation
Dir.entries(dir_path).each do |path|
  if path != File.basename(__FILE__) and path[-3..-1] == '.rb'
    require(path)
  end
end

# Test Log, should crash program
NSLog "Foo Bar Baz"

# Starting the Cocoa main loop.
NSApplicationMain(0, nil)

Change History

Changed 2 years ago by mitchell.hashimoto@…

  • cc mitchell.hashimoto@… added

Cc Me!

Changed 2 years ago by mattaimonetti@…

This is a known bug, while waiting for it to be fixed, you can use "puts" to get the same result.

# Loading the Cocoa framework. If you need to load more frameworks, you can
# do that here too.
framework 'Cocoa'

# Loading all the Ruby project files.
dir_path = NSBundle.mainBundle.resourcePath.fileSystemRepresentation
Dir.entries(dir_path).each do |path|
  if path != File.basename(__FILE__) and path[-3..-1] == '.rb'
    require(path)
  end
end

# Test Log, should crash program
puts "Foo Bar Baz"

# Starting the Cocoa main loop.
NSApplicationMain(0, nil)

Changed 2 years ago by dylan@…

  • cc dylan@… added

Cc Me!

Changed 2 years ago by lsansonetti@…

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

Should be fixed in r2694.

Note: See TracTickets for help on using tickets.