Bug 154483 - [patch] devel/cgdb -- fix segfault on amd64
Summary: [patch] devel/cgdb -- fix segfault on amd64
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Cheng-Lung Sung
Depends on:
Reported: 2011-02-03 11:20 UTC by Pietro Cerutti
Modified: 2011-02-03 13:50 UTC (History)
0 users

See Also:

file.diff (261 bytes, patch)
2011-02-03 11:20 UTC, Pietro Cerutti
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pietro Cerutti freebsd_committer 2011-02-03 11:20:07 UTC
A missing declaration of void *cgdb_malloc(size_t) makes the compiler assume that the function return int, thus truncating the returned 64-bit pointer to 32 bits.
This causes the returned malloc'd pointer to point to an invalid location, thus causing the seg-fault. This has been discussed with one of the authors on IRC, a fix will be included in the next version upstream. I think it is important nonetheless to include a patch immediately to prevent systematic segfaults on amd64.

Fix: Add this patch.

Patch attached with submission follows:
How-To-Repeat: Run cgdb on amd64.
Comment 1 Edwin Groothuis freebsd_committer 2011-02-03 11:20:14 UTC
Responsible Changed
From-To: freebsd-ports-bugs->clsung

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer 2011-02-03 13:43:14 UTC
gahr        2011-02-03 13:43:10 UTC

  FreeBSD ports repository

  Modified files:
    devel/cgdb           Makefile distinfo 
  Added files:
    devel/cgdb/files     patch-rline.c 
  - Fix a segfault at application start on amd64
  - Remove MD5 checksum from distinfo
  PR:             154483
  Submitted by:   gahr
  Approved by:    clsung (maintainer)
  Feature safe:   yes
  Revision  Changes    Path
  1.21      +1 -0      ports/devel/cgdb/Makefile
  1.6       +0 -1      ports/devel/cgdb/distinfo
  1.1       +11 -0     ports/devel/cgdb/files/patch-rline.c (new)
cvs-all@freebsd.org mailing list
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 3 Pietro Cerutti freebsd_committer 2011-02-03 13:43:24 UTC
State Changed
From-To: open->closed

Committed. Thanks!