Motion - Bug Report 2015x 09x 30x 203633
You are here: Foswiki>Motion Web>BugReports>BugReport2015x09x30x203633 (30 Sep 2015, DaveFlogeras)Edit Attach

BUG: segfault in pthread_getspecific() on musl based system

It seems that during init, pthread_getspecific( tls_key_threadnr ); is being called before the call to pthread_key_create(). On glibc I think getspecific is more forgiving than on musl, which according to the manpage this is undefined behaviour. See below for BT
#0  __pthread_getspecific (k=0) at src/thread/pthread_getspecific.c:8
#1  0x0000bcd0 in motion_log (level=level@entry=6, errno_flag=errno_flag@entry=0, fmt=0x26124 "Processing thread 0 - config file %s") at motion.c:2758
#2  0x0000fee8 in conf_load (cnt=0x60ca0) at conf.c:1676
#3  0x0000c71c in cntlist_create (argv=0xbefff4b4, argc=1) at motion.c:2061
#4  motion_startup (daemonize=daemonize@entry=1, argc=1, argc@entry=276, argv=0xbefff4b4, argv@entry=0xda00 <motion_loop+3876>) at motion.c:2115
#5  0x0000ab7c in main (argc=276, argv=0xda00 <motion_loop+3876>) at motion.c:2270

Environment

Motion version: 3.2.12
ffmpeg version: na
Shared libraries: v4l2
Server OS: gentoo armv6j-hardfloat-linux-musleabi (rpi)
-- DaveFlogeras - 30 Sep 2015

Follow up

Fix record

BugReportForm edit

TopicTitle segfault in pthread_getspecific() on musl based system
BugStatus New
AssignedBugTo
SubmittedBy WikiGuest
Topic revision: r1 - 30 Sep 2015, DaveFlogeras
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.