#987: NSTask segfault -----------------------------+---------------------------------------------- Reporter: lp@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: segfault NSTask -----------------------------+---------------------------------------------- When executing thefollowing erroneous code, where arguments should be in an array: framework "foundation" task = NSTask.launchedTaskWithLaunchPath("/bin/ls", arguments:"-l") p task.isRunning p task.standardOutput I get: => Segmentation fault -- Ticket URL: <http://www.macruby.org/trac/ticket/987> MacRuby <http://macruby.org/>
#987: NSTask segfault -----------------------------+---------------------------------------------- Reporter: lp@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: segfault NSTask -----------------------------+---------------------------------------------- Comment(by lsansonetti@…): {{{ (gdb) bt #0 create_intersected_charset_table [inlined] () at /Users/lrz/src /macruby-trunk/string.c:5157 #1 0x00000001000b826f in rstr_count (str=17191007168, sel=0x7fff86f4c4a8, argc=1884185952, argv=<value temporarily unavailable, due to optimizations>) at string.c:5226 #2 0x00007fff82ae1e8a in -[NSConcreteTask launchWithDictionary:] () #3 0x00007fff82aeb7f4 in +[NSTask launchedTaskWithLaunchPath:arguments:] () }}} It's crashing because the arguments: parameter is supposed to be an Array. Here, a RubyString is passed, so Cocoa tries to call #count on it. However, as #count is a core method, it can't be called from Objective-C. -- Ticket URL: <http://www.macruby.org/trac/ticket/987#comment:1> MacRuby <http://macruby.org/>
#987: segfault when passing a string instead of array to NSTask.launchedTaskWithLaunchPath -----------------------------+---------------------------------------------- Reporter: lp@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: segfault when passing a string instead of array -----------------------------+---------------------------------------------- Changes (by eloy.de.enige@…): * keywords: segfault NSTask => segfault when passing a string instead of array Old description:
When executing thefollowing erroneous code, where arguments should be in an array:
framework "foundation" task = NSTask.launchedTaskWithLaunchPath("/bin/ls", arguments:"-l") p task.isRunning p task.standardOutput
I get: => Segmentation fault
New description: When executing the following erroneous code, where arguments should be an array: {{{ % macruby -e 'NSTask.launchedTaskWithLaunchPath("/bin/ls", arguments:"-l")' zsh: segmentation fault }}} -- Comment: @Laurent: I'm wondering though, shouldn't the BridgeSupport part of MR prevent the argument from being passed on at all? I.e. raise an exception? I was looking at the Foundation BS file and it seems that this method isn't even covered in Foundation.bridgesupport, just in FoundationFull.bridgesupport. Is that relevant in any way? -- Ticket URL: <http://www.macruby.org/trac/ticket/987#comment:2> MacRuby <http://macruby.org/>
#987: segfault when passing a string instead of array to NSTask.launchedTaskWithLaunchPath -----------------------------+---------------------------------------------- Reporter: lp@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: MacRuby 1.0 Component: MacRuby | Keywords: segfault when passing a string instead of array -----------------------------+---------------------------------------------- Changes (by lsansonetti@…): * milestone: => MacRuby 1.0 Comment: Eloy, the Full file isn't used by MacRuby. As this method is fully introspectable by the runtime, MacRuby will retrieve its signature from it and allow you to pass any object as the argument. Remember, Objective-C is not a static typed language as Ruby. Overall, this is the same problem as #664. -- Ticket URL: <http://www.macruby.org/trac/ticket/987#comment:3> MacRuby <http://macruby.org/>
#987: segfault when passing a string instead of array to NSTask.launchedTaskWithLaunchPath -----------------------------+---------------------------------------------- Reporter: lp@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: MacRuby Later Component: MacRuby | Keywords: segfault when passing a string instead of array -----------------------------+---------------------------------------------- Changes (by lsansonetti@…): * milestone: MacRuby 1.0 => MacRuby Later Comment: Will not be fixed for 1.0. -- Ticket URL: <http://www.macruby.org/trac/ticket/987#comment:4> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby