[Home]

Summary:ASTERISK-12222: crash asterisk.c compiled for i486sx with out fpu
Reporter:german aracil boned (tecnoxarxa)Labels:
Date Opened:2008-06-18 19:03:35Date Closed:2008-06-19 11:02:37
Priority:CriticalRegression?No
Status:Closed/CompleteComponents:General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:Crash:

#0  0x08069847 in rdtsc () at asterisk.c:433
No locals.
#1  0x08069659 in ast_mark (i=0, startstop=1) at asterisk.c:442
No locals.
#2  0x080b8a04 in extension_match_core (pattern=0x817f4d8 "200", data=0xb7c71bc4 "69", mode=E_MATCH) at pbx.c:878
       i = 135787688
       prof_id = 0



File: asterisk.c

---- Start Line 416 --------

#if defined ( __i386__) && (defined(__FreeBSD__) || defined(linux))
#if defined(__FreeBSD__)
#include <machine/cpufunc.h>
#elif defined(linux)
static __inline uint64_t
rdtsc(void)
{
       uint64_t rv;

       __asm __volatile(".byte 0x0f, 0x31" : "=A" (rv));
       return (rv);
}
#endif
#else   /* supply a dummy function on other platforms */
static __inline uint64_t
rdtsc(void)
{
       return 0;
}
#endif

int64_t ast_mark(int i, int startstop)
{
       if (!prof_data || i < 0 || i > prof_data->entries) /* invalid index */
               return 0;
       if (startstop == 1)
               prof_data->e[i].mark = rdtsc();
       else {
               prof_data->e[i].mark = (rdtsc() - prof_data->e[i].mark);
               if (prof_data->e[i].scale > 1)
                       prof_data->e[i].mark /= prof_data->e[i].scale;
               prof_data->e[i].value += prof_data->e[i].mark;
               prof_data->e[i].events++;
       }
       return prof_data->e[i].mark;
}

---- end ----

****** ADDITIONAL INFORMATION ******

My working test solution:

---code removed---

use last function rdtsc with return 0, for this CPU without fpu.
Comments:By: Tilghman Lesher (tilghman) 2008-06-18 19:10:52

Please do NOT place patches in the Additional Information field.  Instead, all patches must be uploaded as files, with a license submitted for the file contribution.

By: Digium Subversion (svnbot) 2008-06-19 11:00:31

Repository: asterisk
Revision: 123869

U   branches/1.4/main/asterisk.c

------------------------------------------------------------------------
r123869 | tilghman | 2008-06-19 11:00:27 -0500 (Thu, 19 Jun 2008) | 6 lines

The RDTSC instruction was introduced on the Pentium line of microprocessors,
and is not compatible with certain 586 clones, like Cyrix.  Hence, asking for
i386 compatibility was always incorrect. See http://en.wikipedia.org/wiki/RDTSC
(Closes issue ASTERISK-12222)
Reported by tecnoxarxa

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=123869

By: Digium Subversion (svnbot) 2008-06-19 11:01:26

Repository: asterisk
Revision: 123870

_U  trunk/
U   trunk/main/asterisk.c

------------------------------------------------------------------------
r123870 | tilghman | 2008-06-19 11:01:24 -0500 (Thu, 19 Jun 2008) | 14 lines

Merged revisions 123869 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r123869 | tilghman | 2008-06-19 11:07:23 -0500 (Thu, 19 Jun 2008) | 6 lines

The RDTSC instruction was introduced on the Pentium line of microprocessors,
and is not compatible with certain 586 clones, like Cyrix.  Hence, asking for
i386 compatibility was always incorrect. See http://en.wikipedia.org/wiki/RDTSC
(Closes issue ASTERISK-12222)
Reported by tecnoxarxa

........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=123870

By: Digium Subversion (svnbot) 2008-06-19 11:02:37

Repository: asterisk
Revision: 123871

_U  branches/1.6.0/
U   branches/1.6.0/main/asterisk.c

------------------------------------------------------------------------
r123871 | tilghman | 2008-06-19 11:02:37 -0500 (Thu, 19 Jun 2008) | 22 lines

Merged revisions 123870 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r123870 | tilghman | 2008-06-19 11:08:29 -0500 (Thu, 19 Jun 2008) | 14 lines

Merged revisions 123869 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r123869 | tilghman | 2008-06-19 11:07:23 -0500 (Thu, 19 Jun 2008) | 6 lines

The RDTSC instruction was introduced on the Pentium line of microprocessors,
and is not compatible with certain 586 clones, like Cyrix.  Hence, asking for
i386 compatibility was always incorrect. See http://en.wikipedia.org/wiki/RDTSC
(Closes issue ASTERISK-12222)
Reported by tecnoxarxa

........

................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=123871