[TxMt] [TM2] weird crash

Hans-Jörg Bibiko bibiko at eva.mpg.de
Tue Apr 3 12:07:45 UTC 2012


Hi,

I have a a kind of a weird crash with TM2 (I encountered it several weeks ago but now I do need the procedure quite often). I'm on MacOSX 10.7.3 (9110).

I have created a new bundle with several commands. All these command have the same structure:
Save: Nothing
Input: Nothing
Output: Show in New Window
Caret: After Output

and the actual command:
#!/usr/bin/env bash
[[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh"

pbpaste | perl -e '

$word = <>;
chomp($word);
...
print $result;
'


In other words each of these commands takes the content of the clipboard and send it to a Perl script. The script and the clipboard's content have to handle real UTF-8 stuff and the PErl script contains lots of non-ASCII characters.

Now the weird thing: The crash doesn't always occur. I tried to find a more or less 'reproducible' workflow.

- TM2 is not running
- I copied a word from another program into the clipboard
- I open TM2
- an 'untitled' window appears
- I invoke one of these commands in question
- TM2 crashes with: 
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libundo.dylib                 	0x004e3f79 ng::undo_manager_t::end_undo_group(ng::ranges_t const&) + 11
1   com.macromates.TextMate.OakTextView	0x005d9356 0x5a9000 + 197462
2   com.macromates.TextMate.OakTextView	0x005c1242 0x5a9000 + 98882
3   com.apple.AppKit              	0x93315727 -[NSView _performKeyEquivalent:conditionally:] + 49
4   com.apple.AppKit              	0x93315914 -[NSView performKeyEquivalent:] + 340

BUT THEN I reopen TM2 and do _exactly_ the same and IT WORKS!
Step two of WEIRDNESS: If I quit TM2 after that and reopen it and run the command with the same clipboard content again TM2 crashes once again.

It doens't matter whether I invoke the command via key equivalent or via mouse Bundles > ...

I didn't encounter that problem if TM2 was running before I copied the text, switched to TM2, and invoked the command.


Any help, fix would be really appreciated :)

For more details, don't hesitate to contact me.

Cheers,
--Hans






More information about the textmate mailing list