bugGNU Octave - Bugs: bug #37308, JIT build fails some numerical...

 
 

bug #37308: JIT build fails some numerical tests; non-JIT build is OK.

Submitted by:  Arun Giridhar <arungiridhar>
Submitted on:  Mon 10 Sep 2012 03:25:51 AM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Sat 15 Sep 2012 04:17:53 PM UTC, comment #24:

confirmed also on cygwin

octave-cli:4> id((1+i))-(1+i)
ans = 0

all test passed (except usual cygwin ones)

marco atzeri <matzeri>
Fri 14 Sep 2012 11:36:41 PM UTC, comment #23:

(Build went faster than I thought)

"make check" now passes all tests save 1 (file-io, fr_FR).

Philip Nienhuis <philipnienhuis>
Project Member
Fri 14 Sep 2012 09:44:02 PM UTC, comment #22:

Thanks, started a new build with tip. Tomorrow morning we'll see.

Philip Nienhuis <philipnienhuis>
Project Member
Fri 14 Sep 2012 09:22:04 PM UTC, comment #21:

make check completed correctly.

Looks good. Will be doing more testing.

Michael Godfrey <godfrey>
Project Member
Fri 14 Sep 2012 12:33:56 PM UTC, comment #20:

Just started build, but will be out today. More when I get back.

Thanks,
Michael

Michael Godfrey <godfrey>
Project Member
Fri 14 Sep 2012 12:21:13 PM UTC, comment #19:

Philip and Michael,

I found a bug where I was not cleaning up properly if JIT failed. This caused the module to be in an illegal state.

Does 8ccb187b24e9 fix the issue for you guys?

http://hg.savannah.gnu.org/hgweb/octave/rev/8ccb187b24e9

Max Brister <fisheater>
Project Member
Fri 14 Sep 2012 10:52:37 AM UTC, comment #18:

This still fails for me with yesterday night's tip:

FYI:
Mageia 2 Linux, Pentium-M (w SSE2, no SSE3), gcc 4.6.3, llvm 3.0

W/o JIT all tests pass except file-io.cc (fr_FR localization)

Philip Nienhuis <philipnienhuis>
Project Member
Thu 13 Sep 2012 09:54:27 PM UTC, comment #17:

I confirm that the output of "make check" is now identical between the JIT and the non-JIT version on 32bit Ubuntu. Much thanks to Max Brister for isolating and fixing the bug!

Arun Giridhar <arungiridhar>
Thu 13 Sep 2012 04:14:12 AM UTC, comment #16:

I think I have fixed Arun's issue [1]. I was using stacksave/stackrestore to handle the allocation of memory for sret functions. It looks like LLVM's optimization pass was using memory I had deallocated using stackrestore. My patch just allocates all memory when the function starts, which is the correct way of doing things anyways.

Additionally, I'm able to reproduce Michael's issue now, so I should be able to fix it.

[1] http://hg.savannah.gnu.org/hgweb/octave/rev/8355fddce815

Max Brister <fisheater>
Project Member
Tue 11 Sep 2012 06:24:57 AM UTC, comment #15:

Arun,

I was able to reproduce your issue on my x86 machine, so I should be able to fix the problem. Hopefully this is also related to Michael's issue.

Max Brister <fisheater>
Project Member
Mon 10 Sep 2012 11:47:34 PM UTC, comment #14:

Valgrind command used:

Output attached.

As an addendum to my previous comment, I'm running 32-bit Ubuntu Precise on an x86_64 processor, and the default kernel is the PAE kernel, which allows access beyond the 3.2GB limit.

(file #26527)

Arun Giridhar <arungiridhar>
Mon 10 Sep 2012 10:10:42 PM UTC, comment #13:

Michael,

I just pushed a patch[1] which prevents having to configure with --enable-jit-debug. It should be enough to run 'enable_jit_debug (1)'.

[1] http://hg.savannah.gnu.org/hgweb/octave/rev/6bdf379592d9

Max Brister <fisheater>
Project Member
Mon 10 Sep 2012 08:06:42 PM UTC, comment #12:

I ran valgrind last night without --smc-check=all, as I had used the syntax in Bug #37205. I am rerunning it now with --smc-check=all. Since the valgrind manual says the earlier results may not be reliable I'm not posting them here.

I'm on 32-bit Ubuntu running on Intel Core i5. The output of "uname -a" is:

Arun Giridhar <arungiridhar>
Mon 10 Sep 2012 06:19:54 PM UTC, comment #11:

A clarification: the Atom D525 is a x86_64 family
processor, and my system is x86_64.

I have no 32-bit systems available to me now.

I will try a build on an older x86_64 system...

Michael Godfrey <godfrey>
Project Member
Mon 10 Sep 2012 05:03:32 PM UTC, comment #10:

Ok, maybe this has something to do with 32 bit processors then? I'll try building on my 32 bit machine, it will take a while though.

What I meant by compiling with jit debug is:

This might also work, but octave's option setting is buggy for me right now.

Max Brister <fisheater>
Project Member
Mon 10 Sep 2012 02:31:42 PM UTC, comment #9:

I should have added that the processor in my system
is an Atom D525.

Michael Godfrey <godfrey>
Project Member
Mon 10 Sep 2012 01:12:51 PM UTC, comment #8:

on cygwin (32 bit architeture) I notice:

octave:3> id = @(x) x
id =

@(x) x

octave:9> id((1+i))-(1+i)
ans = 4.7764e-07 + 9.4593e-07i
octave:10> eps
ans = 2.2204e-16

it seems a float vs double comparison

marco atzeri <matzeri>
Mon 10 Sep 2012 12:04:21 PM UTC, comment #7:

Since you said that valgrind was not reporting errors
I just tried that and got the error shown in the attaced file.

I did not understand all the details of setting --enable-jit-debug
with make check. Did you really mean set --jit-debug as
an argument to octave within the make check script?

Anyhow, valgrind defintely found an eror on my system which
is: fedora 17 x86_64

(file #26519)

Michael Godfrey <godfrey>
Project Member
Mon 10 Sep 2012 07:13:52 AM UTC, comment #6:

Arun,

When using valgrind, you need to add --smc-check=all when jit is enabled[1].

Also, are you on a 32 or 64 bit architecture?

[1] http://valgrind.org/docs/manual/faq.html#faq.java

Michael,

Can you configure with --enable-jit-debug then call 'enable_jit_debug (1)' before running test cellfun? It looks like the LLVM IR is illegal for some reason.

I'm not quite sure what is happening here, as valgrind isn't reporting any errors for me.

Max Brister <fisheater>
Project Member
Mon 10 Sep 2012 05:49:55 AM UTC, comment #5:

Apparently the second half of my comment# 4 got eaten, so here it is:

Valgrind result for rand.cc:

This may account for the observed crash in cellfun.cc:

I will update when valgrind is done.

Arun Giridhar <arungiridhar>
Mon 10 Sep 2012 05:47:11 AM UTC, comment #4:

Good call on the uninitialized memory. The valgrind check is still running with CXXFLAGS="-g", but here are some partial results:

Configure options used for building:

Command used for valgrind:

Valgrind result for pt-jit.cc:

Valgrind result for rand.cc:

Arun Giridhar <arungiridhar>
Mon 10 Sep 2012 04:01:51 AM UTC, comment #3:

> but got
> 3.7000e+01 + 1.9763e-323i


These numbers look like unitialised memory. Can you check with valgrind and with CXXFLAGS=-g and nothing else?

Jordi GutiƩrrez Hermoso <jordigh>
Project Administrator
Mon 10 Sep 2012 04:01:20 AM UTC, comment #2:

gdb bt trace atteched for problem in comment #1

(file #26512)

Michael Godfrey <godfrey>
Project Member
Mon 10 Sep 2012 03:45:20 AM UTC, comment #1:

Using Fedora 17 x86_64 instead of what you got, I
get:
Integrated test scripts:

libinterp/corefcn/__contourc__.cc ...................... PASS 1/1
libinterp/corefcn/__dispatch__.cc ...................... PASS 1/1
libinterp/corefcn/__lin_interpn__.cc ................... PASS 1/1
libinterp/corefcn/__pchip_deriv__.cc ................... PASS 1/1
libinterp/corefcn/__qp__.cc ............................ PASS 1/1
libinterp/corefcn/besselj.cc ........................... PASS 191/191
libinterp/corefcn/betainc.cc ........................... PASS 23/23
libinterp/corefcn/bsxfun.cc ............................ PASS 73/73
libinterp/corefcn/cellfun.cc ...........................Stack dump:
0. Running pass 'CallGraph Pass Manager' on module 'octave'.
panic: Segmentation fault -- stopping myself...
make[1]: *** [check] Segmentation fault (core dumped)
m

Michael Godfrey <godfrey>
Project Member
Mon 10 Sep 2012 03:25:51 AM UTC, original submission:

Hello,

The 20120909 dev version passes tests with "make check" as expected when configured with --disable-jit, but fails a few numerical tests with --enable-jit, keeping everything else the same. The numerical differences are very small, but sometimes return complex instead of real and consequently break functions like fzero.

Here is a "diff -c" of the two test/fntests.log files (I have replaced the "/home/path/to/src" with "$OCTAVESRCDIR", everything else is the same):

Exact configure options for the JIT version (broken up to multiple lines for readability):

Exact configure options for the non-JIT version (broken up to multiple lines for readability):

Output of "uname -a":

Output of "llvm-config --version":

Arun Giridhar <arungiridhar>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #26527:  jit.valgrind.messages added by arungiridhar (244KiB - application/octet-stream)
file #26519:  jit_bug2 added by godfrey (3KiB - application/octet-stream)
file #26512:  jit_bug added by godfrey (7KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Updated the item)
  • -unavailable- added by philipnienhuis (Posted a comment)
  • -unavailable- added by matzeri (Posted a comment)
  • -unavailable- added by fisheater (Posted a comment)
  • -unavailable- added by jordigh (Posted a comment)
  • -unavailable- added by godfrey (Posted a comment)
  • -unavailable- added by arungiridhar (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 15 Sep 2012 06:00:56 PM UTCrik5StatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Mon 10 Sep 2012 11:47:34 PM UTCarungiridharAttached File-=>Added jit.valgrind.messages, #26527
    Mon 10 Sep 2012 12:04:21 PM UTCgodfreyAttached File-=>Added jit_bug2, #26519
    Mon 10 Sep 2012 04:01:20 AM UTCgodfreyAttached File-=>Added jit_bug, #26512

    Back to the top


    Powered by Savane 3.1-cleanup1