dbTalk Databases Forums  

Segmentation fault->Result res = query.store();

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss Segmentation fault->Result res = query.store(); in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Marco Turchi
 
Posts: n/a

Default Segmentation fault->Result res = query.store(); - 03-09-2005 , 01:44 PM






hi,
I'm tying to run the simple1.cc example, I can connect to the database,
but I have segmentation fault.
I've compiled the mysql++-1.7.31.tar.gz <releases/mysql++-1.7.31.tar.gz>
source library on this system:
gcc 3.2.3
mysql server 4.0.22
Red hat enterprise 2.4.21
All is ok.
But when I run the example, I obtain "segmentation fault" at the
following line:
Result res = query.store();

Please, can you tell me how to solve this problem?
thank you
Marco




--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw


Reply With Quote
  #2  
Old   
Marco Turchi
 
Posts: n/a

Default Re: Segmentation fault->Result res = query.store(); - 03-09-2005 , 02:26 PM







Quote:
Did you run resetdb first?
no... I'm running only the simple1.cc.

Quote:
Are you running the version built as part of the normal library build
process, or are you building it some other way!
my goal is to embed the basic commands in my software, but before I'd
like to run and understand how these commands work.
So I take the simple1.cc and compile it stand alone.
I've built using the following gcc comand:
g++ -I/usr/include/mysql++ -I/usr/local/mysql/include/mysql
-DVERBOSE=2 -Wall -pthread -g -O2 -c simple1.cc
g++ -I/usr/include/mysql++ -I/usr/local/mysql/include/mysql
-DVERBOSE=2 -Wall -pthread -g -O2 -c util.cc -o util.o
g++ -pthread -g -O2 -L/usr/lib/mysql util.o simple1.o
/usr/local/lib/libmysqlpp.so -lz /usr/lib/mysql/libmysqlclient_r.a
-lcrypt -lnsl -lm -lpthread -lc -lnss_files -lnss_dns -lresolv
/usr/lib/libefence.a -Wl,--rpath -Wl,/usr/local/lib -Wl,--rpath
-Wl,/usr/local/lib -o simple1


thank you
MArco




--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #3  
Old   
Marco Turchi
 
Posts: n/a

Default Re: Segmentation fault->Result res = query.store(); - 03-09-2005 , 02:43 PM



I've forgotten to say, that
1)I've created a database in mysql using mysql line commands
2)I've filled this database
3)I've changed the name of database inside util.cc.
thank you
Marco

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw


Reply With Quote
  #4  
Old   
Warren Young
 
Posts: n/a

Default Re: Segmentation fault->Result res = query.store(); - 03-09-2005 , 02:51 PM



Marco Turchi wrote:

Quote:
Did you run resetdb first?

no... I'm running only the simple1.cc.
You must run resetdb first, as explained in examples/README. If you
don't run it first, simple1 has no data to operate on.

No doubt it could fail in a more graceful manner, but when you go and
ignore the short README file we've prepared I can't say I have much
sympathy.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #5  
Old   
Warren Young
 
Posts: n/a

Default Re: Segmentation fault->Result res = query.store(); - 03-09-2005 , 02:51 PM



Marco Turchi wrote:

Quote:
I've forgotten to say, that
1)I've created a database in mysql using mysql line commands
2)I've filled this database
3)I've changed the name of database inside util.cc.
Get the examples working first, then branch out into your own project.
It's easier to help you if you're using a data set and programs that
we're familiar with.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #6  
Old   
Marco Turchi
 
Posts: n/a

Default Re: Segmentation fault->Result res = query.store(); - 03-09-2005 , 03:19 PM




Quote:
Get the examples working first, then branch out into your own project.
It's easier to help you if you're using a data set and programs that
we're familiar with.
perfect... I've ran the example resetdb in the following way:
../resetdb host user psw
but I obtain:
Bad argument count: 0!
Segmentation fault

It seems that resetdb can not pass the argc and argv to connect_to_db
method.

Marco

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #7  
Old   
Chris Frey
 
Posts: n/a

Default Re: Segmentation fault->Result res = query.store(); - 03-09-2005 , 04:21 PM



On Wed, Mar 09, 2005 at 11:43:48AM -0800, Marco Turchi wrote:
Quote:
hi,
I'm tying to run the simple1.cc example, I can connect to the database,
but I have segmentation fault.
I've compiled the mysql++-1.7.31.tar.gz <releases/mysql++-1.7.31.tar.gz
source library on this system:
gcc 3.2.3
mysql server 4.0.22
Red hat enterprise 2.4.21
All is ok.
But when I run the example, I obtain "segmentation fault" at the
following line:
Result res = query.store();

Please, can you tell me how to solve this problem?
Could you post a backtrace of the core dump? Also, just to be certain,
make sure that there are no other mysqlpp libs. (check
'ldd lib/.libs/resetdb' and see where it's getting the libraries.

- Chris


--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #8  
Old   
Warren Young
 
Posts: n/a

Default Re: Segmentation fault->Result res = query.store(); - 03-09-2005 , 04:51 PM



Chris Frey wrote:

Quote:
'ldd lib/.libs/resetdb'
ldd examples/.libs/resetdb

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #9  
Old   
Marco Turchi
 
Posts: n/a

Default Re: Segmentation fault->Result res = query.store(); - 03-09-2005 , 06:43 PM




Quote:
ldd examples/.libs/resetdb

I obtain
ldd .libs/resetdb
libmysqlpp.so.4 => /usr/local/lib/libmysqlpp.so.4 (0x00829000)
libz.so.1 => /usr/lib/libz.so.1 (0x00f89000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0x003c1000)
libnsl.so.1 => /lib/libnsl.so.1 (0x00275000)
libpthread.so.0 => /lib/i686/libpthread.so.0 (0x0099e000)
libnss_files.so.2 => /lib/libnss_files.so.2 (0x00bec000)
libnss_dns.so.2 => /lib/libnss_dns.so.2 (0x00111000)
libresolv.so.2 => /lib/libresolv.so.2 (0x00ef2000)
libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x0061a000)
libm.so.6 => /lib/i686/libm.so.6 (0x00116000)
libc.so.6 => /lib/i686/libc.so.6 (0x00a70000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00cdb000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00502000)


--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #10  
Old   
Chris Frey
 
Posts: n/a

Default Re: Segmentation fault->Result res = query.store(); - 03-09-2005 , 06:56 PM



On Wed, Mar 09, 2005 at 04:43:19PM -0800, Marco Turchi wrote:
Quote:
ldd examples/.libs/resetdb

I obtain
ldd .libs/resetdb
libmysqlpp.so.4 => /usr/local/lib/libmysqlpp.so.4 (0x00829000)
Do you have a backtrace? If using bash:

export LD_LIBRARY_PATH=/path/to/mysql++/tarball/lib/.libs
ulimit -c unlimited
examples/.libs/resetdb
gdb examples/.libs/resetdb core
Quote:
bt
- Chris


--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.