[haiku-development] VIm episodes: II. The Crash.

  • From: Siarzhuk Zharski <zharik@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 21 Apr 2009 07:44:23 +0200

Hi Axel!

Axel Dörfler wrote:
Siarzhuk Zharski <zharik@xxxxxx> wrote:
I have build Vim 7.2 with BeOS GUI on Haiku. Current version of BeOS GUI code in Vim 6.4 use following trick to determine if Vim was started from the Tracker:
[...]
    if (!isatty(0)) {
    struct stat stat_stdin, stat_dev_null;

    if (fstat(0, &stat_stdin) == -1 ||
        stat("/dev/null", &stat_dev_null) == -1 ||
        (stat_stdin.st_dev == stat_dev_null.st_dev &&
         stat_stdin.st_ino == stat_dev_null.st_ino))
        gui.starting = TRUE;
    }
---------
But this doesn't work with Haiku.

This code works fine under Haiku, I just tested it.
Are you sure you haven't changed your Bootscript and redirected its output to /dev/dprintf or something like that?
Ups... Looks like I was wrong. Sorry, folks! Just tested this code again with extra tracing and it works. :-( The problem is something elsewhere - all I have found - some lines in the syslog during attempt to start vim from Tracker:

KERN: vm_soft_fault: va 0x0 not covered by area in address space
KERN: vm_page_fault: vm_soft_fault returned error 'Bad address' on fault at 0x0, ip 0x340043, write 0, user 1, thread 0x1379 KERN: vm_page_fault: thread "vim main()" (4985) in team "vim" (4984) tried to read address 0x0, ip 0x340043 ("vim_seg0ro" +0x140043)
KERN: stack trace:
KERN:   0x002aa44f (vim_seg0ro + 0xaa44f)
KERN:   0x003580d9 (vim_seg0ro + 0x1580d9)KERN:
KERN:   0x006529f0 (libroot.so_seg0ro + 0x279f0)
KERN:   0x7003ffec (vim main()_4985_stack + 0x3ffec)
KERN: vm_soft_fault: va 0x0 not covered by area in address space
KERN: vm_page_fault: vm_soft_fault returned error 'Bad address' on fault at 0x0, ip 0x800d46ec, write 0, user 0, thread 0x1379

Looks like it silently crashed during start - no vim windows displayed. I wonder why it doesn't catched by gdb as usual access violations in user programs? Are there any tricks to start it under gdb in the same way as from Tracker? Thank you.

Kind Regard,
  S.Zharski




Other related posts: