[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-libmatheval] Re: crash in libmatheval, on 64 bit arch's (AMD64)
From: |
Aleksandar B. Samardzic |
Subject: |
[Bug-libmatheval] Re: crash in libmatheval, on 64 bit arch's (AMD64) |
Date: |
Sat, 13 Aug 2005 19:15:57 +0200 |
User-agent: |
Mutt/1.4.2.1i |
On Sat, Aug 13, 2005 at 06:51:46AM -0700, Dave Andruczyk wrote:
>
>
> --- "Aleksandar B. Samardzic" <address@hidden> wrote:
>
> > > Date: Thu, 11 Aug 2005 16:58:58 -0700 (PDT)
> > > From: Dave Andruczyk <address@hidden>
> > > Subject: crash in libmatheval, on 64 bit arch's (AMD64)
> > > To: address@hidden
> > >
> > > I had a user of my software report a segfault regarding
> > > libmatheval. (I used a version of it and integrated it into my
> > > program, with no modificatiosn to it's routines)
> > >
> > > Here's the GDB info:
> > >
> > > Program received signal SIGSEGV, Segmentation fault.
> > > [Switching to Thread 46912564793952 (LWP 1465)]
> > > hash (s=0x0, n=211) at symbol_table.c:258
> > > 258 for (p = s; *p; p++) {
> > > (gdb)
> >
> > Dave,
> >
> > What is the expression evaluated and for which variable values? Just
> > tried libmatheval 1.1.1 (btw, you may wish to upgrade to 1.1.2) on an
> > AMD 64 machine and all tests from libmatheval test suite passed...
> >
>
> Unfortunately I don't have the expression handy that it tried to
> load. as the crash was reported by a user of my software. I can't
> re-verify it easily as I don't have access to a 64 bit arch. I'll try
> to contact him/her directly to see if we can coordinate getting more
> information.
How about trying with an AMD machine on SourceForge compile farm? I'm
using these for testing.
> In most cases it was something very simple, like a dummy expression,
> like "x/1" or "x*1", the most complex expression is:
>
> "100*(((cyls+1)/divider)/(alternate+1))*((raw_pw1/10)/((1200/(stroke
> +1))/raw_rpm))"
>
> The expressions have worked in all other releases and arch's so far.
> I was actually surprised to see it crash, as otherwise libmatheval has
> worked wonderfully.
I tried on mentioned machine with example program from introduction
section of libmatheval documentation and simple examples like these you
mentioned above. I tried then with attached program and this large
expression hard-coded for some variable combinations (say 1, 2, 3, 4, 5,
6 or 0, 1, 0, 10, 1199, 1) and results are as expected. So please do
let me know if you could get to some combination of offending expression
and variable values.
Regards,
Alex
/******************************************/
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <matheval.h>
int
main()
{
char buffer[] =
"100*(((cyls+1)/divider)/(alternate+1))*((raw_pw1/10)/((1200/(stroke+1))/raw_rpm))";
void *f;
char *names[] =
{ "cyls", "divider", "alternate", "raw_pw1", "stroke",
"raw_rpm" };
double
values[6];
f = evaluator_create(buffer);
assert(f);
scanf("%lf%lf%lf%lf%lf%lf", &values[0], &values[1], &values[2],
&values[3], &values[4], &values[5]);
printf("%g\n", evaluator_evaluate(f, 6, names, values));
evaluator_destroy(f);
exit(EXIT_SUCCESS);
}