Bug 217052 - segfault + PATCH fixing this
segfault + PATCH fixing this
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: cmake (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Orion Poplawski
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-11-23 09:50 EST by Hans de Goede
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version: 2.4.4-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-11-28 11:20:11 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
PATCH fixing a crash (581 bytes, patch)
2006-11-23 09:50 EST, Hans de Goede
no flags Details | Diff

  None (edit)
Description Hans de Goede 2006-11-23 09:50:23 EST
Hi,

About a week ago I asked for easy to reproduce and potentially easy to fix bugs 
for my CS students (I'm a CS teacher) to work on. One of the bug reports which 
I received was this one (which wasn't in BZ yet, so I'm entering it now):

| -- CMakeLists.txt --
| include(foo.cmake)
| foo()
| 
| -- foo.cmake --
| macro(foo)
|         message(SEND_ERROR "foo")
| endmacro(foo)
|
| $ cmake CMakeLists.txt
| ...
| Segmentation fault (core dumped)

with Extra's cmake-2.4.3-3.fc5

I did not had time yet to test it with recent cmake version.

---

My student has taken a look at this and the problem is that when an error is 
thrown during execution, rather then during parsing as this code does, then the 
args vector which should contain the filename and lineno as args[0] is empty. 
This seems to be normal as the code just above the code causing the crash 
checks for an empty args vector.

This patch fixes this issue by using newLFF.Arguments[0] instead of args[0], as
newLFF.Arguments[0] gets filed in a code path which checks that args is not a 0 
sized vector and otherwise fills newLFF.Arguments[0] with a filename 
of "unknown" instead of crashing.

Also could you please send this upstream ?
Comment 1 Hans de Goede 2006-11-23 09:50:25 EST
Created attachment 141996 [details]
PATCH fixing a crash
Comment 2 Orion Poplawski 2006-11-27 17:01:46 EST
This is fixed in cmake 2.4.4.
Comment 3 Hans de Goede 2006-11-28 03:08:20 EST
Any chance on upgrading to 2.4.4 then? I find closed upstream a rather strange
resolution instead I would expect you to update the FE packages and close this
as nextrelease.
Comment 4 Orion Poplawski 2006-11-28 11:20:11 EST
2.4.4 was built for all releases yesterday.  I chose upstream because that's
where the bug was fixed, but maybe that wasn't the right choice.  I've closed
current release with 2.4.4-1.
Comment 5 Hans de Goede 2006-11-28 14:29:28 EST
Yes, much better, thanks. upstream is usually used for not a packaging problem
and cannot / willnot fix it in Fedora because it requires someone really
intimate with the code so let upstream figure it out.

Note You need to log in before you can comment on or make changes to this bug.