Menu

#3 [amd64] segmentation fault on floating point (1.4, 1.8)

open
None
5
2009-10-02
2009-08-31
No

This patch fixes pass variables of double type via stack. E.g. when calling
functions like printf(3). Actual only for AMD64.

st_thread_create() do the stack aligned, but after entering the thread
SP is 8-bytes aligned, but should 16-bytes at least.

Segmentation fault occurs inside function preamble on MOVAPS call.

This patch made for state-threads 1.4, but also applies to 1.8
without fuzz.

Futher testing shows perfect running on Linux/AMD64 and version of 1.8 also.

Discussion

  • Pavel Plesov

    Pavel Plesov - 2009-08-31

    patch for 1.4 & 1.8

     
  • Pavel Plesov

    Pavel Plesov - 2009-08-31
    • summary: [amd64] segmentation fault on floating point --> [amd64] segmentation fault on floating point (1.4, 1.8)
     
  • Mike Abbott

    Mike Abbott - 2009-10-02

    Thank you for your patch. Indeed, the AMD64 ABI requires (%rsp - 8) to be 16-byte aligned. Unfortunately your patch breaks other platforms, notably x86_64 on Darwin. I searched for a way to detect when your patch is needed and when it's not, but failed to find one. If you know of one please update this bug with it.

     
  • Mike Abbott

    Mike Abbott - 2009-10-02
    • assigned_to: nobody --> mabbott
     
  • Pavel Plesov

    Pavel Plesov - 2009-10-02

    Unfortunately i know nothing about Darwin. I would like to limit the patch using ifdef like:

    #if defined(__amd64__) && (defined(FreeBSD) || defined(linux))

    Updated patch file will follow.

     
  • Pavel Plesov

    Pavel Plesov - 2009-10-02

    st-1.4-amd64-stack-align-freebsd-linux.patch limits the fix for the only platforms known to be affected and where the fix is tested.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.