<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>280885</bug_id>
          
          <creation_ts>2024-10-04 04:47:31 -0700</creation_ts>
          <short_desc>webkitgtk-2.46.4: libjavascriptcoregtk-6.0.so.1: illegal instruction (roundss/roundsd) on older amd64 laptop</short_desc>
          <delta_ts>2024-12-08 14:26:32 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>WebKit Local Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Orlitzky">michael</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2065440</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Orlitzky">michael</who>
    <bug_when>2024-10-04 04:47:31 -0700</bug_when>
    <thetext>I&apos;m unable to get a useful backtrace on this machine because it doesn&apos;t have enough RAM to build WebKit with debugging info, but maybe we can guess what the illegal instruction is.

The symptom is a WebKitWebProcess crash that leads to a &quot;something went wrong&quot; in epiphany, after which

  [198811.209860] traps: WebCore: Worker[10795] trap invalid opcode ip:7f9cf0745684
  sp:7f9c61ffe770 error:0 in libjavascriptcoregtk-6.0.so.1.2.8[145684,7f9cf06f4000+15d9000]

appears in dmesg. The core file confirms that it&apos;s a SIGILL:

  Core was generated by `/usr/libexec/webkitgtk-6.0/WebKitWebProcess 24 48 50&apos;.
  Program terminated with signal SIGILL, Illegal instruction.

The machine has two cores, but the second is identical to the first so I&apos;ve omitted it:

  $ cat /proc/cpuinfo 
  processor	: 0
  vendor_id	: GenuineIntel
  cpu family	: 6
  model		: 15
  model name	: Intel(R) Core(TM)2 Duo CPU     L7700  @ 1.80GHz
  stepping	: 11
  microcode	: 0xb6
  cpu MHz		: 1196.988
  cache size	: 4096 KB
  physical id	: 0
  siblings	: 2
  core id		: 0
  cpu cores	: 2
  apicid		: 0
  initial apicid	: 0
  fpu		: yes
  fpu_exception	: yes
  cpuid level	: 10
  wp		: yes
  flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36
  clflush dts acpi mmx fxsr sse sse2 ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs
  bts rep_good nopl cpuid aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm
  lahf_lm pti dtherm
  bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs
  itlb_multihit mmio_unknown
  bogomips	: 3592.58
  clflush size	: 64
  cache_alignment	: 64
  address sizes	: 36 bits physical, 48 bits virtual
  power management:

I&apos;m not sure if it&apos;s relevant, but in the past I&apos;ve hit corner cases on this machine because it lacks support for popcnt.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2065441</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Orlitzky">michael</who>
    <bug_when>2024-10-04 04:48:24 -0700</bug_when>
    <thetext>(This is with v2.44.4 by the way)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2065709</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Orlitzky">michael</who>
    <bug_when>2024-10-06 06:16:44 -0700</bug_when>
    <thetext>Looking at the code in Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h, I think missing popcnt is the prime suspect. For example:

   void countPopulation64(RegisterID src, RegisterID dst)
    {
        ASSERT(supportsCountPopulation());
        m_assembler.popcntq_rr(src, dst);
    }

just assumes that it is there.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2066072</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Orlitzky">michael</who>
    <bug_when>2024-10-07 19:07:16 -0700</bug_when>
    <thetext>Popcnt was a red herring, it&apos;s actually &quot;roundss&quot; causing the SIGILL. If I switch GDB to its asm layout,

  Program terminated with signal SIGILL, Illegal instruction.
  #0  0x00007fbf70f45684 in ?? () from /usr/lib64/libjavascriptcoregtk-6.0.so.1
  (gdb) layout asm
  0x7fbf70f45684  roundss $0x1,%xmm0,%xmm1

This machine lacks SSE4_1, so I don&apos;t think roundss should have been emitted.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2071081</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Orlitzky">michael</who>
    <bug_when>2024-10-28 15:50:02 -0700</bug_when>
    <thetext>Something similar happens in 2.46.2 except with roundsd instead of roundss</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>