Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Dammit Jim, I'm an actor, not a doctor.


devel / comp.programming.threads / p_thread crashes occasionally

SubjectAuthor
* p_thread crashes occasionallyRajnish Kumar
`- p_thread crashes occasionallyMarcel Mueller

1
p_thread crashes occasionally

<1cc173a9-6a7f-4003-95da-9ecbdafb1313n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9983&group=comp.programming.threads#9983

  copy link   Newsgroups: comp.programming.threads
X-Received: by 2002:a05:620a:668:b0:76d:a57f:6f5a with SMTP id a8-20020a05620a066800b0076da57f6f5amr118808qkh.3.1694932667988;
Sat, 16 Sep 2023 23:37:47 -0700 (PDT)
X-Received: by 2002:a9d:77ca:0:b0:6bc:c93b:3066 with SMTP id
w10-20020a9d77ca000000b006bcc93b3066mr1866647otl.1.1694932667687; Sat, 16 Sep
2023 23:37:47 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.programming.threads
Date: Sat, 16 Sep 2023 23:37:47 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=2409:40f2:1018:70d3:5545:6163:c1fb:f499;
posting-account=0CW_TgoAAADxJGnGl5YQMuIF9ZVzp-ub
NNTP-Posting-Host: 2409:40f2:1018:70d3:5545:6163:c1fb:f499
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1cc173a9-6a7f-4003-95da-9ecbdafb1313n@googlegroups.com>
Subject: p_thread crashes occasionally
From: rajnish....@trustfour.com (Rajnish Kumar)
Injection-Date: Sun, 17 Sep 2023 06:37:47 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 4259
 by: Rajnish Kumar - Sun, 17 Sep 2023 06:37 UTC

Hi,
I am running my C program on ubuntu.
It happens rarely though, may be once in 100 times. Any help will be appreciated.

Ubuntu details, sample code snippet, gdb stack provided below.

Regards,
-Rajnish

ubuntu details: -
$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.2 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.2 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

C code snippet that crashes once in 100 times (approx) -
void *connectWithFscsv(void *arg)
{ char *start_time = (char*)calloc(128, sizeof(char));
getCurrTime(&start_time);
pthread_t threadId = pthread_self();
struct ThreadArgs *args = (struct ThreadArgs *)arg;
char *ip = args->ip;
char *tlsver = args->tlsver;
struct json_object *json_extn = args->json_obj;

printf("%s: %s %s thread started with id: %lu started at: %s\n", __func__, ip, tlsver, threadId, start_time);

Callee :-
if (pthread_create(createThreadId, NULL, connectWithFscsv, (void *)(targ)) != 0)
{
printf("%s: threadId: %lu error: failed to create fscsv thread for: %s %s\n", __func__, threadId, targ->ip, targ->tlsver);
json_object_object_add(json_extn, "error", json_object_new_string("threading error - FSCSV thread creation failed"));
return 0;
}

gdb stacktrace :-
Program terminated with signal SIGABRT, Aborted.
#0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=140246469416512) at ./nptl/pthread_kill.c:44
44 ./nptl/pthread_kill.c: No such file or directory.
[Current thread is 1 (Thread 0x7f8dacfd9640 (LWP 464))]
(gdb) bt
#0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=140246469416512) at ./nptl/pthread_kill.c:44
#1 __pthread_kill_internal (signo=6, threadid=140246469416512) at ./nptl/pthread_kill.c:78
#2 __GI___pthread_kill (threadid=140246469416512, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3 0x00007f8db4846476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4 0x00007f8db482c7f3 in __GI_abort () at ./stdlib/abort.c:79
#5 0x00007f8db488d6f6 in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7f8db49dfb8c "%s\n") at ../sysdeps/posix/libc_fatal.c:155
#6 0x00007f8db48a4d7c in malloc_printerr (str=str@entry=0x7f8db49e27b0 "double free or corruption (out)") at ./malloc/malloc.c:5664
#7 0x00007f8db48a6ef0 in _int_free (av=0x7f8db4a1dc80 <main_arena>, p=0x7f8d98029d70, have_lock=<optimized out>) at ./malloc/malloc.c:4588
#8 0x00007f8db48a972d in __GI___libc_free (mem=<optimized out>) at ./malloc/malloc.c:3391
#9 tcache_thread_shutdown () at ./malloc/malloc.c:3227
#10 __malloc_arena_thread_freeres () at ./malloc/arena.c:1003
#11 0x00007f8db48ac24a in __libc_thread_freeres () at ./malloc/thread-freeres.c:44
#12 0x00007f8db48989cf in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:456
#13 0x00007f8db4929bb4 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:100

Re: p_thread crashes occasionally

<ue6pli$2232m$2@gwaiyur.mb-net.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9984&group=comp.programming.threads#9984

  copy link   Newsgroups: comp.programming.threads
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.mb-net.net!open-news-network.org!.POSTED!not-for-mail
From: news.5.m...@spamgourmet.org (Marcel Mueller)
Newsgroups: comp.programming.threads
Subject: Re: p_thread crashes occasionally
Date: Sun, 17 Sep 2023 13:58:42 +0200
Organization: MB-NET.NET for Open-News-Network e.V.
Message-ID: <ue6pli$2232m$2@gwaiyur.mb-net.net>
References: <1cc173a9-6a7f-4003-95da-9ecbdafb1313n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 17 Sep 2023 11:58:42 -0000 (UTC)
Injection-Info: gwaiyur.mb-net.net;
logging-data="2165846"; mail-complaints-to="abuse@open-news-network.org"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.15.1
Cancel-Lock: sha1:y0KGqDUx/jDo1ptxkQsqC8pBxvA= sha256:/kYp/66iGQv/s8uKsiR4sQ31ZhcE5+OVwucZ2yRvPs4=
sha1:k1D6kasdauSWSNwRMOTSUI7A5+s= sha256:4R2ZpnpIhD8opf68GuvhMHuw9aBZmDZNYWa8zasJ9VE=
Content-Language: de-DE, en-US
In-Reply-To: <1cc173a9-6a7f-4003-95da-9ecbdafb1313n@googlegroups.com>
 by: Marcel Mueller - Sun, 17 Sep 2023 11:58 UTC

Am 17.09.23 um 08:37 schrieb Rajnish Kumar:
> I am running my C program on ubuntu.
> It happens rarely though, may be once in 100 times. Any help will be appreciated.
>
> Ubuntu details, sample code snippet, gdb stack provided below.

This ist most like a corrupted heap.
Somewhere in you program is a buffer overflow or some memory access
after free.

If it happens to work mostly a race condition is likely involved too.

Marcel

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor