#38 crash when too few arguments given

v0.4.3
closed
crash (13)
5
2006-08-14
2006-08-04
Tim Burks
No

If I forget to include all the arguments to a bridged method, the wrapper
code crashes. For example:

% irb
irb(main):001:0> require 'osx/cocoa'
=> true
irb(main):002:0> OSX::NSSound.alloc.initWithContentsOfFile_byReference
("foo")
/Library/Frameworks/RubyCocoa.framework/Versions/A/Resources/
ruby/osx/objc/oc_wrapper.rb:13: [BUG] Segmentation fault
ruby 1.8.4 (2005-12-24) [i686-darwin8.6.1]

Abort
%

Discussion

  • kimura wataru

    kimura wataru - 2006-08-05
    • assigned_to: nobody --> kimuraw
     
  • kimura wataru

    kimura wataru - 2006-08-05

    Logged In: YES
    user_id=919560

    RubyCocoa completes missing argument(s) by nil. We think this feature
    sometimes causes unexpected behavior, and this feture was expired
    in apple-unstable branch. I'll merge this change to trunk.

    see [rubycocoa-devel:300]
    http://lists.sourceforge.jp/mailman/archives/rubycocoa-devel/2006-June/
    000299.html

     
  • Tim Burks

    Tim Burks - 2006-08-06

    Logged In: YES
    user_id=1262646

    I think this should throw an exception. I wouldn't want RubyCocoa to provide nil
    values for missing arguments and not tell me about it -- that would make it
    harder to find problems in my code.

     
  • kimura wataru

    kimura wataru - 2006-08-14
    • status: open --> closed
     
  • kimura wataru

    kimura wataru - 2006-08-14

    Logged In: YES
    user_id=919560

    I commited a change to raise ArgumentError as same as when ruby's method
    meets missing argument(s).

    if you have more comments, please re-open this track.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks