Giter Site home page Giter Site logo

Comments (10)

anael-seghezzi avatar anael-seghezzi commented on August 15, 2024

What is the version of libpthread in your Ubuntu ?
Does it still crash if you run a version compiled on your Arch linux ?

CToy enables live coding, it recompiles when the source code is modified, that's what run in the thread.
CToy_player just compiles at the beginning (no live coding).

from ctoy.

Smilex avatar Smilex commented on August 15, 2024

The ubuntu version is 2.23, and yes it still crashes with the same backtrace, when compiled on Arch

from ctoy.

anael-seghezzi avatar anael-seghezzi commented on August 15, 2024

I'm not sure but it's possible you may have to recompile libtcc.so too on Arch.
It would be surprising if the bug is related to libpthead. Or the bug comes from the code running in the thread, or something related to libtcc and (maybe) the version of glibc used to compile libtcc.

from ctoy.

anael-seghezzi avatar anael-seghezzi commented on August 15, 2024

If the version of glibc used to commile libtcc.so on ubuntu is more recent than glibc used in Arch linux it could cause a crash on certain conditions (except if you already recompiled libtcc).

from ctoy.

Smilex avatar Smilex commented on August 15, 2024

Sorry about the delay.
I compiled libtcc on this Arch laptop, and I still get the same issue with the same bt.
However I do find the different versions of GLIBC mentioned in the following weird. Remember that ldd --version gives me 2.26, so these are 3 different versions where I would expect one.

[ian@arch MTCL]$ readelf -s CToy | grep pthread
6: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_getspecific@GLIBC_2.2.5 (3)
9: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_cond_destroy@GLIBC_2.3.2 (4)
17: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_mutex_timedlock@GLIBC_2.2.5 (3)
21: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_setspecific@GLIBC_2.2.5 (3)
33: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_cond_signal@GLIBC_2.3.2 (4)
38: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_mutexattr_destroy@GLIBC_2.2.5 (3)
55: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_cond_timedwait@GLIBC_2.3.2 (4)
67: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_mutex_init@GLIBC_2.2.5 (3)
87: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_create@GLIBC_2.2.5 (3)
91: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_cond_init@GLIBC_2.3.2 (4)
98: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_key_delete@GLIBC_2.2.5 (3)
106: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_self@GLIBC_2.2.5 (3)
107: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_join@GLIBC_2.2.5 (3)
109: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_mutex_trylock@GLIBC_2.2.5 (3)
115: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_exit@GLIBC_2.2.5 (3)
142: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_mutexattr_settype@GLIBC_2.2.5 (3)
163: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_cond_wait@GLIBC_2.3.2 (4)
164: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_detach@GLIBC_2.2.5 (3)
192: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_mutex_lock@GLIBC_2.2.5 (3)
195: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_mutexattr_init@GLIBC_2.2.5 (3)
198: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_key_create@GLIBC_2.2.5 (3)
199: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_mutex_destroy@GLIBC_2.2.5 (3)
201: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_cond_broadcast@GLIBC_2.3.2 (4)
207: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_mutex_unlock@GLIBC_2.2.5 (3)
350: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_getspecific@@glib
365: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_cond_destroy@@gli
477: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_mutex_timedlock@@
655: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_setspecific@@glib
830: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_cond_signal@@glib
906: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_mutexattr_destroy
1263: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_cond_timedwait@@g
1389: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_mutex_init@@glibc
1769: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_create@@GLIBC_2.2
1793: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_cond_init@@GLIBC_
1929: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_key_delete@@glibc
2152: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_self@@GLIBC_2.2.5
2173: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_join@@GLIBC_2.2.5
2204: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_mutex_trylock@@gl
2326: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_exit@@GLIBC_2.2.5
2940: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_mutexattr_settype
3258: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_cond_wait@@GLIBC_
3310: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_detach@@GLIBC_2.2
3827: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_mutex_lock@@glibc
3886: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_mutexattr_init@@g
3914: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_key_create@@glibc
3959: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_mutex_destroy@@gl
4010: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_cond_broadcast@@g
4087: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_mutex_unlock@@gli

from ctoy.

anael-seghezzi avatar anael-seghezzi commented on August 15, 2024

Ok, let's try to locate the bug more precisely. Try this two different things :
A: Comment the code inside "ctoy__src_thread_init", does it still crash ?
B: Comment the code inside "ctoy__io_replace", does it still crash ?

I'm wondering if there is not a conflict between tinycthread.h and threads.h with the function name thrd_***. Check that everything is compiled in ANSI-C99 (no C11).

from ctoy.

cwkx avatar cwkx commented on August 15, 2024

also getting this, the crash can be preventing by commenting any of:

140: thrd_join(ctoy__src_thread_id, NULL);
146: ctoy__src_thread_destroy();
541: ctoy__src_thread_restart();

do you need to call ctoy__src_thread_restart(); in line 541?

(edit: the live reloading also didn't seem to be working, unless I was doing it wrong)

from ctoy.

anael-seghezzi avatar anael-seghezzi commented on August 15, 2024

Are you also on Arch Linux ?
What version of glibc is it bundled with ?

from ctoy.

cwkx avatar cwkx commented on August 15, 2024

yep, 2.26

from ctoy.

anael-seghezzi avatar anael-seghezzi commented on August 15, 2024

It may be caused by a glibc bug : https://sourceware.org/bugzilla/show_bug.cgi?id=20116

from ctoy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.