Skip to content
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

Finish porting SWICLI toYAP #3

Open
TeamSPoon opened this issue Feb 21, 2016 · 1 comment
Open

Finish porting SWICLI toYAP #3

TeamSPoon opened this issue Feb 21, 2016 · 1 comment

Comments

@TeamSPoon
Copy link
Member

?- cli_call('System.Threading.ThreadPool','GetAvailableThreads'(X,Y),_).
Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) SbsSW.SwiPlCs.SafeNativeMethods.PL_next_solution (uint) <0xffffffff>
  at SbsSW.SwiPlCs.libpl.PL_next_solution (uint) <0x0001b>
  at SbsSW.SwiPlCs.PlQuery.NextSolution () <0x00023>
  at SbsSW.SwiPlCs.PlQuery.PlCall (string,string,SbsSW.SwiPlCs.PlTermV) <0x0004f>
  at Swicli.Library.PrologCLR.PlCall (string,string,SbsSW.SwiPlCs.PlTermV) <0x00077>
  at SbsSW.SwiPlCs.libpl.PL_chars_to_term (string,uint) <0x000af>
  at SbsSW.SwiPlCs.PlTerm..ctor (string) <0x0002f>
  at SbsSW.SwiPlCs.Exceptions.PlTypeException..ctor (string,SbsSW.SwiPlCs.PlTerm) <0x00097>
  at SbsSW.SwiPlCs.PlTerm.CastToString0 (uint) <0x000d3>
  at SbsSW.SwiPlCs.PlTerm.CastToString (uint) <0x00023>
  at SbsSW.SwiPlCs.PlTerm.op_Explicit (SbsSW.SwiPlCs.PlTerm) <0x00033>
  at SbsSW.SwiPlCs.PlTerm.ToString () <0x0003b>
  at SbsSW.SwiPlCs.PlTerm.ToStringAsListFormat () <0x000c3>
  at SbsSW.SwiPlCs.PlTerm.ToString () <0x00023>
  at string.Concat (object,object) <0x00040>
  at Swicli.Library.PrologCLR.GetType (SbsSW.SwiPlCs.PlTerm,bool) <0x00c3b>
  at Swicli.Library.PrologCLR.GetParamSpec (SbsSW.SwiPlCs.PlTerm[],bool,int,int) <0x000ab>
  at Swicli.Library.PrologCLR.GetParamSpec (SbsSW.SwiPlCs.PlTerm[],bool) <0x00027>
  at Swicli.Library.PrologCLR.GetParamSpecFromObjects (SbsSW.SwiPlCs.PlTerm[]) <0x00037>
  at Swicli.Library.PrologCLR.cliCallRawForVar (SbsSW.SwiPlCs.PlTerm,SbsSW.SwiPlCs.PlTerm,SbsSW.SwiPlCs.PlTerm,SbsSW.SwiPlCs.PlTerm,System.Type) <0x00197>
  at Swicli.Library.PrologCLR.cliCallRaw (SbsSW.SwiPlCs.PlTerm,SbsSW.SwiPlCs.PlTerm,SbsSW.SwiPlCs.PlTerm,SbsSW.SwiPlCs.PlTerm) <0x000df>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_bool_PlTerm_PlTerm_PlTerm_PlTerm (object,intptr,intptr,intptr) <0xffffffff>
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) <0xffffffff>
  at System.Reflection.MonoMethod.Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) <0x000d7>
  at System.Reflection.MethodBase.Invoke (object,object[]) <0x00032>
  at Swicli.Library.PrologCLR.InvokeCaught0 (System.Reflection.MethodInfo,object,object[],System.Action) <0x004cf>
  at Swicli.Library.PrologCLR.InvokeCaughtB (System.Reflection.MethodInfo,object,object[]) <0x0007f>
  at Swicli.Library.PrologCLR/<InternMethod>c__AnonStorey8.<>m__4 (SbsSW.SwiPlCs.PlTerm,SbsSW.SwiPlCs.PlTerm,SbsSW.SwiPlCs.PlTerm,SbsSW.SwiPlCs.PlTerm) <0x00143>
  at (wrapper native-to-managed) Swicli.Library.PrologCLR/<InternMethod>c__AnonStorey8.<>m__4 (SbsSW.SwiPlCs.PlTerm,SbsSW.SwiPlCs.PlTerm,SbsSW.SwiPlCs.PlTerm,SbsSW.SwiPlCs.PlTerm) <0xffffffff>

Native stacktrace:

        /usr/lib/libmonoboehm-2.0.so.1(+0xcec62) [0x7f367e97ec62]
        /usr/lib/libmonoboehm-2.0.so.1(+0x12b08b) [0x7f367e9db08b]
        /usr/lib/libmonoboehm-2.0.so.1(+0x38813) [0x7f367e8e8813]
        /lib/x86_64-linux-gnu/libc.so.6(+0x36d40) [0x7f3680d44d40]
        /usr/local/lib/libYap.so.6.3(+0x2610f1) [0x7f36813340f1]
        /usr/local/lib/libYap.so.6.3(+0x2632f8) [0x7f36813362f8]
        /usr/local/lib/libYap.so.6.3(Yap_plwrite+0x14f) [0x7f3681338877]
        /usr/local/lib/libYap.so.6.3(Yap_TermToString+0x125) [0x7f3681338b4f]
        /usr/local/lib/libYap.so.6.3(+0x2b0236) [0x7f3681383236]
        /usr/local/lib/libYap.so.6.3(Yap_absmi+0x29487) [0x7f3681130568]
        /usr/local/lib/libYap.so.6.3(+0x275332) [0x7f3681348332]
        /usr/local/lib/libYap.so.6.3(YAP_EnterGoal+0xfb) [0x7f3681348457]
        /usr/local/lib/libYap.so.6.3(PL_next_solution+0x7a) [0x7f36813d3224]
        [0x41e07e57]

Debug info from gdb:

SIGINT is used by the debugger.
Are you sure you want to change it? (y or n) [answered Y; input not from terminal]
[New LWP 27303]
[New LWP 27302]
[New LWP 27301]
[New LWP 27300]
[New LWP 27299]
[New LWP 27298]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
-----------------------------------------------------------------------------------------------------------------------[regs]
  RAX: 0xFFFFFFFFFFFFFE00  RBX: 0x00000000006020B0  RBP: 0x0000000000006BF7  RSP: 0x00007F36818332E0  o d I t s Z a P c
  RDI: 0x0000000000006BF7  RSI: 0x00007F368183330C  RDX: 0x0000000000000000  RCX: 0xFFFFFFFFFFFFFFFF  RIP: 0x00007F3680DCEB99
  R8 : 0x0000000000000000  R9 : 0x0000000000000001  R10: 0x0000000000000000  R11: 0x0000000000000246  R12: 0x00007F3681833310
  R13: 0x0000000000006AA1  R14: 0x00007F367EB08D08  R15: 0x0000000001C39F90
  CS: 0033  DS: 0000  ES: 0000  FS: 0000  GS: 0000  SS: 002B
-----------------------------------------------------------------------------------------------------------------------[code]
=> 0x7f3680dceb99 <__libc_waitpid+105>: cmp    rax,0xfffffffffffff000
   0x7f3680dceb9f <__libc_waitpid+111>: mov    rbx,rax
   0x7f3680dceba2 <__libc_waitpid+114>: ja     0x7f3680dcebb4 <__libc_waitpid+132>
   0x7f3680dceba4 <__libc_waitpid+116>: mov    edi,r8d
   0x7f3680dceba7 <__libc_waitpid+119>: call   0x7f3680e161d0 <__libc_disable_asynccancel>
   0x7f3680dcebac <__libc_waitpid+124>: add    rsp,0x10
   0x7f3680dcebb0 <__libc_waitpid+128>: mov    eax,ebx
   0x7f3680dcebb2 <__libc_waitpid+130>: pop    rbx
-----------------------------------------------------------------------------------------------------------------------------
0x00007f3680dceb99 in __libc_waitpid (pid=0x6bf7, stat_loc=0x7f368183330c, options=0x0) at ../sysdeps/unix/sysv/linux/waitpid.c:40
40      ../sysdeps/unix/sysv/linux/waitpid.c: No such file or directory.
  Id   Target Id         Frame
  7    Thread 0x7f367dc4d700 (LWP 27298) "yap" pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
  6    Thread 0x7f367d44c700 (LWP 27299) "yap" pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
  5    Thread 0x7f367cc4b700 (LWP 27300) "yap" pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
  4    Thread 0x7f367c44a700 (LWP 27301) "yap" pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
  3    Thread 0x7f367bc49700 (LWP 27302) "yap" pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
  2    Thread 0x7f367b16e700 (LWP 27303) "yap" sem_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:85
* 1    Thread 0x7f3681825740 (LWP 27297) "yap" 0x00007f3680dceb99 in __libc_waitpid (pid=0x6bf7, stat_loc=0x7f368183330c, options=0x0) at ../sysdeps/unix/sysv/linux/waitpid.c:40

Thread 7 (Thread 0x7f367dc4d700 (LWP 27298)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f367eaf7257 in ?? () from /usr/lib/libmonoboehm-2.0.so.1
#2  0x00007f367eaeefa2 in ?? () from /usr/lib/libmonoboehm-2.0.so.1
#3  0x00007f367eaf59a4 in ?? () from /usr/lib/libmonoboehm-2.0.so.1
#4  0x00007f367e492182 in start_thread (arg=0x7f367dc4d700) at pthread_create.c:312
#5  0x00007f3680e0847d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 6 (Thread 0x7f367d44c700 (LWP 27299)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f367eaf7257 in ?? () from /usr/lib/libmonoboehm-2.0.so.1
#2  0x00007f367eaeefa2 in ?? () from /usr/lib/libmonoboehm-2.0.so.1
#3  0x00007f367eaf59a4 in ?? () from /usr/lib/libmonoboehm-2.0.so.1
#4  0x00007f367e492182 in start_thread (arg=0x7f367d44c700) at pthread_create.c:312
#5  0x00007f3680e0847d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 5 (Thread 0x7f367cc4b700 (LWP 27300)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f367eaf7257 in ?? () from /usr/lib/libmonoboehm-2.0.so.1
#2  0x00007f367eaeefa2 in ?? () from /usr/lib/libmonoboehm-2.0.so.1
#3  0x00007f367eaf59a4 in ?? () from /usr/lib/libmonoboehm-2.0.so.1
#4  0x00007f367e492182 in start_thread (arg=0x7f367cc4b700) at pthread_create.c:312
#5  0x00007f3680e0847d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 4 (Thread 0x7f367c44a700 (LWP 27301)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f367eaf7257 in ?? () from /usr/lib/libmonoboehm-2.0.so.1
#2  0x00007f367eaeefa2 in ?? () from /usr/lib/libmonoboehm-2.0.so.1
#3  0x00007f367eaf59a4 in ?? () from /usr/lib/libmonoboehm-2.0.so.1
#4  0x00007f367e492182 in start_thread (arg=0x7f367c44a700) at pthread_create.c:312
#5  0x00007f3680e0847d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 3 (Thread 0x7f367bc49700 (LWP 27302)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f367eaf7257 in ?? () from /usr/lib/libmonoboehm-2.0.so.1
#2  0x00007f367eaeefa2 in ?? () from /usr/lib/libmonoboehm-2.0.so.1
#3  0x00007f367eaf59a4 in ?? () from /usr/lib/libmonoboehm-2.0.so.1
#4  0x00007f367e492182 in start_thread (arg=0x7f367bc49700) at pthread_create.c:312
#5  0x00007f3680e0847d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 2 (Thread 0x7f367b16e700 (LWP 27303)):
#0  sem_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:85
#1  0x00007f367ead3597 in mono_sem_wait () from /usr/lib/libmonoboehm-2.0.so.1
#2  0x00007f367ea82d87 in ?? () from /usr/lib/libmonoboehm-2.0.so.1
#3  0x00007f367ea63af5 in ?? () from /usr/lib/libmonoboehm-2.0.so.1
#4  0x00007f367eac736d in ?? () from /usr/lib/libmonoboehm-2.0.so.1
#5  0x00007f367ead8775 in ?? () from /usr/lib/libmonoboehm-2.0.so.1
#6  0x00007f367eaf6e98 in ?? () from /usr/lib/libmonoboehm-2.0.so.1
#7  0x00007f367e492182 in start_thread (arg=0x7f367b16e700) at pthread_create.c:312
#8  0x00007f3680e0847d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 1 (Thread 0x7f3681825740 (LWP 27297)):
#0  0x00007f3680dceb99 in __libc_waitpid (pid=0x6bf7, stat_loc=0x7f368183330c, options=0x0) at ../sysdeps/unix/sysv/linux/waitpid.c:40
#1  0x00007f367e97ecec in ?? () from /usr/lib/libmonoboehm-2.0.so.1
#2  0x00007f367e9db08b in ?? () from /usr/lib/libmonoboehm-2.0.so.1
#3  0x00007f367e8e8813 in ?? () from /usr/lib/libmonoboehm-2.0.so.1
#4  <signal handler called>
#5  0x00007f36813340f1 in putAtom () from /usr/local/lib/libYap.so.6.3
#6  0x00007f36813362f8 in writeTerm () from /usr/local/lib/libYap.so.6.3
#7  0x00007f3681338877 in Yap_plwrite () from /usr/local/lib/libYap.so.6.3
#8  0x00007f3681338b4f in Yap_TermToString () from /usr/local/lib/libYap.so.6.3
#9  0x00007f3681383236 in term_to_atom () from /usr/local/lib/libYap.so.6.3
#10 0x00007f3681130568 in Yap_absmi () from /usr/local/lib/libYap.so.6.3
#11 0x00007f3681348332 in run_emulator () from /usr/local/lib/libYap.so.6.3
#12 0x00007f3681348457 in YAP_EnterGoal () from /usr/local/lib/libYap.so.6.3
#13 0x00007f36813d3224 in PL_next_solution () from /usr/local/lib/libYap.so.6.3
#14 0x0000000041e07e57 in ?? ()
#15 0x00007fffc85eebf0 in ?? ()
#16 0x00007fffc85ee220 in ?? ()
#17 0x0000000001c17790 in ?? ()
#18 0x00007fffc85ee160 in ?? ()
#19 0x00007fffc85ee0d0 in ?? ()
#20 0x00007f367ac13758 in ?? ()
#21 0x0000000000000009 in ?? ()
#22 0x00007fffc85ee2e0 in ?? ()
#23 0x00007f367ac46180 in ?? ()
#24 0x0000000041e07d9c in ?? ()
#25 0x0000000001566ed0 in ?? ()
#26 0x0000000001c2b600 in ?? ()
#27 0x0000000000000000 in ?? ()

=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

rlwrap: warning: yap crashed, killed by SIGABRT (core dumped).
rlwrap itself has not crashed, but for transparency,
it will now kill itself with the same signal


warnings can be silenced by the --no-warnings (-n) option
Aborted (core dumped)
@TeamSPoon
Copy link
Member Author

root@gitlab:/devel/GITHUB/ECLIPSE-BUILD# gdbexec ./yap -g "use_module(library(swicli ))"
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 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-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"...
SIGINT is used by the debugger.
Are you sure you want to change it? (y or n) [answered Y; input not from terminal]
Reading symbols from ./yap...done.
Starting program: /devel/GITHUB/ECLIPSE-BUILD/yap -g use_module\(library\(swicli\ \)\)
% YAP 6.3.4-25aac782 (compiled  2016-02-22T17:09:48@gitlab)
 % reconsulting library(swicli)...
  % reconsulting library(lists)...
  % reconsulted /usr/local/share/Yap/lists.yap in module lists, 4 msec 0 bytes
  % reconsulting library(shlib)...
  % reconsulted /usr/local/share/Yap/shlib.pl in module shlib, 4 msec 0 bytes
  % reconsulting library(system)...
  % reconsulted /usr/local/share/Yap/system.yap in module operating_system_support, 3 msec 0 bytes
Unknown exception: error(style_check(style_check(discontiguous(file_search_path,2,user),709,/usr/local/share/Yap/swicli.pl,(file_search_path(gac,_164689):-swicli:expand_file_search_path(pack(swicli/bin),_164689),exists_directory(_164689)))),warning)
Setting: 'MONO_PATH'='/usr/lib/mono/4.5'.
Setting: 'LD_LIBRARY_PATH'='/usr/local/lib/Yap:/usr/lib/mono/4.5:.'.
'PATH'='/usr/local/apache-maven/apache-maven-3.1.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games'.
'MONO_PATH'='/usr/lib/mono/4.5:./.:/usr/local/lib/Yap/.'.
'LD_LIBRARY_PATH'='/usr/local/lib/Yap:/usr/lib/mono/4.5:.:./.:/usr/local/lib/Yap/.'.
'PATH'='/usr/local/apache-maven/apache-maven-3.1.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:./.:/usr/local/lib/Yap/.'.
Warning: couldn't activate thread debugging using libthread_db: Cannot find new threads: generic error
warning: File "/lib/x86_64-linux-gnu/libthread_db-1.0.so" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
        add-auto-load-safe-path /lib/x86_64-linux-gnu/libthread_db-1.0.so
line to your configuration file "/root/.gdbinit".
To completely disable this security protection add
        set auto-load safe-path /
line to your configuration file "/root/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
        info "(gdb)Auto-loading safe path"
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
SetupProlog
RC file missing from .
[New LWP 14733]

Program received signal SIGPWR, Power fail/restart.
[Switching to LWP 14733]
-----------------------------------------------------------------------------------------------------------------------[regs]
  RAX: 0xFFFFFFFFFFFFFE00  RBX: 0x00007FFFF7FB7CC0  RBP: 0x00007FFFF55C5760  RSP: 0x00007FFFF1905D50  o d I t s Z a P c
  RDI: 0x00007FFFF55C5760  RSI: 0x0000000000000080  RDX: 0x0000000000000000  RCX: 0xFFFFFFFFFFFFFFFF  RIP: 0x00007FFFF4C30680
  R8 : 0x0000000000000000  R9 : 0x0000000000A50690  R10: 0x0000000000000000  R11: 0x0000000000000246  R12: 0x0000000000000001
  R13: 0x0000000000000000  R14: 0x0000000000000000  R15: 0x0000000000000000
  CS: 0033  DS: 0000  ES: 0000  FS: 0000  GS: 0000  SS: 002B
-----------------------------------------------------------------------------------------------------------------------[code]
=> 0x7ffff4c30680 <sem_wait+48>:        mov    rcx,rax
   0x7ffff4c30683 <sem_wait+51>:        xchg   rdi,r8
   0x7ffff4c30686 <sem_wait+54>:        call   0x7ffff4c30e80 <__pthread_disable_asynccancel>
   0x7ffff4c3068b <sem_wait+59>:        mov    rdi,r8
   0x7ffff4c3068e <sem_wait+62>:        test   rcx,rcx
   0x7ffff4c30691 <sem_wait+65>:        je     0x7ffff4c30699 <sem_wait+73>
   0x7ffff4c30693 <sem_wait+67>:        cmp    rcx,0xfffffffffffffff5
   0x7ffff4c30697 <sem_wait+71>:        jne    0x7ffff4c306b6 <sem_wait+102>
-----------------------------------------------------------------------------------------------------------------------------
sem_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:85
85      ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S: No such file or directory.
gdb$ bt
#0  sem_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:85
#1  0x00007ffff526b597 in mono_sem_wait () from /usr/lib/libmonoboehm-2.0.so.1
#2  0x00007ffff521ad87 in ?? () from /usr/lib/libmonoboehm-2.0.so.1
#3  0x00007ffff51fbaf5 in ?? () from /usr/lib/libmonoboehm-2.0.so.1
#4  0x00007ffff525f36d in ?? () from /usr/lib/libmonoboehm-2.0.so.1
#5  0x00007ffff5270775 in ?? () from /usr/lib/libmonoboehm-2.0.so.1
#6  0x00007ffff528ee98 in ?? () from /usr/lib/libmonoboehm-2.0.so.1
#7  0x00007ffff4c2a182 in start_thread (arg=0x7ffff1906700) at pthread_create.c:312
#8  0x00007ffff75a047d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Oh these are not meaningful when debugging MONO one does...

handle SIGPWR nostop
handle SIGXCPU nostop

Since mono uses the system signals to do internal things

gdb$ handle SIGPWR nostop
Signal        Stop      Print   Pass to program Description
SIGPWR        No        Yes     Yes             Power fail/restart
gdb$ handle SIhandle SIGXCPU nostop
Signal        Stop      Print   Pass to program Description
SIGXCPU       No        Yes     Yes             CPU time limit exceeded

Here go...

gdb$ c
Continuing.

Program received signal SIGXCPU, CPU time limit exceeded.
Not installing ThreadExit hook to System.Windows.Forms.Application

Program received signal SIGPWR, Power fail/restart.

Program received signal SIGXCPU, CPU time limit exceeded.

Program received signal SIGPWR, Power fail/restart.

Program received signal SIGXCPU, CPU time limit exceeded.

Program received signal SIGPWR, Power fail/restart.

Program received signal SIGXCPU, CPU time limit exceeded.

Program received signal SIGPWR, Power fail/restart.

Program received signal SIGXCPU, CPU time limit exceeded.
Swicli.Library.Embedded.install suceeded

Program received signal SIGPWR, Power fail/restart.

Program received signal SIGXCPU, CPU time limit exceeded.
Swicli.Library.Embedded.install suceeded
% Break (level 1)
[swicli]

Good! (we are in break/0 btw.. just so I dont need to worry about export yet

Break (level 1) ?- cli_call('System.Threading.ThreadPool','GetAvailableThreads'(X,Y),_).

Here we go...

Program received signal SIGSEGV, Segmentation fault.
[Switching to LWP 14724]
-----------------------------------------------------------------------------------------------------------------------[regs]
  RAX: 0x0000000000000000  RBX: 0x0000000000666440  RBP: 0x00007FFFFFFEBEC0  RSP: 0x00007FFFFFFEBE10  o d I t s z a p c
  RDI: 0x0000000000000000  RSI: 0x0000000000000001  RDX: 0x00007FFFFFFEC370  RCX: 0x0000000000000000  RIP: 0x00007FFFF7AD4B87
  R8 : 0x00007FFFFFFEC370  R9 : 0x00007FFFFFFEC350  R10: 0x00007FFFF78647B8  R11: 0x00007FFFF7864701  R12: 0x00007FFFF5B4A640
  R13: 0x00007FFFF6207520  R14: 0x00000000006DBBE0  R15: 0x0000000000CF6DD0
  CS: 0033  DS: 0000  ES: 0000  FS: 0000  GS: 0000  SS: 002B
-----------------------------------------------------------------------------------------------------------------------[code]
=> 0x7ffff7ad4b87 <putAtom+68>: mov    rax,QWORD PTR [rax+0x8]
   0x7ffff7ad4b8b <putAtom+72>: test   rax,rax
   0x7ffff7ad4b8e <putAtom+75>: je     0x7ffff7ad4bc8 <putAtom+133>
   0x7ffff7ad4b90 <putAtom+77>: mov    rax,QWORD PTR [rbp-0x38]
   0x7ffff7ad4b94 <putAtom+81>: mov    QWORD PTR [rbp-0x28],rax
   0x7ffff7ad4b98 <putAtom+85>: mov    rax,QWORD PTR [rbp-0x28]
   0x7ffff7ad4b9c <putAtom+89>: mov    rax,QWORD PTR [rax+0x8]
   0x7ffff7ad4ba0 <putAtom+93>: mov    QWORD PTR [rbp-0x20],rax
-----------------------------------------------------------------------------------------------------------------------------
IsBlob (at=0x0) at /devel/GITHUB/YAP6/H/Yatom.h:1273
1273      return RepAtom(at)->PropsOfAE &&
gdb$ bt

Hrrm next s the error..



#0  IsBlob (at=0x0) at /devel/GITHUB/YAP6/H/Yatom.h:1273
#1  putAtom (atom=0x0, Quote_illegal=0x1, wglb=0x7ffffffec370) at /devel/GITHUB/YAP6/C/write.c:589
#2  0x00007ffff7ad6d8e in writeTerm (t=0x1, p=0x4b0, depth=0x1, rinfixarg=0x0, wglb=0x7ffffffec370, rwt=0x7ffffffec350) at /devel/GITHUB/YAP6/C/write.c:913
#3  0x00007ffff7ad930d in Yap_plwrite (t=0x1, mywrite=0x682720, max_depth=0x0, flags=0x5, priority=0x4b0) at /devel/GITHUB/YAP6/C/write.c:1260
#4  0x00007ffff7ad95e5 in Yap_TermToString (t=0x1, s=0x0, sz=0x0, length=0x7ffffffec420, encp=0x0, flags=0x5) at /devel/GITHUB/YAP6/C/write.c:1291
#5  0x00007ffff7b23e86 in term_to_atom () at /devel/GITHUB/YAP6/os/readterm.c:1364
#6  0x00007ffff78cbe4d in Yap_absmi (inp=0x0) at /devel/GITHUB/YAP6/C/fli_absmi_insts.h:55
#7  0x00007ffff7ae8e28 in run_emulator () at /devel/GITHUB/YAP6/C/c_interface.c:1683
#8  0x00007ffff7ae8f4d in YAP_EnterGoal (pe=0x666340, ptr=0xa, dgi=0xcf6ec8) at /devel/GITHUB/YAP6/C/c_interface.c:1705
#9  0x00007ffff11b7204 in PL_next_solution () from /usr/local/lib/libYap.so
#10 0x0000000040033527 in ?? ()
#11 0x00007fffffff4e80 in ?? ()
#12 0x00007fffffff44b0 in ?? ()
#13 0x0000000000ce2660 in ?? ()
#14 0x00007fffffff43f0 in ?? ()
#15 0x00007fffffff4360 in ?? ()
#16 0x00007ffff0e49ac8 in ?? ()
#17 0x0000000000000009 in ?? ()
#18 0x00007fffffff4570 in ?? ()
#19 0x00007ffff0ea3180 in ?? ()
#20 0x000000004003346c in ?? ()
#21 0x0000000000666340 in ?? ()
#22 0x0000000000cf6dd0 in ?? ()
#23 0x0000000000000000 in ?? ()
gdb$ c

Letting it self destruct to see what i was up to in MONO...

Oh i was calling

?- term_to_atom(Var,'666'). % since PL_chars_to_term was not exported

Continuing.
Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) SbsSW.SwiPlCs.SafeNativeMethods.PL_next_solution (uint) <0xffffffff>
  at SbsSW.SwiPlCs.libpl.PL_next_solution (uint) <0x0001b>
  at SbsSW.SwiPlCs.PlQuery.NextSolution () <0x00023>
  at SbsSW.SwiPlCs.PlQuery.PlCall (string,string,SbsSW.SwiPlCs.PlTermV) <0x0004f>
  at Swicli.Library.PrologCLR.PlCall (string,string,SbsSW.SwiPlCs.PlTermV) <0x00077>
  at SbsSW.SwiPlCs.libpl.PL_chars_to_term (string,uint) <0x000af>
  at SbsSW.SwiPlCs.PlTerm..ctor (string) <0x0002f>
  at SbsSW.SwiPlCs.Exceptions.PlTypeException..ctor (string,SbsSW.SwiPlCs.PlTerm) <0x00097>
  at SbsSW.SwiPlCs.PlTerm.CastToString0 (uint) <0x000d3>
  at SbsSW.SwiPlCs.PlTerm.CastToString (uint) <0x00023>
  at SbsSW.SwiPlCs.PlTerm.op_Explicit (SbsSW.SwiPlCs.PlTerm) <0x00033>
  at SbsSW.SwiPlCs.PlTerm.ToString () <0x0003b>
  at SbsSW.SwiPlCs.PlTerm.ToStringAsListFormat () <0x000c3>
  at SbsSW.SwiPlCs.PlTerm.ToString () <0x00023>
  at string.Concat (object,object) <0x00040>
  at Swicli.Library.PrologCLR.GetType (SbsSW.SwiPlCs.PlTerm,bool) <0x00c3b>
  at Swicli.Library.PrologCLR.GetParamSpec (SbsSW.SwiPlCs.PlTerm[],bool,int,int) <0x000ab>
  at Swicli.Library.PrologCLR.GetParamSpec (SbsSW.SwiPlCs.PlTerm[],bool) <0x00027>
  at Swicli.Library.PrologCLR.GetParamSpecFromObjects (SbsSW.SwiPlCs.PlTerm[]) <0x00037>
  at Swicli.Library.PrologCLR.cliCallRawForVar (SbsSW.SwiPlCs.PlTerm,SbsSW.SwiPlCs.PlTerm,SbsSW.SwiPlCs.PlTerm,SbsSW.SwiPlCs.PlTerm,System.Type) <0x00197>
  at Swicli.Library.PrologCLR.cliCallRaw (SbsSW.SwiPlCs.PlTerm,SbsSW.SwiPlCs.PlTerm,SbsSW.SwiPlCs.PlTerm,SbsSW.SwiPlCs.PlTerm) <0x000df>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_bool_PlTerm_PlTerm_PlTerm_PlTerm (object,intptr,intptr,intptr) <0xffffffff>
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) <0xffffffff>
  at System.Reflection.MonoMethod.Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) <0x000d7>
  at System.Reflection.MethodBase.Invoke (object,object[]) <0x00032>
  at Swicli.Library.PrologCLR.InvokeCaught0 (System.Reflection.MethodInfo,object,object[],System.Action) <0x004cf>
  at Swicli.Library.PrologCLR.InvokeCaughtB (System.Reflection.MethodInfo,object,object[]) <0x0007f>
  at Swicli.Library.PrologCLR/<InternMethod>c__AnonStorey8.<>m__4 (SbsSW.SwiPlCs.PlTerm,SbsSW.SwiPlCs.PlTerm,SbsSW.SwiPlCs.PlTerm,SbsSW.SwiPlCs.PlTerm) <0x00143>
  at (wrapper native-to-managed) Swicli.Library.PrologCLR/<InternMethod>c__AnonStorey8.<>m__4 (SbsSW.SwiPlCs.PlTerm,SbsSW.SwiPlCs.PlTerm,SbsSW.SwiPlCs.PlTerm,SbsSW.SwiPlCs.PlTerm) <0xffffffff>

Native stacktrace:

        /usr/lib/libmonoboehm-2.0.so.1(+0xcec62) [0x7ffff5116c62]
        /usr/lib/libmonoboehm-2.0.so.1(+0x12b08b) [0x7ffff517308b]
        /usr/lib/libmonoboehm-2.0.so.1(+0x38813) [0x7ffff5080813]
        /lib/x86_64-linux-gnu/libc.so.6(+0x36d40) [0x7ffff74dcd40]
        /devel/GITHUB/ECLIPSE-BUILD/libYap.so.6.3(+0x269b87) [0x7ffff7ad4b87]
        /devel/GITHUB/ECLIPSE-BUILD/libYap.so.6.3(+0x26bd8e) [0x7ffff7ad6d8e]
        /devel/GITHUB/ECLIPSE-BUILD/libYap.so.6.3(Yap_plwrite+0x14f) [0x7ffff7ad930d]
        /devel/GITHUB/ECLIPSE-BUILD/libYap.so.6.3(Yap_TermToString+0x125) [0x7ffff7ad95e5]
        /devel/GITHUB/ECLIPSE-BUILD/libYap.so.6.3(+0x2b8e86) [0x7ffff7b23e86]
        /devel/GITHUB/ECLIPSE-BUILD/libYap.so.6.3(Yap_absmi+0x29487) [0x7ffff78cbe4d]
        /devel/GITHUB/ECLIPSE-BUILD/libYap.so.6.3(+0x27de28) [0x7ffff7ae8e28]
        /devel/GITHUB/ECLIPSE-BUILD/libYap.so.6.3(YAP_EnterGoal+0xfb) [0x7ffff7ae8f4d]
        /usr/local/lib/libYap.so(PL_next_solution+0x7a) [0x7ffff11b7204]
        [0x40033527]

Debug info from gdb:

SIGINT is used by the debugger.
Are you sure you want to change it? (y or n) [answered Y; input not from terminal]
Could not attach to process.  If your uid matches the uid of the target
process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
again as the root user.  For more details, see /etc/sysctl.d/10-ptrace.conf
warning: process 14724 is already traced by process 14722
ptrace: Operation not permitted.
No threads.

=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant