public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
* SIGSEGV when running 32bit apps
@ 2023-05-05  0:16 alexandre schenberg
  2023-05-05  1:33 ` Andrew Bell
  0 siblings, 1 reply; 4+ messages in thread
From: alexandre schenberg @ 2023-05-05  0:16 UTC (permalink / raw)
  To: libc-help

Hello. When trying execute the vast majority of 32bit applications, they end causing a segmentation fault.

Running one of them with these sequence of commands: 
LD_LIBRARY_PATH=/media/34GB/Arquivos-de-Programas-Linux/Gcc-4.9.4/lib32/ gdb ./raytracer
(gdb) run
(gdb) backtrace

I end receiving:

Program received signal SIGSEGV, Segmentation fault.
0x000044ae in ?? ()
(gdb) backtrace
#0  0x000044ae in ?? ()
#1  0xf7eb5854 in ?? ()
#2  0xf7fde66e in dl_main (phdr=0x8048034, phnum=8, user_entry=0xffffd3ec, auxv=0xffffd52c) at rtld.c:2203
#3  0xf7fefb89 in _dl_sysdep_start (start_argptr=0xffffd480, dl_main=0xf7fdc490 <dl_main>) at ../elf/dl-sysdep.c:241
#4  0xf7fdf6fe in _dl_start_final (arg=0xffffd480) at rtld.c:331
#5  _dl_start (arg=<optimized out>) at rtld.c:557
#6  0xf7fdba87 in _start () from /usr/lib32/ld-2.17.so

What I did so far. Installed Glibc outside the usual system tree of directories. Created /usr/lib32. Made symbolic links from everything on Glibc-2.17/lib to it. Then added /usr/lib32 to ld.so.conf. 
Installed Gcc outside system tree of directories. Created a symbolic link in /usr/lib32 to libstdc++.so.6
Executed ldconfig.

What it works. Simple C programs (use only standard c libraries). Static linked c and c++ programs
What doesn't work. Any non static c++ program. Any non static c program that uses anything outside standard c (for instance, a simple gtk example) 

What I think it's happening after reading the backtrace: Some auxiliary 64bit library is being accessed when executing 32bit, some address is being computed based in incorrect 64bit data. The question is: How to fix it?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: SIGSEGV when running 32bit apps
  2023-05-05  0:16 SIGSEGV when running 32bit apps alexandre schenberg
@ 2023-05-05  1:33 ` Andrew Bell
  2023-05-06 23:54   ` alexandre schenberg
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Bell @ 2023-05-05  1:33 UTC (permalink / raw)
  To: alexandre schenberg; +Cc: libc-help

[-- Attachment #1: Type: text/plain, Size: 2186 bytes --]

It's not clear what you have done or what you're trying to accomplish. I'll
just note that the loader (ld.so) must match the libc.so you're using. You
need to make sure that your programs find these libraries by setting
LD_LIBRARY_PATH or building your program to include the correct RUNPATH.

On Thu, May 4, 2023 at 8:17 PM alexandre schenberg via Libc-help <
libc-help@sourceware.org> wrote:

> Hello. When trying execute the vast majority of 32bit applications, they
> end causing a segmentation fault.
>
> Running one of them with these sequence of commands:
> LD_LIBRARY_PATH=/media/34GB/Arquivos-de-Programas-Linux/Gcc-4.9.4/lib32/
> gdb ./raytracer
> (gdb) run
> (gdb) backtrace
>
> I end receiving:
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x000044ae in ?? ()
> (gdb) backtrace
> #0  0x000044ae in ?? ()
> #1  0xf7eb5854 in ?? ()
> #2  0xf7fde66e in dl_main (phdr=0x8048034, phnum=8, user_entry=0xffffd3ec,
> auxv=0xffffd52c) at rtld.c:2203
> #3  0xf7fefb89 in _dl_sysdep_start (start_argptr=0xffffd480,
> dl_main=0xf7fdc490 <dl_main>) at ../elf/dl-sysdep.c:241
> #4  0xf7fdf6fe in _dl_start_final (arg=0xffffd480) at rtld.c:331
> #5  _dl_start (arg=<optimized out>) at rtld.c:557
> #6  0xf7fdba87 in _start () from /usr/lib32/ld-2.17.so
>
> What I did so far. Installed Glibc outside the usual system tree of
> directories. Created /usr/lib32. Made symbolic links from everything on
> Glibc-2.17/lib to it. Then added /usr/lib32 to ld.so.conf.
> Installed Gcc outside system tree of directories. Created a symbolic link
> in /usr/lib32 to libstdc++.so.6
> Executed ldconfig.
>
> What it works. Simple C programs (use only standard c libraries). Static
> linked c and c++ programs
> What doesn't work. Any non static c++ program. Any non static c program
> that uses anything outside standard c (for instance, a simple gtk example)
>
> What I think it's happening after reading the backtrace: Some auxiliary
> 64bit library is being accessed when executing 32bit, some address is being
> computed based in incorrect 64bit data. The question is: How to fix it?
>


-- 
Andrew Bell
andrew.bell.ia@gmail.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re:SIGSEGV when running 32bit apps
  2023-05-05  1:33 ` Andrew Bell
@ 2023-05-06 23:54   ` alexandre schenberg
  2023-05-07  0:55     ` 김찬
  0 siblings, 1 reply; 4+ messages in thread
From: alexandre schenberg @ 2023-05-06 23:54 UTC (permalink / raw)
  To: Andrew Bell; +Cc: libc-help

It's quite simple. Most times I try to run a 32bit application that I built from source, I end with a segmentation fault with the exceptions that I listed in my first post.

I built the majority of them with -Wl,--dynamic-link=/usr/lib32/ld-2.17.so, which is a symbolic link to /media/34GB/Arquivos-de-Programas-Linux-32bit/Glibc-2.17/lib/ld-2.17.so where it dwells. So the versions match and the loader can be find.

I believe the source of the segmentation faults is using some auxiliary 64bit glibc libraries, but precisely what and how to solve it remains a mystery to me

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Re:SIGSEGV when running 32bit apps
  2023-05-06 23:54   ` alexandre schenberg
@ 2023-05-07  0:55     ` 김찬
  0 siblings, 0 replies; 4+ messages in thread
From: 김찬 @ 2023-05-07  0:55 UTC (permalink / raw)
  To: alexandre schenberg, Andrew Bell; +Cc: libc-help

[-- Attachment #1: Type: text/plain, Size: 997 bytes --]

How about using ldd command to see what libraries your program depends on, and to see if you have all the necessary 32 bit versions of the libraries?Chan Kim-----Original Message-----From: alexandre schenberg via Libc-help &lt;libc-help@sourceware.org&gt;To: Andrew Bell &lt;andrew.bell.ia@gmail.com&gt;Cc: libc-help@sourceware.orgSent: 2023-05-07T08:54:04+09:00Subject: Re:SIGSEGV when running 32bit appsIt's quite simple. Most times I try to run a 32bit application that I built from source, I end with a segmentation fault with the exceptions that I listed in my first post.



I built the majority of them with -Wl,--dynamic-link=/usr/lib32/ld-2.17.so, which is a symbolic link to /media/34GB/Arquivos-de-Programas-Linux-32bit/Glibc-2.17/lib/ld-2.17.so where it dwells. So the versions match and the loader can be find.



I believe the source of the segmentation faults is using some auxiliary 64bit glibc libraries, but precisely what and how to solve it remains a mystery to me







^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-05-07  0:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-05  0:16 SIGSEGV when running 32bit apps alexandre schenberg
2023-05-05  1:33 ` Andrew Bell
2023-05-06 23:54   ` alexandre schenberg
2023-05-07  0:55     ` 김찬

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).