New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coredump when compiled _modular_ with tcc #751

Open
michaelortmann opened this Issue Nov 2, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@michaelortmann
Member

michaelortmann commented Nov 2, 2018

Eggdrop can now be compiled with tcc.

Static compile runs fine, but modular (default) compile coredumps.

We should detect tcc and force static compile for it.

tcc 0.9.27
Eggdrop 1.8.3+sendfprint
Linux 4.18.16
glibc 2.28
Tcl 8.6.8
OpenSSL 1.1.1
$ ./eggdrop -nt

Eggdrop v1.8.3+sendfprint (C) 1997 Robey Pointer (C) 2010-2018 Eggheads
--- Loading eggdrop v1.8.3+sendfprint (Fri Nov  2 2018)
Listening for telnet connections on 0.0.0.0:2513 (all).
Listening for telnet connections on 0.0.0.0:2523 (users).
Module loaded: blowfish        
Module loaded: channels        
Module loaded: server          
Module loaded: ctcp            
Module loaded: irc             
* Last context: tclhash.c/250 []
* Please REPORT this BUG!
* Check doc/BUG-REPORT on how to do so.
* Wrote DEBUG
* SEGMENT VIOLATION -- CRASHING!
Segmentation fault (core dumped)
$ coredumpctl debug
[...]
       Storage: /var/lib/systemd/coredump/core.eggdrop.1000.d90a48d675f24d14817bec9b6e62f54c.23013.1541187091000000.lz4
       Message: Process 23013 (eggdrop) of user 1000 dumped core.
                
                Stack trace of thread 23013:
                #0  0x00007f53aa897c81 n/a (/home/michael/eggdrop/modules-1.8.3/compress.so)
                #1  0x0000000000468c79 n/a (/home/michael/eggdrop/eggdrop-1.8.3)
                #2  0x000000000048636c n/a (/home/michael/eggdrop/eggdrop-1.8.3)
                #3  0x00007f53ac969c5a TclInvokeStringCommand (libtcl8.6.so)
                #4  0x00007f53ac96ee16 TclNRRunCallbacks (libtcl8.6.so)
                #5  0x00007f53ac970cac TclEvalEx (libtcl8.6.so)
                #6  0x00007f53aca2b711 Tcl_FSEvalFileEx (libtcl8.6.so)
                #7  0x00007f53aca2b809 Tcl_EvalFile (libtcl8.6.so)
                #8  0x000000000047432f n/a (/home/michael/eggdrop/eggdrop-1.8.3)
                #9  0x000000000042a6c7 n/a (/home/michael/eggdrop/eggdrop-1.8.3)
                #10 0x000000000045ec93 n/a (/home/michael/eggdrop/eggdrop-1.8.3)
                #11 0x00007f53ac78a223 __libc_start_main (libc.so.6)
                #12 0x000000000040ebae n/a (/home/michael/eggdrop/eggdrop-1.8.3)

GNU gdb (GDB) 8.2
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/michael/eggdrop/eggdrop-1.8.3...done.

warning: core file may not match specified executable file.
[New LWP 23013]
[New LWP 23014]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Core was generated by `./eggdrop -nt'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f53aa897c81 in compress_start () at .././compress.mod/compress.c:437
437	  global = global_funcs;
[Current thread is 1 (Thread 0x7f53ac043b80 (LWP 23013))]
(gdb) bt full
#0  0x00007f53aa897c81 in compress_start () at .././compress.mod/compress.c:437
No locals.
#1  0x0000000000468c79 in module_load () at modules.c:820
No locals.
#2  0x000000000048636c in tcl_loadmodule () at tclmisc.c:559
No locals.
#3  0x00007f53ac969c5a in TclInvokeStringCommand () from /usr/lib/libtcl8.6.so
No symbol table info available.
#4  0x00007f53ac96ee16 in TclNRRunCallbacks () from /usr/lib/libtcl8.6.so
No symbol table info available.
#5  0x00007f53ac970cac in TclEvalEx () from /usr/lib/libtcl8.6.so
No symbol table info available.
#6  0x00007f53aca2b711 in Tcl_FSEvalFileEx () from /usr/lib/libtcl8.6.so
No symbol table info available.
#7  0x00007f53aca2b809 in Tcl_EvalFile () from /usr/lib/libtcl8.6.so
No symbol table info available.
#8  0x000000000047432f in readtclprog () at tcl.c:768
No locals.
#9  0x000000000042a6c7 in chanprog () at chanprog.c:463
No locals.
#10 0x000000000045ec93 in main () at ./main.c:1157
No locals.
(gdb)
(gdb) disassemble 0x00007f53aa897c81
Dump of assembler code for function compress_start:
   0x00007f53aa897c67 <+0>:	push   %rbp
   0x00007f53aa897c68 <+1>:	mov    %rsp,%rbp
   0x00007f53aa897c6b <+4>:	sub    $0x50,%rsp
   0x00007f53aa897c72 <+11>:	mov    %rdi,-0x8(%rbp)
   0x00007f53aa897c76 <+15>:	mov    -0x8(%rbp),%rax
   0x00007f53aa897c7a <+19>:	mov    0x2010b7(%rip),%r11        # 0x7f53aaa98d38 <*ABS*@got.plt>
=> 0x00007f53aa897c81 <+26>:	mov    %rax,(%r11)
[...]

@michaelortmann michaelortmann changed the title from Coredump when compiled with tcc to Coredump when compiled _modular_ with tcc Nov 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment