Bug 217052 - segfault + PATCH fixing this
Summary: segfault + PATCH fixing this
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: cmake
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Orion Poplawski
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-11-23 14:50 UTC by Hans de Goede
Modified: 2007-11-30 22:11 UTC (History)
2 users (show)

Fixed In Version: 2.4.4-1
Clone Of:
Environment:
Last Closed: 2006-11-28 16:20:11 UTC
Type: ---
Embargoed:


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

Description Hans de Goede 2006-11-23 14:50:23 UTC
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 14:50:25 UTC
Created attachment 141996 [details]
PATCH fixing a crash

Comment 2 Orion Poplawski 2006-11-27 22:01:46 UTC
This is fixed in cmake 2.4.4.

Comment 3 Hans de Goede 2006-11-28 08:08:20 UTC
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 16:20:11 UTC
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 19:29:28 UTC
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.