|
View:
New views
15 Messages
—
Rating Filter:
Alert me
|
|
|
Aldor crashHi,
today, I updated Aldor to work on Visual Studio 2008 as windows console application. It works fine but behaves exactly like the one I built on linux regarding crashes. Can anyone confirm that the following sequence yields a segmentation fault: $ aldor -gloop Aldor Copyright (c) 1990-2007 Aldor Software Organization Ltd (Aldor.org). Release: Aldor(C) version 1.1.0 for LINUX(glibc-unknown) Type "#int help" for more details. %1 >> #include "aldor" Comp: 40 msec, Interp: 10 msec %2 >> #include "aldorio" Comp: 10 msec, Interp: 0 msec %3 >> import from Integer Comp: 10 msec, Interp: 0 msec %4 >> 3 Program fault (segmentation violation).Program fault (segmentation violation). %4 >> 3 #1 (Error) No meaning for identifier `print'. %5 >> 3 Segmentation fault To those who know the compiler internals: - gen0MakeApplyArgs calls gen0AbContextType in order to receive a TForm - gen0AbContextType calls gen0AbType for the TForm to be returned - gen0AbType calls abGetCategory for a TForm to be passed to tfDefineeType the return value of which is to be returned - abGetCategory sets the TForm it will return to tfUnknown - The function goes through several if/else conditions that might set the TForm variable, but none of them apply, the TForm returned is tfUnknown - after tfDefineeType processed the TForm, it is still tfUnknown - back up in the call tree in gen0MakeApplyArgs, the returned TForm is thus tfUnknown - in this function, the TForm is used as argument to tfMapArgc - after initial processing with tfFollow it calls tfFollowArg with our tfUnknown as first argument and 0 as second argument. - tfFollowArg checks whether i (which is 0) < tfArgc (tfUnknown) (which is also 0) and returns NULL if the condition is false. In this case, the condition is indeed false. - Now, with the NULL TForm we got from tfFollowArg, we call tfAsMultiArgc - This function calls tfFollow with the NULL TForm which behaves correctly, skipping any processing if tf == NULL - After that, the tfIsMulti macro is called on the NULL TForm and here is where the code breaks. The macro in turn calls tfTag on the TForm which is defined as (tf)->tag. It dereferences a NULL pointer... boom Now, I know this is overly detailed but I thought by doing these debugging steps myself, I could lift some work of the people who know more about the compiler and motivate them to give it some thought. Maybe some of you thinks "oh right, we need to do it like this...". Personally, I have little ideas on this. I don't know what TForms really are and I don't know how to code is supposed to behave in this case. Although I can't imagine it would be helpful to anybody, here is the AbSyn that was passed to gen0AbContextType, which returned tfUnknown as an answer: http://xinutec.org/~pippijn/files/txt/06f39ed2e3b1a89858491d955803e8d3.txt I still have a lot to learn about the aldor internals. It is a rather large piece of software and I must say, even though I have been fretting about its instability, a sublime piece of art. I'm enjoying the read. Regards, -- Pippijn van Steenhoven _______________________________________________ Aldor-l mailing list Aldor-l@... http://aldor.org/mailman/listinfo/aldor-l_aldor.org |
|
|
Re: Aldor crash2008/6/17 Pippijn van Steenhoven wrote:
> Hi, > > today, I updated Aldor to work on Visual Studio 2008 as windows > console application. It works fine but behaves exactly like the one > I built on linux regarding crashes. Can anyone confirm that the following > sequence yields a segmentation fault: > ... Yes, this error also happens for me, however using TextWriter avoids the error: root@sage:/# aldor -gloop Aldor Copyright (c) 1990-2007 Aldor Software Organization Ltd (Aldor.org). Release: Aldor(C) version 1.1.0 for LINUX(glibc2.3) Type "#int help" for more details. %1 >> #include "aldor" Comp: 70 msec, Interp: 0 msec %2 >> #include "aldorio" Comp: 20 msec, Interp: 0 msec %3 >> import from Integer Comp: 10 msec, Interp: 0 msec %4 >> import from TextWriter Comp: 0 msec, Interp: 0 msec %5 >> stdout << 3 3 () @ TextWriter Comp: 0 msec, Interp: 70 msec -------- Perhaps this points at something specific to the interpreted mode? Regards, Bill Page. _______________________________________________ Aldor-l mailing list Aldor-l@... http://aldor.org/mailman/listinfo/aldor-l_aldor.org |
|
|
Re: Aldor crashOn Tue, Jun 17, 2008 at 07:53:59PM -0400, Bill Page wrote:
> 2008/6/17 Pippijn van Steenhoven wrote: > Yes, this error also happens for me, however using TextWriter avoids the error: > > %5 >> stdout << 3 > 3 () @ TextWriter I am aware that it works with the TextWriter, but the point of the loop is that you can analyse the return values of certain expressions (such as 3). I expected something like this: %5 >> 3 3 () @ AldorInteger I might have dreamed it, but I seem to vaguely remember that I once tried this and it worked.. -- Pippijn van Steenhoven _______________________________________________ Aldor-l mailing list Aldor-l@... http://aldor.org/mailman/listinfo/aldor-l_aldor.org |
|
|
Re: Aldor crash2008/6/17 Pippijn van Steenhoven <pip88nl@...>:
> > I am aware that it works with the TextWriter, but the point of the loop > is that you can analyse the return values of certain expressions (such > as 3). I expected something like this: > > %5 >> 3 > 3 () @ AldorInteger > > I might have dreamed it, but I seem to vaguely remember that I once tried > this and it worked.. > root@sage:/# aldor -gloop Aldor Copyright (c) 1990-2007 Aldor Software Organization Ltd (Aldor.org). Release: Aldor(C) version 1.1.0 for LINUX(glibc2.3) Type "#int help" for more details. %1 >> #include "aldor" Comp: 60 msec, Interp: 10 msec %2 >> import from AldorInteger Comp: 10 msec, Interp: 0 msec %3 >> 3 () @ AldorInteger Comp: 0 msec, Interp: 10 msec ??? Regards, Bill Page _______________________________________________ Aldor-l mailing list Aldor-l@... http://aldor.org/mailman/listinfo/aldor-l_aldor.org |
|
|
Re: Aldor crashOn 06/18/2008 01:28 AM, Pippijn van Steenhoven wrote:
> Hi, > > today, I updated Aldor to work on Visual Studio 2008 as windows console > application. It works fine but behaves exactly like the one I built on > linux regarding crashes. Can anyone confirm that the following sequence > yields a segmentation fault: > > $ aldor -gloop > Aldor > > Copyright (c) 1990-2007 Aldor Software Organization Ltd (Aldor.org). > > Release: Aldor(C) version 1.1.0 for LINUX(glibc-unknown) > Type "#int help" for more details. > %1 >> #include "aldor" > Comp: 40 msec, Interp: 10 msec > %2 >> #include "aldorio" > Comp: 10 msec, Interp: 0 msec > %3 >> import from Integer > Comp: 10 msec, Interp: 0 msec > %4 >> 3 > Program fault (segmentation violation).Program fault (segmentation violation). > %4 >> 3 > > #1 (Error) No meaning for identifier `print'. > > %5 >> 3 > Segmentation fault You are doing the wrong thing. >aldor -gloop Aldor Copyright (c) 1990-2007 Aldor Software Organization Ltd (Aldor.org). Release: Aldor(C) version 1.1.0 (trunk-23 AXL_EDIT_1_1_13_18=0) for LINUX(glibc2.3) Type "#int help" for more details. %1 >> #include "aldor" Comp: 50 msec, Interp: 0 msec %2 >> #include "aldorinterp" Comp: 50 msec, Interp: 0 msec %3 >> import from Integer Comp: 20 msec, Interp: 0 msec %4 >> 3 3 @ AldorInteger Comp: 0 msec, Interp: 140 msec %5 >> The sequence of your step shows a bug in Aldor since segfaults should never happen, but the right way currently is to replace "aldorio" by "aldorinterp". Look at https://svn.origo.ethz.ch/algebraist/trunk/aldor/lib/aldor/include/aldorinterp.as https://svn.origo.ethz.ch/algebraist/trunk/aldor/lib/aldor/src/aldor_gloop.as for more details. Oooops, https://aquarium.aldor.csd.uwo.ca/svn/trunk is down again. All that seems to have historical reasons, since the standard library was axllib. And this works... woodpecker:~/scratch>aldor -gloop Aldor Copyright (c) 1990-2007 Aldor Software Organization Ltd (Aldor.org). Release: Aldor(C) version 1.1.0 (trunk-23 AXL_EDIT_1_1_13_18=0) for LINUX(glibc2.3) Type "#int help" for more details. %1 >> #include "axllib" Comp: 140 msec, Interp: 10 msec %2 >> import from Integer Comp: 30 msec, Interp: 0 msec %3 >> 3 3 @ Integer Comp: 0 msec, Interp: 50 msec The library libaldor does not know of a function "print". But such a function is required by "aldor -gloop". Ralf > To those who know the compiler internals: > - gen0MakeApplyArgs calls gen0AbContextType in order to receive a TForm > - gen0AbContextType calls gen0AbType for the TForm to be returned > - gen0AbType calls abGetCategory for a TForm to be passed to > tfDefineeType the return value of which is to be returned > - abGetCategory sets the TForm it will return to tfUnknown > - The function goes through several if/else conditions that might set > the TForm variable, but none of them apply, the TForm returned is > tfUnknown > - after tfDefineeType processed the TForm, it is still tfUnknown > - back up in the call tree in gen0MakeApplyArgs, the returned TForm is > thus tfUnknown > - in this function, the TForm is used as argument to tfMapArgc > - after initial processing with tfFollow it calls tfFollowArg with our > tfUnknown as first argument and 0 as second argument. > - tfFollowArg checks whether i (which is 0) < tfArgc (tfUnknown) > (which is also 0) and returns NULL if the condition is false. In > this case, the condition is indeed false. > - Now, with the NULL TForm we got from tfFollowArg, we call > tfAsMultiArgc > - This function calls tfFollow with the NULL TForm which behaves > correctly, skipping any processing if tf == NULL > - After that, the tfIsMulti macro is called on the NULL TForm and here > is where the code breaks. The macro in turn calls tfTag on the TForm > which is defined as (tf)->tag. It dereferences a NULL pointer... > boom > > Now, I know this is overly detailed but I thought by doing these > debugging steps myself, I could lift some work of the people who know > more about the compiler and motivate them to give it some thought. Maybe > some of you thinks "oh right, we need to do it like this...". Personally, > I have little ideas on this. I don't know what TForms really are and I > don't know how to code is supposed to behave in this case. > > Although I can't imagine it would be helpful to anybody, here is the > AbSyn that was passed to gen0AbContextType, which returned tfUnknown as > an answer: > http://xinutec.org/~pippijn/files/txt/06f39ed2e3b1a89858491d955803e8d3.txt > > I still have a lot to learn about the aldor internals. It is a rather > large piece of software and I must say, even though I have been fretting > about its instability, a sublime piece of art. I'm enjoying the read. > > Regards, _______________________________________________ Aldor-l mailing list Aldor-l@... http://aldor.org/mailman/listinfo/aldor-l_aldor.org |
|
|
Re: Aldor crashOn Wed, Jun 18, 2008 at 09:50:53AM +0200, Ralf Hemmecke wrote:
> The library libaldor does not know of a function "print". But such a > function is required by "aldor -gloop". Okay, that makes sense, but it makes me wonder why this works: [...] Type "#int help" for more details. %1 >> #include "aldor" Comp: 40 msec, Interp: 10 msec %2 >> #include "aldorio" Comp: 10 msec, Interp: 0 msec %3 >> stdout () @ TextWriter Comp: 0 msec, Interp: 0 msec Is there a function "print" for TextWriter but not for Integer? -- Pippijn van Steenhoven _______________________________________________ Aldor-l mailing list Aldor-l@... http://aldor.org/mailman/listinfo/aldor-l_aldor.org |
|
|
Re: Aldor crashOh.. never mind the last mail, the reason it works for TextWriter is that
the type is not printable. It all makes sense now. I'll look into this in more detail later. Now that I know exactly what is wrong, I might even be able to fix it. -- Pippijn van Steenhoven _______________________________________________ Aldor-l mailing list Aldor-l@... http://aldor.org/mailman/listinfo/aldor-l_aldor.org |
|
|
Re: Aldor crashOn 06/18/2008 10:27 AM, Pippijn van Steenhoven wrote:
> Oh.. never mind the last mail, the reason it works for TextWriter is that > the type is not printable. It all makes sense now. I'll look into this in > more detail later. Now that I know exactly what is wrong, I might even be > able to fix it. That would be great. And while you are at it... also check out the bug... aldor -gloop Aldor Copyright (c) 1990-2007 Aldor Software Organization Ltd (Aldor.org). Release: Aldor(C) version 1.1.0 (trunk-23 AXL_EDIT_1_1_13_18=0) for LINUX(glibc2.3) Type "#int help" for more details. %1 >> Use '#quit' to quit Axiomxl. Segmentation fault The segfault just appears by pressing Ctrl-C. Ralf _______________________________________________ Aldor-l mailing list Aldor-l@... http://aldor.org/mailman/listinfo/aldor-l_aldor.org |
|
|
Re: Aldor crashOn Wed, Jun 18, 2008 at 01:12:11PM +0200, Ralf Hemmecke wrote:
> aldor -gloop > Aldor > > Copyright (c) 1990-2007 Aldor Software Organization Ltd (Aldor.org). > > Release: Aldor(C) version 1.1.0 (trunk-23 AXL_EDIT_1_1_13_18=0) for > LINUX(glibc2.3) > Type "#int help" for more details. > %1 >> Use '#quit' to quit Axiomxl. > Segmentation fault > > The segfault just appears by pressing Ctrl-C. Aldor Copyright © 1990-2007 Aldor Software Organization Ltd (Aldor.org). Release: Aldor(C) version 1.1.0 for LINUX(glibc-unknown) Type "#int help" for more details. %1 >> Use '#quit' to quit the interactive loop. Use '#quit' to quit the interactive loop. Use '#quit' to quit the interactive loop. Use '#quit' to quit the interactive loop. Use '#quit' to quit the interactive loop. [...] It doesn't happen here. Can you run it in gdb like so: pippijn@osiris devel $ gdb --args aldor -gloop [..header..] (gdb) handle SIGINT nostop pass SIGINT is used by the debugger. Are you sure you want to change it? (y or n) y Signal Stop Print Pass to program Description SIGINT No Yes Yes Interrupt (gdb) r Starting program: /home/pippijn/rona/devel/aldor/obj/bin/aldor -gloop Aldor Copyright © 1990-2007 Aldor Software Organization Ltd (Aldor.org). Release: Aldor(C) version 1.1.0 for LINUX(glibc-unknown) Type "#int help" for more details. %1 >> Program received signal SIGINT, Interrupt. Use '#quit' to quit the interactive loop. And then, when it crashes, type in: (gdb) bt [.. lots of output ..] (gdb) bt full [.. even more output ..] -- Pippijn van Steenhoven _______________________________________________ Aldor-l mailing list Aldor-l@... http://aldor.org/mailman/listinfo/aldor-l_aldor.org |
|
|
Re: Aldor crashHi Pippijn,
On 06/18/2008 02:12 PM, Pippijn van Steenhoven wrote: > On Wed, Jun 18, 2008 at 01:12:11PM +0200, Ralf Hemmecke wrote: >> aldor -gloop >> Aldor >> >> Copyright (c) 1990-2007 Aldor Software Organization Ltd (Aldor.org). >> >> Release: Aldor(C) version 1.1.0 (trunk-23 AXL_EDIT_1_1_13_18=0) for >> LINUX(glibc2.3) >> Type "#int help" for more details. >> %1 >> Use '#quit' to quit Axiomxl. >> Segmentation fault >> >> The segfault just appears by pressing Ctrl-C. > > pippijn@osiris aldor $ aldor -gloop > Aldor > > Copyright © 1990-2007 Aldor Software Organization Ltd (Aldor.org). > > Release: Aldor(C) version 1.1.0 for LINUX(glibc-unknown) > Type "#int help" for more details. > %1 >> Use '#quit' to quit the interactive loop. > Use '#quit' to quit the interactive loop. > Use '#quit' to quit the interactive loop. > Use '#quit' to quit the interactive loop. > Use '#quit' to quit the interactive loop. > [...] > > It doesn't happen here. Cool... I now realize, that it doesn't happen with Aldor 1.0.3. Hmmmm.... But look for "Ctrl-C at the prompt" in http://mlblog.osdir.com/lang.aldor/2005-06/index.shtml > Can you run it in gdb like so: >gdb --args aldor -gloop GNU gdb 6.4.90-debian Copyright (C) 2006 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i486-linux-gnu"...Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1". (gdb) handle SIGINT nostop pass SIGINT is used by the debugger. Are you sure you want to change it? (y or n) y Signal Stop Print Pass to program Description SIGINT No Yes Yes Interrupt (gdb) r Starting program: /home/hemmecke/software/aldor/linux/1.1.0/bin/aldor -gloop Failed to read a valid object file image from memory. Aldor Copyright (c) 1990-2007 Aldor Software Organization Ltd (Aldor.org). Release: Aldor(C) version 1.1.0 (trunk-23 AXL_EDIT_1_1_13_18=0) for LINUX(glibc2.3) Type "#int help" for more details. %1 >> Program received signal SIGINT, Interrupt. Use '#quit' to quit Axiomxl. Program received signal SIGSEGV, Segmentation fault. 0x0000000d in ?? () (gdb) bt #0 0x0000000d in ?? () #1 0x00000002 in ?? () #2 0x00000033 in ?? () #3 0x00000000 in ?? () (gdb) bt full #0 0x0000000d in ?? () No symbol table info available. #1 0x00000002 in ?? () No symbol table info available. #2 0x00000033 in ?? () No symbol table info available. #3 0x00000000 in ?? () No symbol table info available. _______________________________________________ Aldor-l mailing list Aldor-l@... http://aldor.org/mailman/listinfo/aldor-l_aldor.org |
|
|
Re: Aldor crashOn Wed, Jun 18, 2008 at 04:18:39PM +0200, Ralf Hemmecke wrote:
> Cool... I now realize, that it doesn't happen with Aldor 1.0.3. Hmmmm.... I am using vanilla Aldor from the Algebraist SVN repository and it doesn't happen there, either (this should be 1.1.0 or something). > But look for "Ctrl-C at the prompt" in > > http://mlblog.osdir.com/lang.aldor/2005-06/index.shtml Interesting. By the way: the compiler seems to be a little bit more stable than the interpreter, but they are mostly equal. They even produce the exact same crashes (the ones with NULL-closures). > Program received signal SIGSEGV, Segmentation fault. > 0x0000000d in ?? () > (gdb) bt > #0 0x0000000d in ?? () > #1 0x00000002 in ?? () > #2 0x00000033 in ?? () > #3 0x00000000 in ?? () > (gdb) bt full > #0 0x0000000d in ?? () > No symbol table info available. > #1 0x00000002 in ?? () > No symbol table info available. > #2 0x00000033 in ?? () > No symbol table info available. > #3 0x00000000 in ?? () > No symbol table info available. version of Aldor. That doesn't really help :-\ -- Pippijn van Steenhoven _______________________________________________ Aldor-l mailing list Aldor-l@... http://aldor.org/mailman/listinfo/aldor-l_aldor.org |
|
|
|
|
|
Re: Aldor crash> I guess we have too many possible tools... There is also
> http://www.aldor.org/mantis/login_page.php Well, would you rely on that? Try to say svn list https://aquarium.aldor.csd.uwo.ca/svn I currently get svn: PROPFIND request failed on '/svn' svn: PROPFIND of '/svn': could not connect to server (https://aquarium.aldor.csd.uwo.ca) > http://algebraist.origo.ethz.ch/node/add/issue > > is more directly linked to the algebraist clone repository at the same > site - that might be a good thing if developers actually start using > the integrated development tools available at this site. OK, then maybe we should report issues there. Ralf _______________________________________________ Aldor-l mailing list Aldor-l@... http://aldor.org/mailman/listinfo/aldor-l_aldor.org |
|
|
Re: Aldor crashOn Wed, Jun 18, 2008 at 11:58 AM, Ralf Hemmecke wrote:
>... > Bill Page wrote: >> http://algebraist.origo.ethz.ch/node/add/issue >> >> is more directly linked to the algebraist clone repository at the >> same site - that might be a good thing if developers actually start >> using the integrated development tools available at this site. > > OK, then maybe we should report issues there. > Ok, let's do that. Let me know if there are any technical issues about how to start. Regards, Bill Page. _______________________________________________ Aldor-l mailing list Aldor-l@... http://aldor.org/mailman/listinfo/aldor-l_aldor.org |
|
|
Re: Aldor crash"Bill Page" <bill.page@...> writes:
> The tracker at: > > http://axiom-wiki.newsynthesis.org/IssueTracker > > is currently (mostly) focused on Axiom, but it could also easily be > adapted for Aldor. To the extent that Aldor bugs can be illustrated > via the Axiom-Aldor interface, this might provide some advantage. I'd prefer this one. I'm still hoping for a common Aldor-Axiom world. Martin _______________________________________________ Aldor-l mailing list Aldor-l@... http://aldor.org/mailman/listinfo/aldor-l_aldor.org |
| Free Forum Powered by Nabble | Forum Help |