Is your project publicly available?<div><br></div><div>Or can you construct a minimal reproduce case?</div><div><br></div><div>I&#39;d like to reproduce that issue here and then get a fix in ASAP.</div><div><br></div><div>
<br></div><div>Thanks,</div><div>David</div><div><br><br><div class="gmail_quote">On Thu, Jul 21, 2011 at 1:07 PM, Marco Corvo <span dir="ltr">&lt;<a href="mailto:marco.corvo@pd.infn.it">marco.corvo@pd.infn.it</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi all,<br>
<br>
I&#39;m trying to use a new feature of releases 2.8.4/5, that is the possibility to define dependencies for IMPORTED targets and when I run cmake I get a SIGSEV signal. Trying to get some more info with Valgrind I found that:<br>

<br>
-- Configuring done<br>
==5659== Invalid read of size 1<br>
==5659==    at 0x82001B0: cmTarget::IsImported() const (cmTarget.h:235)<br>
==5659==    by 0x83CA8BB: cmComputeTargetDepends::<u></u>AddTargetDepend(int, cmTarget*, bool) (cmComputeTargetDepends.cxx:<u></u>272)<br>
==5659==    by 0x83CA93E: cmComputeTargetDepends::<u></u>AddTargetDepend(int, cmTarget*, bool) (cmComputeTargetDepends.cxx:<u></u>281)<br>
==5659==    by 0x83CA93E: cmComputeTargetDepends::<u></u>AddTargetDepend(int, cmTarget*, bool) (cmComputeTargetDepends.cxx:<u></u>281)<br>
==5659==    by 0x83CAB3D: cmComputeTargetDepends::<u></u>AddTargetDepend(int, char const*, bool) (cmComputeTargetDepends.cxx:<u></u>263)<br>
==5659==    by 0x83CAC5F: cmComputeTargetDepends::<u></u>CollectTargetDepends(int) (cmComputeTargetDepends.cxx:<u></u>216)<br>
==5659==    by 0x83CAEFB: cmComputeTargetDepends::<u></u>CollectDepends() (cmComputeTargetDepends.cxx:<u></u>193)<br>
==5659==    by 0x83CB055: cmComputeTargetDepends::<u></u>Compute() (cmComputeTargetDepends.cxx:<u></u>114)<br>
==5659==    by 0x8346B4E: cmGlobalGenerator::<u></u>ComputeTargetDepends() (cmGlobalGenerator.cxx:912)<br>
==5659==    by 0x8346ECB: cmGlobalGenerator::Generate() (cmGlobalGenerator.cxx:873)<br>
==5659==    by 0x835C9AE: cmGlobalUnixMakefileGenerator3<u></u>::Generate() (<u></u>cmGlobalUnixMakefileGenerator3<u></u>.cxx:156)<br>
==5659==    by 0x8260986: cmake::Generate() (cmake.cxx:2390)<br>
==5659==  Address 0xdd is not stack&#39;d, malloc&#39;d or (recently) free&#39;d<br>
==5659==<br>
==5659==<br>
==5659== Process terminating with default action of signal 11 (SIGSEGV): dumping core<br>
==5659==  Access not within mapped region at address 0xDD<br>
==5659==    at 0x82001B0: cmTarget::IsImported() const (cmTarget.h:235)<br>
==5659==    by 0x83CA8BB: cmComputeTargetDepends::<u></u>AddTargetDepend(int, cmTarget*, bool) (cmComputeTargetDepends.cxx:<u></u>272)<br>
==5659==    by 0x83CA93E: cmComputeTargetDepends::<u></u>AddTargetDepend(int, cmTarget*, bool) (cmComputeTargetDepends.cxx:<u></u>281)<br>
==5659==    by 0x83CA93E: cmComputeTargetDepends::<u></u>AddTargetDepend(int, cmTarget*, bool) (cmComputeTargetDepends.cxx:<u></u>281)<br>
==5659==    by 0x83CAB3D: cmComputeTargetDepends::<u></u>AddTargetDepend(int, char const*, bool) (cmComputeTargetDepends.cxx:<u></u>263)<br>
==5659==    by 0x83CAC5F: cmComputeTargetDepends::<u></u>CollectTargetDepends(int) (cmComputeTargetDepends.cxx:<u></u>216)<br>
==5659==    by 0x83CAEFB: cmComputeTargetDepends::<u></u>CollectDepends() (cmComputeTargetDepends.cxx:<u></u>193)<br>
==5659==    by 0x83CB055: cmComputeTargetDepends::<u></u>Compute() (cmComputeTargetDepends.cxx:<u></u>114)<br>
==5659==    by 0x8346B4E: cmGlobalGenerator::<u></u>ComputeTargetDepends() (cmGlobalGenerator.cxx:912)<br>
==5659==    by 0x8346ECB: cmGlobalGenerator::Generate() (cmGlobalGenerator.cxx:873)<br>
==5659==    by 0x835C9AE: cmGlobalUnixMakefileGenerator3<u></u>::Generate() (<u></u>cmGlobalUnixMakefileGenerator3<u></u>.cxx:156)<br>
==5659==    by 0x8260986: cmake::Generate() (cmake.cxx:2390)<br>
<br>
So it looks like cmake is trying to access (dereference) a NULL pointer. In particular, digging in the source code, the issue arises (apparently) in cmComputeTargetDepends.cxx(<u></u>AddTargetDepend) at line 279<br>
<br>
cmTarget* transitive_dependee =<br>
        dependee-&gt;GetMakefile()-&gt;<u></u>FindTargetToUse(i-&gt;c_str());<br>
<br>
when cmake recursively calculates the dependency of my target, which relies on all IMPORTED targets, and hits an IMPORTED target (a library) with NO dependencies, that is the last leaf of my deps tree. The &quot;transitive_dependee&quot; returned by FindTargetToTuse turns out to be a NULL pointer and when IsImported() is called on it, it makes the program crash.<br>

<br>
Have anyone else tried to use this feature of cmake 2.8.4 and eventually discovered this issue?<br>
<br>
Cheers,<br>
<br>
Marco<br>
<br>
<br>
-- <br>
Marco Corvo<br>
SuperB experiment<br>
CNRS - Orsay<br>
c/o INFN - Padova<br>
______________________________<u></u>_________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/<u></u>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/<u></u>CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/<u></u>listinfo/cmake</a><br>
</blockquote></div><br></div>