Issues setting up GCC and GDB with Activestate

Posted by redblue on 2017-02-17 04:07

Hi,

I am having issues configuring GCC/GDB with Activestate perl (v5.22.3 built for MSWin32-x64-multi-thread). Installing the toolchain works well (ppm install mingw) and I can build the module (perl, XS, C) in question, but it crashes at runtime. The same module compiles and runs under strawberry perl and doesn't crash. I am trying to track down the cause of the crash, but I can't get GDB to produce any decent output:

(gdb) bt
#0  0x000000006865b3a8 in ?? ()
#1  0x0000000000725db9 in ?? ()
#2  0x0000000000725d08 in ?? ()
#3  0xffffffffffffffff in ?? ()
#4  0x000000006599b358 in ?? ()
#5  0x000000000225f1a0 in ?? ()
#6  0x0000000000000000 in ?? ()
(gdb)

I've created a sample script that will always crash, and adding the -g works under strawberry perl (ie, stack trace with the line of code casing the crash) but I can't get GDB under activestate working at all. Any idea's how I can set up gcc/gdb so I can use activestate perl?

Regards,

grahams
ActiveState Staff
Fri, 2017-02-17 10:55

If you install the toolchain via PPM, you get a customized version that has been tweaked to simplify compiling modules for ActivePerl. You do not get a full featured compiler suite.

To get a working GDB on Windows, you would need to install the standard version of MinGW, instead of the PPM version. If you need to have both a standard MinGW and the PPM version, make sure you set them up so they don't interfere with each other.

This forum isn't a support venue for GDB usage, but do you really need GDB? Perl errors are often enough to point to the problem. If I knew which module you were building, I might be able to spot what's different for that module between ActivePerl and Strawberry.

redblue | Fri, 2017-02-17 12:06

Thanks for the response. The module is member of the Win32::GUI family and the crash is deep in the guts, so need to use GDB to work out exactly were it is failing:)

What version of MinGW does activestate (x64) use for development/deployment? I had assumed that I would have needed to use the same version as you guys. So, could I use the latest version of MinGW for example?

grahams
ActiveState Staff
Mon, 2017-02-20 12:19

Strawberry used GCC 4.9.2 and you might have tried the USE_LONG_DOUBLE version which we don't duplicate
http://strawberryperl.com/release-notes/5.22.3.1-64bit.html
List of external tools and libraries included in Strawberry Perl:
List of distributions installed on top of Perl 5.22.3:
That list might also help identify if they shipped an external library, or precompiled a dependency, in order to avoid the issue you hit.

We used GCC 4.6.3, and uselongdouble=undef