0

I'm having an issue and I'm not sure how much background info I should include so I'm sorry if a lot of this isn't necessary information.

I'm trying to run the following project from https://github.com/ojwalch/district_mbo

and I'm just starting out and trying to compile the C-code from terminal. For python I am using Anaconda which has python 3.6.10 installed and I downloaded msys64 separately in order to use the CC compiler from the cmd window. I'm using windows 10.

I cloned the repository to my home directory and downloaded and extracted vlfeat into that directory since I'm really only using it for this program. I added

C:\Users\ME

C:\Users\ME\district_mbo\vlfeat-0.9.21

C:\msys64\usr\bin

C:\msys64\mingw64\bin

to my PATH variables.

I used the following line in cmd prompt:

cc -O3 -g -Wall -o district_mbo district_mbo.c -Ivlfeat-0.9.21 -lvl -Lvlfeat-0.9.21/bin/win64

and it seemed the compile successfully, but I noticed that only a single district_mbo.exe file was produced. From what I've read, the -g option should produce a debugger version of the exe. Moreover, when I attempt to run the .exe since the C-code produces some vital files that the Python code requires, I get the error

0 [main] district_mbo 1671 cygwin_exception::open_stackdumpfile: Dumping stack trace to district_mbo.exe.stackdump

I'm not sure of the cause of this issue. The C-code is very long so I do admit that I did not pour through it to see if there were any glaring errors, but from other posts I've read, this could have to do with me using Msys64 while having anaconda installed.

I'll appreciate any help and thank you in advanced. Please let me know if there is any further information needed from me.

Edit1: Taking the advice of matzeri, I read through the stackdump which said:

Exception: STATUS_ACCESS_VIOLATION at rip=001801A070A
rax=000000018020EEE0 rbx=7463697274736964 rcx=00000000FFFFD680
rdx=7463697274736964 rsi=000000000000000A rdi=7463697274736964
r8 =0000000000000000 r9 =000000000000000A r10=7463697274736964
r11=00000001004071C8 r12=00000000FFFFD680 r13=00000000FFFFCC90
r14=7463697274736964 r15=000000018020EEE0
rbp=0000000000000000 rsp=00000000FFFFC8C0
program=C:\Users\Edwin\district_mbo\district_mbo.exe, pid 1671, thread main
cs=0033 ds=002B es=002B fs=0053 gs=002B ss=002B
Stack trace:
Frame        Function    Args
00000000000  001801A070A (0018015AED1, 00000000000, 000FFFFCA20, 0018020EEE0)
000FFFFCA20  001801A0955 (1D60891556B1A02, 00000000002, 0018020E780, 000FFFFCC80)
000FFFFCA20  00180188081 (00000000000, 00100000000, 000000000F8, 0000010000E)
000FFFFCA20  001004071E4 (0018004A6F8, 0000000000D, 00180049B32, 001802F59E0)
000FFFFCCE0  0018004A764 (00000000000, 00000000000, 00000000000, 00000000000)
000FFFFFFF0  001800482C6 (00000000000, 00000000000, 00000000000, 00000000000)
000FFFFFFF0  00180048374 (00000000000, 00000000000, 00000000000, 00000000000)
End of stack trace

Then I ran the line addr2line.exe -a 00180048374 -a 001800482C6 -a 0018004A764 -a 001004071E4 -a 00180188081 -a 001801A0955 -a 001801A070A -e /usr/bin/msys-2.0.dll

to see

0x0000000180048374
/msys_scripts/msys2-runtime/src/msys2-runtime/winsup/cygwin/exception.h:156
0x00000001800482c6
/msys_scripts/msys2-runtime/src/msys2-runtime/winsup/cygwin/cygtls.cc:108
0x000000018004a764
/msys_scripts/msys2-runtime/src/msys2-runtime/winsup/cygwin/dcrt0.cc:1035
0x00000001004071e4
??:0
0x0000000180188081
/msys_scripts/msys2-runtime/src/msys2-runtime/newlib/libc/stdlib/atoi.c:53
0x00000001801a0955
/msys_scripts/msys2-runtime/src/msys2-runtime/newlib/libc/stdlib/strtol.c:238
0x00000001801a070a
/msys_scripts/msys2-runtime/src/msys2-runtime/newlib/libc/stdlib/strtol.c:149

Then running

C:\Users\Edwin\district_mbo>ldd district_mbo

it produced

        ntdll.dll => /c/WINDOWS/SYSTEM32/ntdll.dll (0x7ffa24b20000)
        KERNEL32.DLL => /c/WINDOWS/System32/KERNEL32.DLL (0x7ffa23900000)
        KERNELBASE.dll => /c/WINDOWS/System32/KERNELBASE.dll (0x7ffa21ab0000)
        msys-2.0.dll => /usr/bin/msys-2.0.dll (0x180040000)

Since the addresses of the stackdump exceed the address of msys-2.0.dll, I take this to mean that the exception did not occur in the program itself. From here, I'm not so sure how to proceed.

Edit2: Removed cygwin tag.

YLP
  • 25
  • 5
  • look at the stackdump file for hint. This is for `Cygwin` https://stackoverflow.com/questions/37628530/how-to-debug-using-stackdump-file-in-cygwin but you can adampt for `Msys` – matzeri Apr 02 '20 at 03:13
  • Not a cygwn issue. Please remove the Cygwin tag. – Doug Henderson Apr 02 '20 at 10:00

0 Answers0