32bit Dynamically Linked App crashes without any prints on Linux Kernel 3.3 when compiled with Linaro GCC 2013.06) 4.8.2 20130603 (prerelease)

Bug #1197039 reported by Varun Mallikarjunan
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro
New
Undecided
Unassigned
Linaro GCC
Invalid
Undecided
Matthew Gretton-Dann

Bug Description

When we try to compile and run a simple hello_world program:

We compiled with:
linaro/gnueabi/2013.06-20130621/bin/arm-linux-gnueabihf-gcc -g -O2 -Wall -march=armv8-a -o hello_new hello.cpp ------> This runs fine.

BUT when we compile the same with g++:
linaro/gnueabi/2013.06-20130621/bin/arm-linux-gnueabihf-g++ -g -O2 -Wall -march=armv8-a -o hello_new hello.cpp ------> It crashes with no prints on Linux 3.3 kernel version.

ALSO,
Static linking with linaro/gnueabi/2013.06-20130621/bin/arm-linux-gnueabihf-g++ -g -O2 -Wall -static -march=armv8-a -o hello_new hello.cpp ----> WORKS without any crash/issues.

This is what we have in the cpp file:
#include <stdio.h>

int main()
{
    printf("Hello World\n");

    return 0;
}

These are the libraries under /lib of our Linux Kernel:

ld-2.15.so
libSegFault.so
libc.so.6
 libcrypt.so.1
libgcc_s.so.1
 libnsl-2.15.so
    libnss_dns-2.15.so
  libnss_hesiod-2.15.so
 libnss_nisplus-2.15.so
 libpthread.so.0
 librt.so.1
    libthread_db-1.0.so
ld-linux.so.3
   libanl-2.15.so
 libcidn-2.15.so
libdl-2.15.so
  libm-2.15.so
   libnsl.so.1
    libnss_dns.so.2
    libnss_hesiod.so.2
 libnss_nisplus.so.2
  libresolv-2.15.so
 libstdc++.so
 libthread_db.so.1
libBrokenLocale-2.15.so
  libanl.so.1
libcidn.so.1
  libdl.so.2
  libm.so.6
  libnss_compat-2.15.so
 libnss_files-2.15.so
 libnss_nis-2.15.so
 libpcprofile.so
 libresolv.so.2
libstdc++.so.6
  libutil-2.15.so
libBrokenLocale.so.1
  libc-2.15.so
 libcrypt-2.15.so
 libgcc_s.so
libmemusage.so
libnss_compat.so.2
 libnss_files.so.2
  libnss_nis.so.2
libpthread-2.15.so
 librt-2.15.so
 libstdc++.so.6.0.18
libutil.so.1

Changed in gcc-linaro:
milestone: none → 4.8-2013.08
Changed in gcc-linaro:
assignee: nobody → Matthew Gretton-Dann (matthew-gretton-dann)
Revision history for this message
Matthew Gretton-Dann (matthew-gretton-dann) wrote :

Hi,

To help me identify what is going on it would be useful if you could provide the following information:
 * The output of -save-temps for all invocations of the compiler (this will be .s and .o files)
 * The ARM core you are running on

Thanks,

Matt

Revision history for this message
Marcus Shawcroft (marcus-shawcroft) wrote :

In summary, static linking works, dynamic linking doesn't, the compiler used is gnueabihf and the listing of the /lib directory does not contain the armhf dynamic loader ld-linux-armhf.so.3, which suggests the root file system pre-dates eabihf.

In this scenario I would have expected the shell to gripe. For example IIRC bash would report something like "no such file or directory" in this situation... but I can imagine that other shells might go silent in this situation.

That aside, it looks to me that the issue here is trying to use eabihf tooling on a system that predates eabihf.

Revision history for this message
Varun Mallikarjunan (varun-mallikarjunan) wrote : RE: [Bug 1197039] Re: 32bit Dynamically Linked App crashes without any prints on Linux Kernel 3.3 when compiled with Linaro GCC 2013.06) 4.8.2 20130603 (prerelease)
  • hello.ii Edit (25.8 KiB, application/octet-stream; name="hello.ii")
  • hello.o Edit (4.9 KiB, application/octet-stream; name="hello.o")
  • hello.s Edit (12.1 KiB, application/octet-stream; name="hello.s")
  • hello.ii_g++ Edit (25.8 KiB, application/octet-stream; name="hello.ii_g++")
  • hello.o_g++ Edit (4.9 KiB, application/octet-stream; name="hello.o_g++")
  • hello.s_g++ Edit (12.1 KiB, application/octet-stream; name="hello.s_g++")
Download full text (3.4 KiB)

This is the hello.ii_g++, hello.s_g++ and hello.o_g++ for save-temps with g++. The g++ executable fails whereas the gcc executable runs fine.

The gcc equivalent files (ii, o, s) are also attached. Please let me know if you need anything else.

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of Matthew Gretton-Dann
Sent: 26 July 2013 09:55
To: Varun Mallikarjunan
Subject: [Bug 1197039] Re: 32bit Dynamically Linked App crashes without any prints on Linux Kernel 3.3 when compiled with Linaro GCC 2013.06) 4.8.2 20130603 (prerelease)

Hi,

To help me identify what is going on it would be useful if you could provide the following information:
 * The output of -save-temps for all invocations of the compiler (this will be .s and .o files)
 * The ARM core you are running on

Thanks,

Matt

--
You received this bug notification because you are subscribed to the bug report.
https://bugs.launchpad.net/bugs/1197039

Title:
  32bit Dynamically Linked App crashes without any prints on Linux
  Kernel 3.3 when compiled with Linaro GCC 2013.06) 4.8.2 20130603
  (prerelease)

Status in Linaro GCC:
  New
Status in Linaro:
  New

Bug description:
  When we try to compile and run a simple hello_world program:

  We compiled with:
  linaro/gnueabi/2013.06-20130621/bin/arm-linux-gnueabihf-gcc -g -O2 -Wall -march=armv8-a -o hello_new hello.cpp ------> This runs fine.

  BUT when we compile the same with g++:
  linaro/gnueabi/2013.06-20130621/bin/arm-linux-gnueabihf-g++ -g -O2 -Wall -march=armv8-a -o hello_new hello.cpp ------> It crashes with no prints on Linux 3.3 kernel version.

  ALSO,
  Static linking with linaro/gnueabi/2013.06-20130621/bin/arm-linux-gnueabihf-g++ -g -O2 -Wall -static -march=armv8-a -o hello_new hello.cpp ----> WORKS without any crash/issues.

  This is what we have in the cpp file:
  #include <stdio.h>

  int main()
  {
      printf("Hello World\n");

      return 0;
  }

  These are the libraries under /lib of our Linux Kernel:

  ld-2.15.so
  libSegFault.so
  libc.so.6
   libcrypt.so.1
  libgcc_s.so.1
   libnsl-2.15.so
      libnss_dns-2.15.so
    libnss_hesiod-2.15.so
   libnss_nisplus-2.15.so
   libpthread.so.0
   librt.so.1
      libthread_db-1.0.so
  ld-linux.so.3
     libanl-2.15.so
   libcidn-2.15.so
  libdl-2.15.so
    libm-2.15.so
     libnsl.so.1
      libnss_dns.so.2
      libnss_hesiod.so.2
   libnss_nisplus.so.2
    libresolv-2.15.so
   libstdc++.so
   libthread_db.so.1
  libBrokenLocale-2.15.so
    libanl.so.1
  libcidn.so.1
    libdl.so.2
    libm.so.6
    libnss_compat-2.15.so
   libnss_files-2.15.so
   libnss_nis-2.15.so
   libpcprofile.so
   libresolv.so.2
  libstdc++.so.6
    libutil-2.15.so
  libBrokenLocale.so.1
    libc-2.15.so
   libcrypt-2.15.so
   libgcc_s.so
  libmemusage.so
  libnss_compat.so.2
   libnss_files.so.2
    libnss_nis.so.2
  libpthread-2.15.so
   librt-2.15.so
   libstdc++.so.6.0.18
  libutil.so.1

To manage notifications about this bug go to:
https://bugs.launchpad.net/gcc-linaro/+bug/1197039/+subscriptions

-- IMPORTANT NOTICE: The content...

Read more...

Revision history for this message
Zhenqiang Chen (zhenqiang-chen) wrote :

I guess it is due to libstdc++.

Please try to copy the 32-bit sysroot and runtime to your 64-bit system.

Viktor (vchong)
Changed in gcc-linaro:
status: New → Confirmed
Viktor (vchong)
Changed in gcc-linaro:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.