<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
<body>
<p>I have an issue with:</p>
<blockquote>
<p>RSErasureGalois newGalois divide: 4 by: 2.</p>
</blockquote>
<p>In the image I get 2. In the plugin I get 142, which is the value
for index 255 in the expTable. My question is how can I printf to
stdout, inside the plugin code. I tried adding some debug lines to
the c code: <br/>
</p>
printf( "a: %i\n", a );<br/>
printf( "b: %i\n", b );<br/>
logA = logTable[a];<br/>
logB = logTable[b];<br/>
printf( "logA: %i\n", logA );<br/>
printf( "logB: %i\n", logB );<br/>
logResult = logA - logB;<br/>
while (logResult <= 0) {<br/>
logResult += 0xFF;<br/>
}<br/>
if (logResult == 0) {<br/>
return 1;<br/>
}<br/>
printf( "logResult: %i\n", logResult );<br/>
result = expTable[logResult];<br/>
printf( "result: %i\n", result );<br/>
<br/>
<p>This did not work, however. How can I debug the c code?</p>
<div class="moz-signature">---<br/>
Kindly,<br/>
Robert<br/>
<br/>
<br/>
</div>
<div class="moz-cite-prefix">On 5/29/21 3:29 PM, Robert Withers
wrote:<br/>
</div>
<blockquote type="cite" cite="mid:bc8c35e2-1501-b1ce-909f-bf6455b8961a@pm.me">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<p>I commented out these argument checks and regenerated and
rebuilt the plugins. New plugins are attached.</p>
<p>Now the RSErasureGaloisWithPlugin is working, for the following
squeak calls.</p>
<blockquote>
<p>RSErasureGalois newGalois... a RSErasureGaloisWithPlugin</p>
</blockquote>
<blockquote>
<p>self addOrSubtract: 2 by: 1. = 3<br/>
self divide: 4 by: 2. = 14<br/>
self exp: 3. = 8<br/>
self exp: 2 power: 2. = 4<br/>
self log: 4. = 2<br/>
self galoisMultiply: 2 by: 2. = 4<br/>
self tableMultiply: 2 by: 2. = 4<br/>
</p>
</blockquote>
<p>I still have problems with the RSFECPlugin, calling methods in
RSFECGenericGFWithPlugin:</p>
<blockquote>
<p>RSFECGenericGF newPrimitive: 16r012D size: 256 generatorBase:
1... a RSFECGenericGFWithPlugin</p>
</blockquote>
<blockquote>
<p>self addOrSubtract: 2 by: 1. = 3<br/>
self exp: 3. {#<b>primitiveFailed</b>}<br/>
self inverse: 2. = 0<br/>
self log: 4. {#<b>primitiveFailed</b>}<br/>
self multiply: 2 by: 2. {#<b>primitiveFailed</b>}<br/>
<br/>
</p>
</blockquote>
<div class="moz-signature">---<br/>
Kindly,<br/>
Robert<br/>
<br/>
<br/>
</div>
<div class="moz-cite-prefix">On 5/29/21 2:49 PM, Robert Withers
wrote:<br/>
</div>
<blockquote type="cite" cite="mid:bb276dad-3d8c-f725-1551-4db4f3bb1a13@pm.me">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<p>Could the issue be bounds checking in the primitive? But it
is a seg-fault, not a #primitiveFailed. Thanks for any and all
help! This one has me stumped.<br/>
</p>
<blockquote>
<p> ((interpreterProxy isBytes: a)<br/>
and: [ (interpreterProxy stSizeOf: a) = 4 ])<br/>
ifFalse: [ ^interpreterProxy primitiveFailFor:
PrimErrBadArgument ].<br/>
((interpreterProxy isBytes: b)<br/>
and: [ (interpreterProxy stSizeOf: b) = 4 ])<br/>
ifFalse: [ ^interpreterProxy primitiveFailFor:
PrimErrBadArgument ].<br/>
</p>
</blockquote>
<div class="moz-signature">---<br/>
Kindly,<br/>
Robert<br/>
<br/>
<br/>
</div>
<div class="moz-cite-prefix">On 5/29/21 2:42 PM, Robert Withers
wrote:<br/>
</div>
<blockquote type="cite" cite="mid:d2c2fc15-7716-da7f-d339-a74c636bc6d9@pm.me">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<p>Here is the RSErasurePlugin.so & RSFECPlugin.so so
folks may be able to help me test the seg-fault with these
plugin and loading the latest RSErasure code:</p>
<blockquote>
<p>Installer ss<br/>
project: 'Cryptography';<br/>
install: 'ProCrypto-1-1-1';<br/>
install: 'ProCryptoTests-1-1-1'.</p>
</blockquote>
<p>Here is the code I run that leads to the seg-fault:</p>
<blockquote>
<p>RSErasureGalois newGalois.<br/>
</p>
</blockquote>
<div class="moz-signature">---<br/>
Kindly,<br/>
Robert<br/>
<br/>
<br/>
</div>
<div class="moz-cite-prefix">On 5/29/21 2:37 PM, Robert
Withers wrote:<br/>
</div>
<blockquote type="cite" cite="mid:cda38703-3e2a-3fcf-3bfc-0b8e8a0472e0@pm.me">
<pre class="moz-quote-pre" wrap="">Hey y'all,
I am getting a segmentation fault calling primitiveGaloisMultiplyBy in
my RSErasurePlugin. I have attached the crash.dmp file.
Investigating...assistance requested. Grazie!!
--
---
Kindly,
Robert
</pre>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</body></html>