Bug 217052

Summary: segfault + PATCH fixing this
Product: [Fedora] Fedora Reporter: Hans de Goede <hdegoede>
Component: cmakeAssignee: Orion Poplawski <orion>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: extras-qa, rh-bugzilla
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 2.4.4-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-11-28 16:20:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
PATCH fixing a crash none

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.