DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Packages and Ports

OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   (View Single Post)  
Old 9th June 2008
gor gor is offline
New User
 
Join Date: Jun 2008
Posts: 3
Thanked 0 Times in 0 Posts
Default MySQL C library - segmentation fault on mysql_select_db() when using CC optimisation

Hello,

I have segmentation fault while trying to execute a binary that uses MySQL C API. An error occurs every time mysql_select_db() is called. The output says:
Code:
in free(): error: free_pages: pointer to wrong page
Abort trap (core dumped)
After hours of debugging, i've discovered that -O compiler flag causes that error to come. If compiled without -O flag - everything works like a charm. e.g. (compiler options from Makefile):
Code:
COPT=-I /usr/local/include/mysql -L /usr/local/lib/mysql -O
Binary crashes with segfault

Code:
COPT=-I /usr/local/include/mysql -L /usr/local/lib/mysql
Binary works fine

I am not sure whether the problem is caused by MySQL C API bug or error in cc (or maybe error in programmer )

The OS is OpenBSD 4.2 GENERIC.MP amd64

Thank you for suggestions.
Regards.
Reply With Quote
 

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

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Segmentation fault error139 delboy FreeBSD Ports and Packages 8 9th July 2009 06:32 PM
MYSQL 's fault? disappearedng FreeBSD General 3 14th October 2008 11:53 PM
What include and shared library directories are searched by gcc kasse FreeBSD General 3 16th July 2008 08:44 PM
Segmentation fault (11) - Apache ijk FreeBSD Ports and Packages 16 15th July 2008 11:04 AM
Segmentation fault ccc FreeBSD General 8 28th June 2008 02:15 PM


All times are GMT. The time now is 09:09 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick