mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Barry Flartus <barry.flartus@gmail.com>
To: musl@lists.openwall.com
Subject: Re: Problems with pthreads from a shared object?
Date: Wed, 7 Nov 2018 18:53:33 -0500	[thread overview]
Message-ID: <CAHnO0Js7BiCe2TBoW=+1UTUkHQPyf749TjBzidAPQSX9srYt7w@mail.gmail.com> (raw)
In-Reply-To: <20181107234526.GW5150@brightrain.aerifal.cx>

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

>
> OK. Can you run strace -f ./launch (or whatever the launch program
> executable is called) and post the output?
>
> Rich
>

Here you go!

$ strace -f ./launch
execve("./launch", ["./launch"], [/* 22 vars */]) = 0
brk(NULL)                               = 0xe44000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or
directory)
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=42286, ...}) = 0
mmap(NULL, 42286, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fcda3aa9000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or
directory)
open("/lib/x86_64-linux-gnu/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3,
"\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240\r\0\0\0\0\0\0"..., 832)
= 832
fstat(3, {st_mode=S_IFREG|0644, st_size=14608, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x7fcda3aa8000
mmap(NULL, 2109680, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) =
0x7fcda368b000
mprotect(0x7fcda368e000, 2093056, PROT_NONE) = 0
mmap(0x7fcda388d000, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7fcda388d000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or
directory)
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P\t\2\0\0\0\0\0"...,
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1868984, ...}) = 0
mmap(NULL, 3971488, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) =
0x7fcda32c1000
mprotect(0x7fcda3481000, 2097152, PROT_NONE) = 0
mmap(0x7fcda3681000, 24576, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c0000) = 0x7fcda3681000
mmap(0x7fcda3687000, 14752, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fcda3687000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x7fcda3aa7000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x7fcda3aa6000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x7fcda3aa5000
arch_prctl(ARCH_SET_FS, 0x7fcda3aa6700) = 0
mprotect(0x7fcda3681000, 16384, PROT_READ) = 0
mprotect(0x7fcda388d000, 4096, PROT_READ) = 0
mprotect(0x600000, 4096, PROT_READ)     = 0
mprotect(0x7fcda3ab4000, 4096, PROT_READ) = 0
munmap(0x7fcda3aa9000, 42286)           = 0
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 2), ...}) = 0
brk(NULL)                               = 0xe44000
brk(0xe65000)                           = 0xe65000
write(1, "\n", 1
)                       = 1
write(1, "Launching test...\n", 18Launching test...
)     = 18
open("./test.so", O_RDONLY|O_CLOEXEC)   = 3
read(3,
"\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240!\0\0\0\0\0\0"..., 832)
= 832
fstat(3, {st_mode=S_IFREG|0755, st_size=40152, ...}) = 0
getcwd("/vagrant/test/wtf/public", 128) = 25
mmap(NULL, 2128504, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) =
0x7fcda30b9000
mprotect(0x7fcda30c0000, 2093056, PROT_NONE) = 0
mmap(0x7fcda32bf000, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7fcda32bf000
close(3)                                = 0
mprotect(0x7fcda32bf000, 4096, PROT_READ) = 0
write(1, "Starting Execution\n", 19Starting Execution
)    = 19
write(1, "Starting the thread\n", 20Starting the thread
)   = 20
write(1, "start_thread returned 38\n", 25start_thread returned 38
) = 25
write(1, "pthread_create() returned an err"..., 46pthread_create() returned
an error. Aborting.
) = 46
exit_group(0)                           = ?
+++ exited with 0 +++

$ ltrace -f ./launch
[pid 13508] __libc_start_main(0x400746, 1, 0x7ffff030bbc8, 0x4007b0
<unfinished ...>
[pid 13508] puts("\nLaunching test..."
Launching test...
)
                                     = 19
[pid 13508] dlopen("./test.so", 2Starting Execution
Starting the thread
start_thread returned 38
pthread_create() returned an error. Aborting.
)
                                          = 0x12d6440
[pid 13508] dlerror()

 = nil
[pid 13508] +++ exited (status 0) +++

[-- Attachment #2: Type: text/html, Size: 6098 bytes --]

  reply	other threads:[~2018-11-07 23:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-07 23:00 Barry Flartus
2018-11-07 23:31 ` Rich Felker
2018-11-07 23:40   ` Barry Flartus
2018-11-07 23:45     ` Rich Felker
2018-11-07 23:53       ` Barry Flartus [this message]
2018-11-08  0:43         ` Rich Felker
2018-11-08  1:02           ` Barry Flartus
2018-11-08  1:28             ` Rich Felker
2018-11-08  8:50           ` Jeffrey Walton
2018-11-08 14:53             ` Barry Flartus
2018-11-08 15:17               ` Rich Felker
2018-11-08 17:14                 ` Barry Flartus
2018-11-08 17:37                   ` Rich Felker
2018-11-08 17:56                     ` Barry Flartus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHnO0Js7BiCe2TBoW=+1UTUkHQPyf749TjBzidAPQSX9srYt7w@mail.gmail.com' \
    --to=barry.flartus@gmail.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).