Opened 10 years ago

Closed 6 years ago

#44279 closed defect (fixed)

screen 4.2.1_0 builds okay, but crashes with "Abort trap"

Reported by: alexander.coers@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.3.1
Keywords: Cc:
Port: screen

Description

On my OS X 10.5.8 PPC G4 with Xcode 3.1.4 I can build screen 4.2.1_0 without errors. Starting screen with -v will produce the correct version output. Any other option (or none) will just show an "Abort trap" crash. Going back to the earlier version 4.0.3_3+vertical_split using revision 95934 solves the issue.

Change History (3)

comment:1 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

MacPorts currently has no maintainer for the screen port, so you should report this to screen's developers. However, note that Mac OS X 10.5.8 is very old and the developers may not be able to solve this issue.

comment:2 Changed 10 years ago by irgendetwas@…

This appears to be because the realpath function under osx 10.5.8 does not handle the second argument being NULL as per spec.

in tty.c adding a buffer for realpath to work in and removing the free at the end allows screen to work properly under osx 10.5.8.

now if someone who knows how to make the patches and fix the port files wants to correct this, it would be much appreciated :-)

int
CheckTtyname (tty)
char *tty;
{
  struct stat st;
  char * real;
  char   realbuf[PATH_MAX]; //-------- buffer added
  int rc;

  real = realpath(tty, realbuf); //----------- NULL -> realbuf
  if (!real)
    return -1;

  if (lstat(real, &st) || !S_ISCHR(st.st_mode) ||
    (st.st_nlink > 1 && strncmp(real, "/dev/", 5)))
    rc = -1;
  else
    rc = 0;

  //free(real); //-------------- commented out
  return rc;
}

comment:3 Changed 6 years ago by dgilman (David Gilman)

Resolution: fixed
Status: newclosed

In 7c8e45245901fcd37fdf2263f2d2b61f034d2444/macports-ports (master):

screen: update to 4.6.2

Big reorganization of how this portfile gets patched. I went back to
Apple's screen-22 source, extracted their patches, rebased them against
latest, and put them together in a single file patch-apple.diff which
contains all of them. I think this will be more manageable going
forward.

I figured out the purpose of patch-config.h.in.diff and left a note in
that file explaining what it does.

I removed support for the MacOS X 10.5 patches. I have no machine to
test this and those are pretty old systems anyway.

Patches I removed:

  • patch-Makefile.in.diff: Upstream builds just fine without this, so

removing them. It stripped CFLAGS from a build line, no idea what the
offending CFLAGS might have been.

  • patch-configure-libelf.diff: This is a fix to a ./configure check for

the existence of SVR4. We are not SVR4, who cares if it is broken.
patch-configure.diff: More fixes to ./configure to detect utmp support.
Apple's patch uses /usr/bin/login to handle utmp so no need for
this.

  • patch-marxargs.diff: Not used in old portfile.
  • patch-process.c-fix-bogus-strncpy-size.diff: Fixed upstream.
  • patch-pty.c.diff: Not used in old portfile.
  • patch-screen.c-leopard.diff: Removed 10.5 support.
  • patch-utmp.c: This appears to be a half-hearted attempt at fixing up

utmp support under MacOS X. Unfortunately for the patch author MacOS X
does not have a utmp, it uses utmpx, and we disable support for utmp
editing at compile time. This patch is pointless and was removed.

  • patch-windowsize.diff: This patch has been updated but in a slightly

different form.

Patches that are now part of patch-apple.diff:

  • patch-screen.c.diff
  • patch-window.c.diff

Closes: #44279
Closes: #53355
Closes: #51395

Note: See TracTickets for help on using tickets.