sac2c issueshttps://gitlab.sac-home.org/sac-group/sac2c/-/issues2017-11-19T20:28:04Zhttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/1172Ubuntu can't see libArray.so using sac2c-follow2017-11-19T20:28:04ZRobert BerneckyUbuntu can't see libArray.so using sac2c-follow| | |
| --- | --- |
| Bugzilla Link | [1138](http://bugs.sac-home.org/show_bug.cgi?id=1138) |
| Created on | Sep 30, 2014 16:20 |
| Version | svn |
| OS | Linux |
| Architecture | PC |
## Extended Description
<pre>I just recompiled s...| | |
| --- | --- |
| Bugzilla Link | [1138](http://bugs.sac-home.org/show_bug.cgi?id=1138) |
| Created on | Sep 30, 2014 16:20 |
| Version | svn |
| OS | Linux |
| Architecture | PC |
## Extended Description
<pre>I just recompiled sac2c and the stdlib from scratch, under sac2c-follow
on Ubuntu 14.04 LTS.
At this point, I am unable to compile anything that uses the standard
library:
ls /usr/local/libexec/sac2c/18614
comslc ctest libsac2c.so sac2c-p saccc tree
csima libsac2c.d.so sac2c sac2tex sacpolylibisnullintersect
csimt libsac2c.p.so sac2c-d sac4c sacprapolyhedral
sac@rattler:~/sac/testsuite/optimizations/awlf$ sac2c time2code.sac
MT_MODE = 0 in target, forcing -numthreads to 1.
** 1: Loading SAC program ...
**** Locating source code ...
Reading from file "./time2code.sac" ...
**** Running C preprocessor ...
**** Parsing input file ...
abort: Cannot find library `tree/host/libArrayTree.so' for module `Array'
compilation failed while Loading SAC program.
sac@rattler:~/sac/testsuite/optimizations/awlf$ ls /usr/local/libexec/sac2c/18614/tree/host/
libsacpreludeTree.so
I see that there is nothing under tree/host except the sacprelude, so
the abort makes sense.
I looked for some help on the sac-home web site, here:
http://www.sac-home.org/index.php?p=.%2F55_Download%2F41_Installation%2F41_Trouble_Shooting
cat $SAC2CBASE/sac2crc
# Circumvent ubuntu linker problem.
target seq:
CFLAGS += " --Wl,--no-as-needed "
There is an empty .sac2crc in /home/sac.
I am guessing something is wrong with the install of the generated
stdlib.
sudo make install
for the stdlib shows, in part, this:
Making install for target mt_pth
** Note: modules Dislin DislinBars DislinQuick DislinCanvas DislinPage DislinPlot3d DislinSystem disabled due to configuration.
make[3]: Entering directory `/home/sac/sac/BASE/stdlib'
/usr/bin/install -c -d /usr/local/libexec/sac2c/18604/tree/host
/usr/bin/install -c -d /usr/local/lib/sac2c/18604/modlibs/host/mt-pth
sac2c-p -V
sac2c v1.00-beta (Haggis And Apple)
product rev 18614
(Mon Sep 29 16:03:13 EDT 2014 by sac)
sac@rattler:~/sac/testsuite/optimizations/awlf$ sac2c-d -V
sac2c v1.00-beta (Haggis And Apple)
developer rev 18614
Eventually, I did a .configure in the stdlib before building
and installing the stdlib. That resolved the above problem,
but things then die in the linker, as noted in an earlier bug report.
This strikes me as something that is going to break a lot
of attempts to work with sac2c. Perhaps the makefile
can be fancied up so that it detects when sac2c has been changed,
and force a rerun of configure, or else abort with a suitable
error message?</pre>BugZillaBugZillahttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/1173sac2crc information confusing or missing2017-11-19T20:28:07ZRobert Berneckysac2crc information confusing or missing| | |
| --- | --- |
| Bugzilla Link | [1139](http://bugs.sac-home.org/show_bug.cgi?id=1139) |
| Created on | Sep 30, 2014 22:44 |
| Version | svn |
| OS | Linux |
| Architecture | PC |
## Extended Description
<pre>I am trying to make...| | |
| --- | --- |
| Bugzilla Link | [1139](http://bugs.sac-home.org/show_bug.cgi?id=1139) |
| Created on | Sep 30, 2014 22:44 |
| Version | svn |
| OS | Linux |
| Architecture | PC |
## Extended Description
<pre>I am trying to make sac2c use a gcc linker option, but am not
having much luck. Here's what I tried:
sac2c time2code.sac -v1
/usr/local/lib/sac2c/18614/rt/host/seq/libsac.so: undefined reference to `SAC_HM_ShowDiagnostics'
collect2: error: ld returned 1 exit status
abort: System failed to execute shell command
abort: gcc -std=gnu99 /tmp/SAC_0XIPol/a.out.o
abort: -L/usr/local/lib/sac2c/18614/modlibs/host/seq
abort: -Wl,-rpath,/usr/local/lib/sac2c/18614/modlibs/host/seq
abort: -L/usr/local/lib/sac2c/18614/modlibs/host/seq
abort: -Wl,-rpath,/usr/local/lib/sac2c/18614/modlibs/host/seq -L./host/seq
abort: -Wl,-rpath,./host/seq -L/usr/local/lib/sac2c/18614/rt/host/seq
abort: -Wl,-rpath,/usr/local/lib/sac2c/18614/rt/host/seq -lArrayMod
abort: -lArrayTransformMod -lConstantsMod -lArrayArithMod -lArrayBasicsMod -lBoolMod
abort: -lScalarArithMod -lsacpreludeMod -L/usr/local/dislin
abort: -Wl,-rpath,/usr/local/dislin -L/opt/local/lib -Wl,-rpath,/opt/local/lib
abort: -lsacphmc -lsac -lsacphmc -o a.out
abort: with exit code 1
compilation failed while Creating binary code.
This looks like the changed gcc linker behavior, where it no longer
does the "as-needed" inclusion of .so files.
I tried to fix this by creating /home/sac/.sac2crc, as follows:
target add_seq:
CFLAGS += " --Wl,--no-as-needed "
Compiling with this file produces the above result. I.e.,
it looks like the flags are NOT being used in the command line.
I know that the file IS being read, because if I spell the first
line as "xtarget" rather than "target", then the sac2c parser complains.
sac2c -V
sac2c v1.00-beta (Haggis And Apple)
developer rev 18614</pre>BugZillaBugZillahttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/1179Runtime error: corrupted / missing heap administration data encountered2017-11-19T20:28:27ZThomas MachtRuntime error: corrupted / missing heap administration data encountered| | |
| --- | --- |
| Bugzilla Link | [1158](http://bugs.sac-home.org/show_bug.cgi?id=1158) |
| Created on | Jun 01, 2015 17:00 |
| Version | svn |
| OS | Linux |
| Architecture | PC |
| Attachments | [modarray_reuse.sac](/uploads/5d01...| | |
| --- | --- |
| Bugzilla Link | [1158](http://bugs.sac-home.org/show_bug.cgi?id=1158) |
| Created on | Jun 01, 2015 17:00 |
| Version | svn |
| OS | Linux |
| Architecture | PC |
| Attachments | [modarray_reuse.sac](/uploads/5d014ea663a87ca6f9b32627fa7ce978/modarray_reuse.sac) |
## Extended Description
<pre>*** SAC runtime error
*** Corrupted / missing heap administration data encountered upon memory de-allocation in arena 5
when compiling the attached example program with
sac2c -v0 -check hc modarray_reuse.sac
-check Incorporate runtime checks into executable program.
h: Use diagnostic heap manager.
c: Perform conformity checks.</pre>BugZillaBugZillahttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/1507Bobbo is confused or the compiler gens crummy code2017-11-19T20:57:34ZRobert BerneckyBobbo is confused or the compiler gens crummy code| | |
| --- | --- |
| Bugzilla Link | [88](http://bugs.sac-home.org/show_bug.cgi?id=88) |
| Created on | Jun 22, 2005 17:45 |
| Resolution | WONTFIX |
| Resolved on | Jun 27, 2005 12:01 |
| Version | 1.00beta |
| OS | Linux |
| Archite...| | |
| --- | --- |
| Bugzilla Link | [88](http://bugs.sac-home.org/show_bug.cgi?id=88) |
| Created on | Jun 22, 2005 17:45 |
| Resolution | WONTFIX |
| Resolved on | Jun 27, 2005 12:01 |
| Version | 1.00beta |
| OS | Linux |
| Architecture | PC |
| Attachments | [reduce.sac](/uploads/d440239df768f80017932c488bdd05e4/reduce.sac) |
## Extended Description
<pre>The attached reduce.sac gets a seg fault, apparently in the FirstAxisReduce code.
I am suspicious of my understanding of that function and its friend, fold.
Several questions:
1.Is tensor[iv] restricted to produce a scalar result, or does it have the
same semantics as "psel"? If the former, then the seg fault may be explainable.
2. I can't seem to get at psel in the ArrayBasics module. I've tried it with
and without #define SCALAR_SEL, with no luck. Feeling stupid today.</pre>Dietmar KreyeDietmar Kreyehttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/1530Runtime error: Assignment with incompatible types found!2017-11-19T20:59:54ZRobert BerneckyRuntime error: Assignment with incompatible types found!| | |
| --- | --- |
| Bugzilla Link | [62](http://bugs.sac-home.org/show_bug.cgi?id=62) |
| Created on | Sep 22, 2004 18:24 |
| Resolution | FIXED |
| Resolved on | Sep 27, 2004 10:13 |
| Version | 1.00beta |
| OS | Linux |
| Architect...| | |
| --- | --- |
| Bugzilla Link | [62](http://bugs.sac-home.org/show_bug.cgi?id=62) |
| Created on | Sep 22, 2004 18:24 |
| Resolution | FIXED |
| Resolved on | Sep 27, 2004 10:13 |
| Version | 1.00beta |
| OS | Linux |
| Architecture | PC |
| Attachments | [bug_62.sac](/uploads/1959b5dd9baf5410e3bd27d3a3da6faf/bug_62.sac), [bug_62.c](/uploads/3ab0f62b592ec59ab2a1e187dd2d72ba/bug_62.c) |
## Extended Description
<pre>The attached indexref.sac compiles OK, but
produces a run-time error when trying to execute
the last call to FromArray.
This uses a download of sac2c dated 2004-09-22.</pre>Kai TrojahnerKai Trojahnerhttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/1534segfault in tutorial/L2*/relaxation.sac2017-11-19T21:00:16ZSven-Bodo Scholzsegfault in tutorial/L2*/relaxation.sac| | |
| --- | --- |
| Bugzilla Link | [93](http://bugs.sac-home.org/show_bug.cgi?id=93) |
| Created on | Jun 27, 2005 12:22 |
| Resolution | FIXED |
| Resolved on | Jun 28, 2005 16:28 |
| Version | 1.00beta |
| OS | Linux |
| Architect...| | |
| --- | --- |
| Bugzilla Link | [93](http://bugs.sac-home.org/show_bug.cgi?id=93) |
| Created on | Jun 27, 2005 12:22 |
| Resolution | FIXED |
| Resolved on | Jun 28, 2005 16:28 |
| Version | 1.00beta |
| OS | Linux |
| Architecture | PC |
## Extended Description
could be the same as 91Kai TrojahnerKai Trojahnerhttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/1535segfault in APLtomcatv2017-11-19T21:00:21ZSven-Bodo Scholzsegfault in APLtomcatv| | |
| --- | --- |
| Bugzilla Link | [94](http://bugs.sac-home.org/show_bug.cgi?id=94) |
| Created on | Jun 27, 2005 12:25 |
| Resolution | FIXED |
| Resolved on | Jun 28, 2005 16:25 |
| Version | 1.00beta |
| OS | Linux |
| Architect...| | |
| --- | --- |
| Bugzilla Link | [94](http://bugs.sac-home.org/show_bug.cgi?id=94) |
| Created on | Jun 27, 2005 12:25 |
| Resolution | FIXED |
| Resolved on | Jun 28, 2005 16:25 |
| Version | 1.00beta |
| OS | Linux |
| Architecture | PC |
## Extended Description
could be the same as 91Kai TrojahnerKai Trojahnerhttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/1536segfault in pde12017-11-19T21:00:26ZSven-Bodo Scholzsegfault in pde1| | |
| --- | --- |
| Bugzilla Link | [95](http://bugs.sac-home.org/show_bug.cgi?id=95) |
| Created on | Jun 27, 2005 12:26 |
| Resolution | FIXED |
| Resolved on | Jun 28, 2005 16:11 |
| Version | 1.00beta |
| OS | Linux |
| Architect...| | |
| --- | --- |
| Bugzilla Link | [95](http://bugs.sac-home.org/show_bug.cgi?id=95) |
| Created on | Jun 27, 2005 12:26 |
| Resolution | FIXED |
| Resolved on | Jun 28, 2005 16:11 |
| Version | 1.00beta |
| OS | Linux |
| Architecture | PC |
## Extended Description
could be the same as 91Kai TrojahnerKai Trojahnerhttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/1538free error at runtime in E-122017-11-19T21:00:37ZSven-Bodo Scholzfree error at runtime in E-12| | |
| --- | --- |
| Bugzilla Link | [103](http://bugs.sac-home.org/show_bug.cgi?id=103) |
| Created on | Jun 29, 2005 19:15 |
| Resolution | FIXED |
| Resolved on | Jul 03, 2005 19:22 |
| Version | 1.00beta |
| OS | Linux |
| Archite...| | |
| --- | --- |
| Bugzilla Link | [103](http://bugs.sac-home.org/show_bug.cgi?id=103) |
| Created on | Jun 29, 2005 19:15 |
| Resolution | FIXED |
| Resolved on | Jul 03, 2005 19:22 |
| Version | 1.00beta |
| OS | Linux |
| Architecture | PC |
## Extended Description
<pre>running E-12 in the tutorial yields:
Dimension: 2
Shape : < 10, 0>
<>
Dimension: 2
Shape : < 10, 0>
<>
Dimension: 2
Shape : < 0, 10>
<>
*** glibc detected *** double free or corruption: 0x08058228 ***
*** glibc detected *** double free or corruption: 0x08058038 ***
Dimension: 2
Shape : < 10, 0>
<>
options used for building the stdlib:
SAC2CFLAGS += -v0 -maxspec 0 -O3 -noOPT -doDFR -doDCR -doRCO -doUIP -doDR -doIPC
-doSRF -check tb
for E12.sac:
sac2c -O3 -maxspec 0 -noOPT -doDFR -check tb -o E-12 E-12.sac</pre>Kai TrojahnerKai Trojahnerhttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/1553Mystery memory-eater in for loop?2017-11-19T21:02:07ZRobert BerneckyMystery memory-eater in for loop?| | |
| --- | --- |
| Bugzilla Link | [200](http://bugs.sac-home.org/show_bug.cgi?id=200) |
| Created on | Jan 31, 2006 00:18 |
| Resolution | FIXED |
| Resolved on | Feb 02, 2006 17:00 |
| Version | 1.00beta |
| OS | Linux |
| Archite...| | |
| --- | --- |
| Bugzilla Link | [200](http://bugs.sac-home.org/show_bug.cgi?id=200) |
| Created on | Jan 31, 2006 00:18 |
| Resolution | FIXED |
| Resolved on | Feb 02, 2006 17:00 |
| Version | 1.00beta |
| OS | Linux |
| Architecture | PC |
| Attachments | [rle.sac](/uploads/4b6354d2dc50aa8ef72c3c5c64f5e441/rle.sac), [mdiv.sac](/uploads/c53ea308178285dc2b5e0db9f4643fbf/mdiv.sac), [crud5.sac](/uploads/007ec460adfced1038f5695c080b5256/crud5.sac), [sliii.sac](/uploads/8bbf3cce40ca7d2e1f002ae2f3c7bc6c/sliii.sac) |
## Extended Description
<pre>I'm not sure what's going on with the attached, but
it dies at run-time, apparently in the middle of what
looks like an innocent FOR loop, unable to allocate
about 1 MB of memory, or so says the SAC run-time.
The function slIII is the apparent villain, with sac2c -O3.
Compiling with -check tb -noOPT fails in a similar way,
but the system gets in a memory thrash (1.3 GB and rising)
before the FOR loop completes.
The slIII function starts, but never finishes, if the embedded
print statements are to be believed.</pre>Kai TrojahnerKai Trojahnerhttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/1569buildv2.sac has Alzheimer's disease w/-dosaa -nophm2017-11-19T21:03:47ZRobert Berneckybuildv2.sac has Alzheimer's disease w/-dosaa -nophm| | |
| --- | --- |
| Bugzilla Link | [384](http://bugs.sac-home.org/show_bug.cgi?id=384) |
| Created on | Jul 05, 2007 19:57 |
| Resolution | DUPLICATE |
| Resolved on | Nov 09, 2007 23:49 |
| Version | 1.00beta |
| OS | Linux |
| Arc...| | |
| --- | --- |
| Bugzilla Link | [384](http://bugs.sac-home.org/show_bug.cgi?id=384) |
| Created on | Jul 05, 2007 19:57 |
| Resolution | DUPLICATE |
| Resolved on | Nov 09, 2007 23:49 |
| Version | 1.00beta |
| OS | Linux |
| Architecture | PC |
| Attachments | [buildv2.sac](/uploads/45cca686444ca70e159268b2079d3527/buildv2.sac) |
## Extended Description
<pre>Under Build #15445,
sac2c apex/buildv2/buildv2.sac -O3 -nophm
dies at run-time with bad free() in arena 3.
If I compile with -nosaa, there is no problem.
No idea if this is related to -nophm or not...</pre>Kai TrojahnerKai Trojahnerhttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/1595empty sets in dot notation2017-11-19T21:06:19ZSven-Bodo Scholzempty sets in dot notation| | |
| --- | --- |
| Bugzilla Link | [92](http://bugs.sac-home.org/show_bug.cgi?id=92) |
| Created on | Jun 27, 2005 12:19 |
| Resolution | FIXED |
| Resolved on | Jun 28, 2005 17:06 |
| Version | 1.00beta |
| OS | Linux |
| Architect...| | |
| --- | --- |
| Bugzilla Link | [92](http://bugs.sac-home.org/show_bug.cgi?id=92) |
| Created on | Jun 27, 2005 12:19 |
| Resolution | FIXED |
| Resolved on | Jun 28, 2005 17:06 |
| Version | 1.00beta |
| OS | Linux |
| Architecture | PC |
## Extended Description
<pre>E-12.sac in the tutorials yields a selection out of bounds error</pre>Stephan HerhutStephan Herhuthttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/1623tochar appears to be broken. Or, sprintf is broken.2017-11-19T21:09:08ZRobert Berneckytochar appears to be broken. Or, sprintf is broken.| | |
| --- | --- |
| Bugzilla Link | [357](http://bugs.sac-home.org/show_bug.cgi?id=357) |
| Created on | May 01, 2007 18:37 |
| Resolution | INVALID |
| Resolved on | May 01, 2007 20:45 |
| Version | 1.00beta |
| OS | Linux |
| Archi...| | |
| --- | --- |
| Bugzilla Link | [357](http://bugs.sac-home.org/show_bug.cgi?id=357) |
| Created on | May 01, 2007 18:37 |
| Resolution | INVALID |
| Resolved on | May 01, 2007 20:45 |
| Version | 1.00beta |
| OS | Linux |
| Architecture | PC |
| Attachments | [crud.sac](/uploads/1a9fbd699c2c5410fa2a07bcc9338504/crud.sac), [bug357.sac](/uploads/263e2dc392cebf4c0a756d22d66f0d6b/bug357.sac) |
## Extended Description
<pre>The attached fails with array bounds error when compiled with -check b.
The failure occurs after a call to sprintf, and before a tochar(sprintfresult)
completes.</pre>Stephan HerhutStephan Herhuthttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/1649sel error in shallow2017-11-19T21:11:46ZSven-Bodo Scholzsel error in shallow| | |
| --- | --- |
| Bugzilla Link | [96](http://bugs.sac-home.org/show_bug.cgi?id=96) |
| Created on | Jun 27, 2005 12:27 |
| Resolution | FIXED |
| Resolved on | Jun 28, 2005 14:50 |
| Version | 1.00beta |
| OS | Linux |
| Architect...| | |
| --- | --- |
| Bugzilla Link | [96](http://bugs.sac-home.org/show_bug.cgi?id=96) |
| Created on | Jun 27, 2005 12:27 |
| Resolution | FIXED |
| Resolved on | Jun 28, 2005 14:50 |
| Version | 1.00beta |
| OS | Linux |
| Architecture | PC |
| Attachments | [tutu5.sac](/uploads/6793e382c9e83b7ecf4e37aa3447637d/tutu5.sac) |Sven-Bodo ScholzSven-Bodo Scholzhttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/1722Runtime catenation of empty vector is worng2017-11-19T21:19:19ZRobert BerneckyRuntime catenation of empty vector is worng| | |
| --- | --- |
| Bugzilla Link | [421](http://bugs.sac-home.org/show_bug.cgi?id=421) |
| Created on | May 06, 2008 16:20 |
| Resolution | FIXED |
| Resolved on | Jun 30, 2008 08:46 |
| Version | 1.00beta |
| OS | Linux |
| Archite...| | |
| --- | --- |
| Bugzilla Link | [421](http://bugs.sac-home.org/show_bug.cgi?id=421) |
| Created on | May 06, 2008 16:20 |
| Resolution | FIXED |
| Resolved on | Jun 30, 2008 08:46 |
| Version | 1.00beta |
| OS | Linux |
| Architecture | PC |
| Attachments | [crud2.sac](/uploads/58244903f654ce5dbf07875715a6af73/crud2.sac) |
## Extended Description
<pre>Created an attachment (id=468)
Compile -nocf crud2.sac; a.out to reproduce fault
Catenation of empty vector to integer vector produces garbage
result if compiled with -nocf. Works fine with -docf.
Failure mode varies: some choices give glibc memory corruption; others
give bad result value, with proper shape.</pre>BugZillaBugZillahttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/1765genarray with dynamic dimension fails in runtime with Segmentation fault:w2017-11-19T21:23:42ZArtem Shinkarovgenarray with dynamic dimension fails in runtime with Segmentation fault:w| | |
| --- | --- |
| Bugzilla Link | [564](http://bugs.sac-home.org/show_bug.cgi?id=564) |
| Created on | Sep 23, 2009 15:15 |
| Resolution | FIXED |
| Resolved on | Dec 11, 2009 17:35 |
| Version | 1.00beta |
| OS | Linux |
| Archite...| | |
| --- | --- |
| Bugzilla Link | [564](http://bugs.sac-home.org/show_bug.cgi?id=564) |
| Created on | Sep 23, 2009 15:15 |
| Resolution | FIXED |
| Resolved on | Dec 11, 2009 17:35 |
| Version | 1.00beta |
| OS | Linux |
| Architecture | PC |
## Extended Description
<pre>Compiler version:
sac2c v1.00-beta (Buchette d'Anjou)
product rev 16226 linux-gnu_i686
(Fri Jul 24 15:22:58 BST 2009 by asv)
Summary:
When I use in the body of function construction:
array = genarray([x, 2, 10], 0);
where `x` is a parameter of the function, I get a very strange runtime when I iterate through the outer dimension of the array.
Example:
use Array: {genarray, modarray, sel };
use StdIO: {printf, print};
int[.,.,.] f(int limit) {
int[.,.,.] array;
array = genarray([limit,2,10], 0);
for (gr = 0; _lt_SxS_(gr, limit); gr = _add_SxS_(gr, 1)) {
maxlen = 7;
for (i = 2; _lt_SxS_(i, 5); i = _add_SxS_(i, 1)) {
array[gr, 0, i] = 10;
array[gr, 1, _add_SxS_(i,1)] = 11;
printf("i = %i\n", i);
}
printf("array[%i, %i, %i] = 13\n", gr, 1, maxlen);
array[gr, 1, maxlen] = 13;
printf("array[%i, %i, %i] = %i\n", gr, 1, maxlen, array[gr, 1, maxlen]);
print(array);
}
print(array[0,1,3]);
print(array[1,1,3]);
return (array);
}
-----------------------------------------------------------------
Execution:
When I call the function with parameter `2`: f(2), I get the following:
i = 2
i = 3
i = 4
array[0, 1, 7] = 13
array[0, 1, 7] = 13
Dimension: 3
Shape : < 2, 2, 10>
< 0 0 10 10 10 0 0 0 0 0 > < 0 0 0 11 11 11 0 13 0 0 >
< 0 0 0 0 0 0 0 0 0 0 > < 0 0 0 0 0 0 0 0 0 0 >
i = 2
i = 3
i = 4
array[1, 1, 7] = 13
array[1, 1, 7] = 13
Dimension: 3
Shape : < 2, 2, 10>
< 0 0 10 10 10 0 0 0 0 0 > < 0 0 0 11 11 11 0 13 0 0 >
< 0 0 10 0 0 0 0 0 0 0 > < 0 0 0 11 0 0 0 0 0 0 >
Dimension: 0
Shape : < >
13
Segmentation fault
-----------------------------------------------------------------------
So we can see that array is not updated and access to the valid address
of the array gives us Segmentation fault.
The problem goes away if I'll use static values in genarray, like
array = genarray([2,2,10], 0);</pre>BugZillaBugZillahttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/1828compiling with -static crashes unless you use -nophm2017-11-19T21:30:12ZRobert Berneckycompiling with -static crashes unless you use -nophm| | |
| --- | --- |
| Bugzilla Link | [717](http://bugs.sac-home.org/show_bug.cgi?id=717) |
| Created on | Jun 03, 2010 19:54 |
| Resolution | WONTFIX |
| Resolved on | Sep 26, 2015 17:30 |
| Version | svn |
| OS | Linux |
| Architectu...| | |
| --- | --- |
| Bugzilla Link | [717](http://bugs.sac-home.org/show_bug.cgi?id=717) |
| Created on | Jun 03, 2010 19:54 |
| Resolution | WONTFIX |
| Resolved on | Sep 26, 2015 17:30 |
| Version | svn |
| OS | Linux |
| Architecture | PC |
## Extended Description
<pre>Compilation with -static in sac2crc LDFLAGS dies this way:
sac2c -O3 loopisAKD.sac -o loopisAKD.asterix.O3
/usr/lib/gcc/i586-suse-linux/4.3/../../../libc.a(malloc.o): In function `__libc_free':
/usr/src/packages/BUILD/glibc-2.11.1/malloc/malloc.c:3692: multiple definition of `free'
/home/rbe/sac2c/lib//libsacphm.seq.a(malloc.p.seq.o):/home/rbe/sac2c/src/libsacphm/compat/malloc.c:201: first defined here
/usr/lib/gcc/i586-suse-linux/4.3/../../../libc.a(malloc.o): In function `__libc_malloc':
/usr/src/packages/BUILD/glibc-2.11.1/malloc/malloc.c:3615: multiple definition of `malloc'
/home/rbe/sac2c/lib//libsacphm.seq.a(malloc.p.seq.o):/home/rbe/sac2c/src/libsacphm/compat/malloc.c:91: first defined here
/usr/lib/gcc/i586-suse-linux/4.3/../../../libc.a(malloc.o): In function `__libc_realloc':
/usr/src/packages/BUILD/glibc-2.11.1/malloc/malloc.c:3748: multiple definition of `realloc'
/home/rbe/sac2c/lib//libsacphm.seq.a(malloc.p.seq.o):/home/rbe/sac2c/src/libsacphm/compat/malloc.c:284: first defined here
collect2: ld returned 1 exit status
I worked around the crash by compiling with -nophm, but papi does
not report any output at all.Whether that is due to -nophm or -static,
or 32-bit vs. 64-bit binaries, I do not know.</pre>BugZillaBugZillahttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/1894Code generator fails to generate guard code for AL unit test guardSimple.sac2017-11-19T21:37:07ZRobert BerneckyCode generator fails to generate guard code for AL unit test guardSimple.sac| | |
| --- | --- |
| Bugzilla Link | [1071](http://bugs.sac-home.org/show_bug.cgi?id=1071) |
| Created on | Apr 27, 2013 20:42 |
| Resolution | FIXED |
| Resolved on | Oct 01, 2013 20:21 |
| Version | svn |
| OS | Linux |
| Architectu...| | |
| --- | --- |
| Bugzilla Link | [1071](http://bugs.sac-home.org/show_bug.cgi?id=1071) |
| Created on | Apr 27, 2013 20:42 |
| Resolution | FIXED |
| Resolved on | Oct 01, 2013 20:21 |
| Version | svn |
| OS | Linux |
| Architecture | PC |
## Extended Description
<pre>The following program dies in alloc.c when compiled with no options:
int main()
{
v1 = id( [ 42]);
gV, p2 = _non_neg_val_V_( v1);
gS = _sel_VxA_( [0], gV);
z = _sub_SxS_(gS , 42);
return( z);
}
int[*] id( int[*] y)
{
return(y);
}
sac2c -V
sac2c v1.00-beta (Haggis And Apple)
developer rev 18120 linux-gnu_x86_64
(Sat Apr 27 15:38:47 EDT 2013 by sac)
Failure mode:
** 16: Introducing memory management instructions ...
**** Unshare index vectors in WL-folds ...
**** Propagating constants ...
**** AUD/SCL distinction ...
**** Making copy operations explicit ...
**** Introducing explicit allocation statements ...
memory/alloc.c:308 Assertion "als->dim != NULL" failed!
alloc requires a dim expression!
If someone can tell me how to write an alloc.c thingy for
a function that has two results, I'll fix it.</pre>BugZillaBugZillahttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/1950-noPHM often dies at end of job2017-11-19T21:42:47ZRobert Bernecky-noPHM often dies at end of job| | |
| --- | --- |
| Bugzilla Link | [466](http://bugs.sac-home.org/show_bug.cgi?id=466) |
| Created on | Dec 31, 2008 19:35 |
| Resolution | FIXED |
| Resolved on | Jan 24, 2009 16:09 |
| Version | 1.00beta |
| OS | Linux |
| Archite...| | |
| --- | --- |
| Bugzilla Link | [466](http://bugs.sac-home.org/show_bug.cgi?id=466) |
| Created on | Dec 31, 2008 19:35 |
| Resolution | FIXED |
| Resolved on | Jan 24, 2009 16:09 |
| Version | 1.00beta |
| OS | Linux |
| Architecture | PC |
## Extended Description
<pre>developer rev 15931 linux-gnu_x86_64
(Wed Dec 31 12:27:10 EST 2008 by sac)
The above version of sac2c, if used to compile sac/apex/compiota/compiotad.sac,
gets a segfault (corrupted memory) if compiled with "-noPHM".
Perhaps -noPHM is moribund, inasmuch as papiex appears to now work properly
without using -noPHM.</pre>Clemens GrelckClemens Grelckhttps://gitlab.sac-home.org/sac-group/sac2c/-/issues/1188iota(-5) produces negative shape vector!2021-05-27T12:38:30ZRobert Berneckyiota(-5) produces negative shape vector!| | |
| --- | --- |
| Bugzilla Link | [1190](http://bugs.sac-home.org/show_bug.cgi?id=1190) |
| Created on | Apr 07, 2017 14:35 |
| Version | svn |
| OS | Linux |
| Architecture | PC |
| Attachments | [bugiota.sac](/uploads/c0544cd4b81...| | |
| --- | --- |
| Bugzilla Link | [1190](http://bugs.sac-home.org/show_bug.cgi?id=1190) |
| Created on | Apr 07, 2017 14:35 |
| Version | svn |
| OS | Linux |
| Architecture | PC |
| Attachments | [bugiota.sac](/uploads/c0544cd4b818d7509f9b063291d2d16c/bugiota.sac) |
## Extended Description
Created an attachment (id=1060)
source code to reproduce failure
The Stdlib version of iota, as well as the sac2c runtime code,
are rather cavalier about their treatment of shape vectors.
The attached function generates an array with a negative element
in its shape vector. This is a bad idea for several reasons.
Security is just one of those reasons.
I am not sure of the best way to address this fault.
From the standpoint of iota(N), we could do:
max(N,0), which would give an empty array for negative N.
Or, we could signal an error, which might be a better idea.
The fact that we can even generate an array with a negative
element in its shape vector is very scary. We should address
that problem, as it opens the door to a whole world of
security and integrity faults.BugZillaBugZilla