<div dir="ltr"><div>Hi, <br><br>I have defined USE_MEMCPY in CoinHelperFunctions.hpp and disabled all compile optimization for speed for all Clp libs. When I run myApp.exe in debug mode from Visual Studio 2013, I got error: <br></div><div><br><b> Unhandled exception at 0x7541C54F in myApp.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.<br></b><br></div><div>which is different from last error. <br><br></div><div>It seems that a NULL pointer is dereference ? <br></div><div><br></div><div>Thanks, <br><br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 18, 2016 at 3:56 AM, John Forrest <span dir="ltr"><<a href="mailto:john.forrest@fastercoin.com" target="_blank">john.forrest@fastercoin.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<div>Robert,<br>
<br>
I agree. I use CoinMemcpyN which is same as CoinCopyN unless
-DUSE_MEMCPY defined when it uses memcpy - there is a remark at
line 255 of CoinHelperFunctions.hpp. So try defining USE_MEMCPY
in your configuration and using CoinMemcpyN in your code. If it
still errors then it may be easier to see what is wrong.<br>
<br>
John Forrest<div><div class="h5"><br>
On 17/05/16 22:56, Lacroix, Robert wrote:<br>
</div></div></div>
<blockquote type="cite"><div><div class="h5">
<div>
<p class="MsoNormal"><span>This is just a memory copy. Why is
Duff’s device being used here?</span></p>
<p class="MsoNormal"><span>Hasn’t Duff’s device been obsoleted
by modern compilers and machine architectures?</span></p>
<p class="MsoNormal"><span>Not even mentioning that the code
might not work, depending on how tricky the compiler tries
to be about optimization.</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>Try recompiling CLP with minimal
compiler optimization and see if the exception still
happens.</span></p>
<p class="MsoNormal"><span>Then tell us about the result. It
will be of special interest to those of us that rely on CLP
for decision support.</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>Robert Lacroix</span></p>
<p class="MsoNormal"><span>Manitoba Hydro</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Clp [<a href="mailto:clp-bounces@coin-or.org" target="_blank">mailto:clp-bounces@coin-or.org</a>]
<b>On Behalf Of </b>usa usa<br>
<b>Sent:</b> Friday, May 13, 2016 11:07 AM<br>
<b>To:</b> <a href="mailto:clp@list.coin-or.org" target="_blank">clp@list.coin-or.org</a><br>
<b>Subject:</b> [Clp] CLP exception poped up when solving an
LP</span></p>
<p class="MsoNormal"> </p>
<div>
<div>
<p class="MsoNormal">Hi, I am using CLP to solve an LP with
</p>
</div>
<div>
<p class="MsoNormal"> rowNum = 1002 and columNum = 6202
and totalElementNum = 6,214,404</p>
</div>
<div>
<p class="MsoNormal"><br>
In <b>CoinCopyN</b> (register const T* from, const int
size, register T* to) called from
CoinMemcpyN(ind,numels,index_), which is called from
gutsOfOpEqual(colordered, minor, major, numels, elem, ind,
start, len);</p>
</div>
<div>
<p class="MsoNormal">I got an exception: </p>
</div>
<div>
<p class="MsoNormal"><b><br>
Unhandled exception at 0x00217A52 in MyApp.exe:
0xC0000005: Access violation reading location
0x1BBEFFFC.</b></p>
</div>
<div>
<p class="MsoNormal">The exception poped up at <br>
<br>
<b>case 2: *--downto = *--downfrom;</b></p>
</div>
<div>
<p class="MsoNormal"><br>
template <class T> inline void<br>
<b>CoinCopyN</b> (register const T* from, const int size,
register T* to)<br>
{<br>
if (size == 0 || from == to)<br>
return;<br>
<br>
#ifndef NDEBUG<br>
if (size < 0)<br>
throw CoinError("trying to copy negative number of
entries",<br>
"CoinCopyN", "");<br>
#endif<br>
<br>
register int n = (size + 7) / 8; <b>// size =
6214404</b><br>
if (to > from) {<br>
register const T* downfrom = from + size;<br>
register T* downto = to + size;<br>
// Use Duff's device to copy<br>
switch (size % 8) {<br>
case 0: do{ *--downto = *--downfrom;<br>
case 7: *--downto = *--downfrom;<br>
case 6: *--downto = *--downfrom;<br>
case 5: *--downto = *--downfrom;<br>
case 4: *--downto = *--downfrom;<br>
case 3: *--downto = *--downfrom;<br>
<b> case 2: *--downto = *--downfrom; //
exception poped up here,</b><br>
case 1: *--downto = *--downfrom;<br>
}while(--n>0);<br>
}</p>
</div>
<div>
<p class="MsoNormal">I do not understand why this happed ?
</p>
</div>
<div>
<p class="MsoNormal">I have used CLP to solve some large
benchmark Lp models without problems.
</p>
</div>
<div>
<p class="MsoNormal">Any help would be appreciated. </p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">thanks!</p>
</div>
</div>
</div>
<br>
<fieldset></fieldset>
<br>
</div></div><pre>_______________________________________________
Clp mailing list
<a href="mailto:Clp@list.coin-or.org" target="_blank">Clp@list.coin-or.org</a>
<a href="http://list.coin-or.org/mailman/listinfo/clp" target="_blank">http://list.coin-or.org/mailman/listinfo/clp</a>
</pre>
</blockquote>
<br>
</div>
<br>_______________________________________________<br>
Clp mailing list<br>
<a href="mailto:Clp@list.coin-or.org">Clp@list.coin-or.org</a><br>
<a href="http://list.coin-or.org/mailman/listinfo/clp" rel="noreferrer" target="_blank">http://list.coin-or.org/mailman/listinfo/clp</a><br>
<br></blockquote></div><br></div></div>