Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 4642 - Vim 6.1-r1 ACCESS VIOLATION error
Summary: Vim 6.1-r1 ACCESS VIOLATION error
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Michael M Nazaroff (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-07-07 09:23 UTC by Milosz
Modified: 2003-02-04 19:42 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Milosz 2002-07-07 09:23:59 UTC
this sais it it all (vim won't build after rsyncing):

--------------------------- ACCESS VIOLATION SUMMARY ---------------------------
LOG FILE = "/tmp/sandbox-vim-6.1-r8-17415.log"

chmod:     /dev/pty/s0
chmod:     /dev/pty/s0
--------------------------------------------------------------------------------
!!! emerge aborting on  /usr/portage/app-editors/vim/vim-6.1-r8.ebuild .
Comment 1 Michael M Nazaroff (RETIRED) gentoo-dev 2002-07-09 20:24:48 UTC
Uh it should work now.. my mistake
Comment 2 Milosz 2002-07-09 22:54:09 UTC
I rsync and remerged vim now, and this is funny (one pty more): 

--------------------------- ACCESS VIOLATION SUMMARY
---------------------------LOG FILE = "/tmp/sandbox-vim-6.1-r8-4145.log"

chmod:     /dev/pty/s1
chmod:     /dev/pty/s1
--------------------------------------------------------------------------------!!!
emerge aborting on  /usr/portage/app-editors/vim/vim-6.1-r8.ebuild .
Comment 3 Milosz 2002-07-10 00:22:47 UTC
I rsync and remerged vim now, and this is funny (one pty more): 

--------------------------- ACCESS VIOLATION SUMMARY
---------------------------LOG FILE = "/tmp/sandbox-vim-6.1-r8-4145.log"

chmod:     /dev/pty/s1
chmod:     /dev/pty/s1
--------------------------------------------------------------------------------!!!
emerge aborting on  /usr/portage/app-editors/vim/vim-6.1-r8.ebuild .
Comment 4 Milosz 2002-07-11 21:04:47 UTC
Ok this is past funny now, once it fails on s0, then s1, than thats fixed and
then s2 now back to s0 again:

--------------------------- ACCESS VIOLATION SUMMARY
---------------------------LOG FILE = "/tmp/sandbox-vim-6.1-r8-3478.log"

chmod:     /dev/pty/s0
chmod:     /dev/pty/s0
--------------------------------------------------------------------------------
Comment 5 Michael M Nazaroff (RETIRED) gentoo-dev 2002-07-12 01:48:48 UTC
Ok at which point in the ebuild does this happin install or make stage?
Also are you sshed into the box and trying to emerge vim?
maybe try this:
ebuild vim-6.1-r8.ebuild compile
ebuild vim-6.1-r8.ebuild install
ebuild vim-6.1-r8.ebuild merge


see where it breaks at.. I need more info.. the addpredict line should be
working..but it's in the src_compile() stage only..

Naz
Comment 6 Markus Krainer 2002-07-15 16:16:52 UTC
I have the same sandbox violation as Milosz.
I found out that it only happens when emerging from within an X terminal
(gnome-terminal) and that the /dev/pty/s? is obviously the terminal from
which you emerge (thus the different numbers).

Emerging from console (/dev/vc/1) is ok. 

hth,
Markus
Comment 7 Michael M Nazaroff (RETIRED) gentoo-dev 2002-07-27 18:15:19 UTC
Markus I still cant' reproduce the bug locally.. can you maybe try to add this
line into the ebuild

right under the addwrite /dev/pty/* line
addpredict /dev/pty/*

or maybe under the src_install() {
addpredict /dev/pty/* try both and see what happens, tell me if it works or not.

Naz

hmm well maybe I will just add the ebuild in few with these updates.. along with
a digest and have your test with those.. :o)
Comment 8 Markus Krainer 2002-07-30 09:20:26 UTC
Tried 'addpredict' in src_compile and src_install with no luck -> still
same access violation.

I did another test and did 
# USE="-*" emerge vim
and I got the same violation but instead of 2 times 
"chmod:     /dev/pty/s1" I only got it once.

I'm currently short on time but I will have a deeper look into this bug maybe
weekend.


Until then, here are some more information to reproduce this error:
profile: default-1.0-gcc3
kernel: 2.4.19-gentoo-r7
CFLAGS="-march=athlon-tbird -O3 -fomit-frame-pointer -pipe"
glibc-2.2.5-r5
gcc-3.1-r7
emerge is done in a gnome-terminal-2.0.0-r1 when the violation occurs.

 Markus
Comment 9 Martin Holzer (RETIRED) gentoo-dev 2002-08-02 02:57:11 UTC
its like bug #5766
Comment 10 Markus Krainer 2002-08-02 11:28:49 UTC
If you look into the configure script of vim you find a section that tests if 
the /dev/pty's are world writeable (line 5683ff). For that purpose there's a 
small program that looks like that:


main()
{
  struct stat sb;
  char *x,*ttyname();
  int om, m;
  FILE *fp;

  if (!(x = ttyname(0))) exit(1);
  if (stat(x, &sb)) exit(1);
  om = sb.st_mode;
  if (om & 002) exit(0);
  m = system("mesg y");
  if (m == -1 || m == 127) exit(1);
  if (stat(x, &sb)) exit(1);
  m = sb.st_mode;
  if (chmod(x, om)) exit(1);             <---- causes sandbox violation
  if (m & 002) exit(0);
  if (sb.st_gid == getgid()) exit(1);
  if (!(fp=fopen("conftest_grp", "w")))
    exit(1);
  fprintf(fp, "%d\n", sb.st_gid);
  fclose(fp);
  exit(0);
}

The marked line causes the sandbox violation. (Oddly enough the "mesg y" doesn't 
cause sb violation!)

2 questions:

1) Why does vim check for world writeable perms on these files?
2) Shouldn't "addwrite /dev/pty/*" allow the chmod?

 -Markus-
Comment 11 Michael M Nazaroff (RETIRED) gentoo-dev 2002-08-23 11:37:24 UTC
addwrite /dev/pty/* is in the newest vim r9? is this still a issue for you guys?
 I would love to hear..

Naz
Comment 12 Markus Krainer 2002-08-25 13:35:31 UTC
addwrite has already been in r8 and it didn't work.
However, it works for me now with r10 (r8 now works, too!!).


Comment 13 Michael M Nazaroff (RETIRED) gentoo-dev 2002-08-27 23:54:20 UTC
Ok I finally think this one is dead, I'm going to say this one is fixed.

I hope you agree

Naz