Menu

#373 Segmentation fault when use "-static" command line key

v1.0 (example)
closed-fixed
niXman
None
5
2014-01-07
2014-01-05
Andrew
No

I use i686-4.8.2-release-posix-dwarf-rt_v3-rev1.7z.

Test cpp code:

#include <string>
#include <iostream>

int main()
{
    std::string str = "100";

    std::cout << str;

    return 0;
}

Compile command:

g++ -static test.cpp -o test.exe

When run test.exe obtain segmentation fault.

Without "-static" - all is ok.

Discussion

  • niXman

    niXman - 2014-01-05

    This is a known issue. New builds will be uploaded on Monday.

     
  • niXman

    niXman - 2014-01-05

    Sorry, I'm confused, this is not a issue that I thought.
    Your code compiles and runs successfully.

     

    Last edit: niXman 2014-01-05
  • Andrew

    Andrew - 2014-01-05

    I try this code on a fresh installation of windows xp and windows 7 and got exception. Without "-static" i got output of "100".

     
  • niXman

    niXman - 2014-01-05

    In the topic you wrote that you get segmentation fault. Now you write that you get an exception. How do you determine it segmentation fault or exception?

     
  • Andrew

    Andrew - 2014-01-05

    Fresh systems suggested me to debug or close the application. On my working system qt creator show segmentation fault in ntdll!RtlIntegerToUnicodeString. Full backtrace:

    Thread 1 (Thread 14236.0x2360):
    #0  0x776b8e19 in ntdll!RtlIntegerToUnicodeString () from C:\Windows\system32\ntdll.dll
    No symbol table info available.
    #1  0x776b8d28 in ntdll!RtlIntegerToUnicodeString () from C:\Windows\system32\ntdll.dll
    No symbol table info available.
    #2  0x0041c0e6 in static_spin_init.part.0 ()
    No symbol table info available.
    #3  0x0041c21a in pthread_spin_lock ()
    No symbol table info available.
    #4  0x004188e3 in mutex_ref ()
    No symbol table info available.
    #5  0x0028fe34 in ?? ()
    No symbol table info available.
    #6  0x004637eb in register_frame_ctor ()
    No symbol table info available.
    #7  0x00409b6a in __do_global_ctors ()
    No symbol table info available.
    #8  0x40000060 in ?? ()
    No symbol table info available.
    #9  0x00000023 in ?? ()
    No symbol table info available.
    #10 0x00000023 in ?? ()
    No symbol table info available.
    #11 0x004f1828 in ?? ()
    No symbol table info available.
    #12 0x762d336a in KERNEL32!BaseThreadInitThunk () from C:\Windows\syswow64\kernel32.dll
    No symbol table info available.
    #13 0x776b9f72 in ntdll!RtlInitializeExceptionChain () from C:\Windows\system32\ntdll.dll
    No symbol table info available.
    #14 0x776b9f45 in ntdll!RtlInitializeExceptionChain () from C:\Windows\system32\ntdll.dll
    No symbol table info available.
    #15 0x00000000 in ?? ()
    No symbol table info available.
    

    I assumed that the same thing occur on a fresh systems.

     
  • niXman

    niXman - 2014-01-05

    I'm sorry, I'm confused again %)

    I tested your code on an already fixed builds, so it runs successfully.
    On Monday-Tuesday I uploaded fixed builds, please wait.

     
  • Andrew

    Andrew - 2014-01-05

    Thanks for great work.

     
  • niXman

    niXman - 2014-01-07
    • status: open --> closed-fixed
    • assigned_to: niXman
     

Log in to post a comment.