hello maple

5 Reputation

0 Badges

7 years, 18 days

MaplePrimes Activity


These are questions asked by hello maple

I use Maple18 on unix 64. I have the MAPLE and the LD_LIBRARY_PATH properly set up to use OpenMaple. When I link my code to OpenMaple library I get segmentation fault when I try to debug using gdb. In order to isolate the problem, I created a simple temp.cc file that contains the following:

 

#include <string>

#include <stdio.h>

 

int main()

{

int x = 10;

std::string abc;

abc = "testString";

printf("this is it %s\n", abc.c_str());

}

 

When I compile the code using g++ -g -o temp temp.cc I can run ./temp and step into the code using gdb with no problems.

 

If I link to Maple Library g++ -g -o temp temp.cc -L/opt/maple18/bin.X86_64_LINUX –lmaplec

 

I can run the code ./temp but I can not step into it using gdb. I get the error as shown below when I try to step over std::string abc.

 

//-----------------------------------------------------

 

GNU gdb (GDB) 7.8

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-unknown-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 temp...done.

(gdb) b main

Breakpoint 1 at 0x40091f: file temp.cc, line 6.

(gdb) r

Starting program: xxxxxxxxxxxxxxxxxxxxxxxxxxx

[Thread debugging using libthread_db enabled]

Using host libthread_db library "/lib/libthread_db.so.1".

 

Breakpoint 1, main () at temp.cc:6

6         int x = 10;

(gdb) n

7       std::string abc;

(gdb) n

BFD: reopening /tmp/xf-dll/xf-1274259bc6684076beea8652f625b03bf2133.tmp: No such file or directory

 

BFD: reopening /tmp/xf-dll/xf-1274259bc6684076beea8652f625b03bf2133.tmp: No such file or directory

 

BFD: reopening /tmp/xf-dll/xf-1274259bc6684076beea8652f625b03bf2133.tmp: No such file or directory

 

Can't read data for section '.eh_frame' in file '/tmp/xf-dll/xf-1274259bc6684076beea8652f625b03bf2133.tmp'

0x00000000004007a8 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string()@plt

    ()

(gdb) n

Single stepping until exit from function _ZNSsC1Ev@plt,

which has no line number information.

Segmentation fault

Page 1 of 1