Bug 65630 - CRASH - opening mysql table using native mysql C connector causes LO to crash
Summary: CRASH - opening mysql table using native mysql C connector causes LO to crash
Status: CLOSED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
4.0.2.2 release
Hardware: x86-64 (AMD64) macOS (All)
: high major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2013-06-11 05:44 UTC by Alex Thurgood
Modified: 2014-09-17 17:34 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
apple crash trace 20130611 (68.75 KB, text/plain)
2013-06-11 05:48 UTC, Alex Thurgood
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Thurgood 2013-06-11 05:44:59 UTC
For some reason, as yet unknown, the following mysql table causes LO to crash when it is opened (double click) or previewed in the "Document preview" mode.

LO is configured to access the database via the native mysql C connector. All other tables in the database can be opened or previewed without crashing.

This occurs in 4.0.2.2 production release and my master 4.2 build.

It is a regression over LO 3.3.4, OOo 3.2.1, and OOo 3.3.0 which use corresponding earlier versions of the connector (1.0.0 for OOo 3.2.1, and 1.0.1 for OOo 3.3.0, and LO 3.3.4). In these versions, I can access the table in Document Preview or direct open and there is no crash, all data is displayed.

The table definition is as follows :

CREATE TABLE `old_oldfmpro` (
  `Agent` varchar(254) DEFAULT NULL,
  `Ann_Fees1` date DEFAULT '0000-00-00',
  `Ann_Fees` varchar(254) DEFAULT NULL,
  `Attention` varchar(254) DEFAULT NULL,
  `Client` varchar(254) DEFAULT NULL,
  `Client_Copy` varchar(254) DEFAULT NULL,
  `Code` varchar(254) DEFAULT NULL,
  `Comments` varchar(254) DEFAULT NULL,
  `Ctry_Short` varchar(254) DEFAULT NULL,
  `Prio_Ctry` varchar(254) DEFAULT NULL,
  `Prio_Ctry1` char(2) DEFAULT '',
  `Prio_Ctry2` char(2) DEFAULT '',
  `Prio_Ctry3` char(2) DEFAULT '',
  `Prio_Ctry4` char(2) DEFAULT '',
  `Prio_Ctry5` char(2) DEFAULT '',
  `Prio_Ctry6` char(2) DEFAULT '',
  `Ctry_List` varchar(254) DEFAULT NULL,
  `Docket_Num` varchar(254) DEFAULT NULL,
  `Earliest_Date` varchar(254) DEFAULT NULL,
  `Earliest_Date1` date DEFAULT '0000-00-00',
  `Exp_Date` varchar(254) DEFAULT NULL,
  `Exp_Date1` date DEFAULT '0000-00-00',
  `File_Code` varchar(254) DEFAULT NULL,
  `File_Code_Copy` varchar(254) DEFAULT NULL,
  `File_Num` varchar(254) DEFAULT NULL,
  `Filing_Num` varchar(254) DEFAULT NULL,
  `Filing_Date1` date DEFAULT '0000-00-00',
  `Filing_Date` varchar(254) DEFAULT NULL,
  `Grant_Num` varchar(254) DEFAULT NULL,
  `Grant_Date` varchar(254) DEFAULT NULL,
  `Grant_Date1` date DEFAULT '0000-00-00',
  `Inventors` varchar(254) DEFAULT NULL,
  `Inventor1` varchar(50) DEFAULT '',
  `Inventor2` varchar(50) DEFAULT '',
  `Inventor3` varchar(50) DEFAULT '',
  `Inventor4` varchar(50) DEFAULT NULL,
  `Inventor5` varchar(50) DEFAULT '',
  `Inventor6` varchar(50) DEFAULT '',
  `Inventor7` varchar(50) DEFAULT '',
  `Inventor8` varchar(50) DEFAULT '',
  `Inventor9` varchar(50) DEFAULT '',
  `Inventor10` varchar(50) DEFAULT '',
  `Keywords` varchar(254) DEFAULT NULL,
  `Next_Date` varchar(254) DEFAULT NULL,
  `Next_Date1` date DEFAULT '0000-00-00',
  `Next_Date2` date DEFAULT '0000-00-00',
  `Next_Date3` date DEFAULT '0000-00-00',
  `Next_Date4` date DEFAULT '0000-00-00',
  `Next_Date5` date DEFAULT '0000-00-00',
  `Next_Date_Country` varchar(254) DEFAULT NULL,
  `Next_Date_Country1` date DEFAULT NULL,
  `Next_Month_AF` varchar(254) DEFAULT NULL,
  `Next_M_Next_Date` varchar(254) DEFAULT NULL,
  `Next_M_Next_Date1` date DEFAULT NULL,
  `Our_Ref` varchar(254) DEFAULT NULL,
  `Owner1` varchar(254) NOT NULL DEFAULT '',
  `Owner2` varchar(254) DEFAULT NULL,
  `Owner3` varchar(100) DEFAULT '',
  `Owner4` varchar(100) DEFAULT '',
  `Owner5` varchar(100) DEFAULT '',
  `Owner6` varchar(100) DEFAULT '',
  `Owner7` varchar(100) DEFAULT '',
  `Owner8` varchar(100) DEFAULT '',
  `Owner9` varchar(100) DEFAULT '',
  `Owner10` varchar(100) DEFAULT '',
  `Patent_Countries` varchar(254) DEFAULT NULL,
  `Prio_SN` varchar(254) DEFAULT NULL,
  `Prio_SN2` varchar(30) DEFAULT NULL,
  `Prio_SN3` varchar(30) DEFAULT NULL,
  `Prio_SN4` varchar(30) DEFAULT NULL,
  `Prio_SN5` varchar(30) DEFAULT NULL,
  `Prio_SN6` varchar(30) DEFAULT NULL,
  `Prio_SN7` varchar(30) DEFAULT NULL,
  `Prio_SN8` varchar(30) DEFAULT NULL,
  `Prio_FF_Date` varchar(254) DEFAULT NULL,
  `Prio_FF_Date1` date DEFAULT '0000-00-00',
  `Prio_FF_Date2` date DEFAULT '0000-00-00',
  `Prio_FF_Date3` date DEFAULT '0000-00-00',
  `Prio_FF_Date4` date DEFAULT '0000-00-00',
  `Prio_FF_Date5` date DEFAULT '0000-00-00',
  `Prio_FF_Date6` date DEFAULT '0000-00-00',
  `Prio_FF_Date7` date DEFAULT '0000-00-00',
  `Prio_FF_Date8` date DEFAULT '0000-00-00',
  `Pub_Num` varchar(254) DEFAULT NULL,
  `Pub_Date` varchar(254) DEFAULT NULL,
  `Pub_Date1` date DEFAULT '0000-00-00',
  `Related_Files` varchar(254) DEFAULT NULL,
  `Report_Date` varchar(254) DEFAULT NULL,
  `Report_Date1` date DEFAULT '0000-00-00',
  `Summary` varchar(254) DEFAULT NULL,
  `Update_Num` varchar(254) DEFAULT NULL,
  `What` varchar(254) DEFAULT NULL,
  `What1` varchar(50) DEFAULT '',
  `What2` varchar(50) DEFAULT '',
  `What3` varchar(50) DEFAULT '',
  `What4` varchar(50) DEFAULT '',
  `What5` varchar(50) DEFAULT '',
  `Who` varchar(254) DEFAULT NULL,
  `Y_ref` varchar(254) DEFAULT NULL,
  `State_dep` varchar(254) DEFAULT NULL,
  `State_dep_num` varchar(254) DEFAULT NULL,
  `chg_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `fmpro_id` int(10) unsigned zerofill NOT NULL AUTO_INCREMENT,
  `pay_ann_fee` char(1) NOT NULL DEFAULT '',
  PRIMARY KEY (`fmpro_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1





Alex
Comment 1 Alex Thurgood 2013-06-11 05:48:19 UTC
Created attachment 80649 [details]
apple crash trace 20130611
Comment 2 Alex Thurgood 2013-06-11 06:06:05 UTC
Running LO master 4.2 from within gdb, I can not cause LO to crash.


Running LO master 4.2 from the console, LO crashes, dumping the following to the console :

MacBookPro:~ alex$ /Applications/LibreOfficeDev.app/Contents/MacOS/soffice
soffice(7110,0xac03ea28) malloc: *** mmap(size=4278190080) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
libc++abi.dylib: terminate called throwing an exception
Abort trap: 6


So this has something to do with memory allocation ?

Unfortunately, the message doesn't help me very much, but it might someone else.


Alex
Comment 3 Alex Thurgood 2013-06-11 06:08:30 UTC
@Lionel, Julien : any clues ?



Alex
Comment 4 Alex Thurgood 2013-06-11 06:24:49 UTC
Ok, so I re-ran with gdb and tried setting a breakpoint in malloc_error_break, which led to this :

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0xa03b57fa
0x1aa5a778 in net_field_length ()


info frame
Stack level 0, frame at 0xbfffc1f0:
 eip = 0x1aa5a778 in net_field_length; saved eip 0x1aa69b26
 called by frame at 0xbfffc280
 Arglist at 0xbfffc1e8, args: 
 Locals at 0xbfffc1e8, Previous frame's sp is 0xbfffc1f0
 Saved registers:
  ebp at 0xbfffc1e8, eip at 0xbfffc1ec

(gdb) info locals
No symbol table info available.
(gdb) info args
No symbol table info available.


Alex
Comment 5 Julien Nabet 2013-06-11 18:45:26 UTC
Alex: could you save us some time and give sql script to insert lines you have?:-)
Comment 6 Alex Thurgood 2013-06-12 07:32:13 UTC
(In reply to comment #5)
> Alex: could you save us some time and give sql script to insert lines you
> have?:-)

Hi Julien,

Would love to, but unfortunately, the information in that table is confidential :-/


Alex
Comment 7 Alex Thurgood 2013-06-12 07:38:51 UTC
(In reply to comment #6)

I'm going to see if I can whittle down the table definition (and corresponding data) to the minimum required to produce the crash, but this may take some time. In the meanwhile, it is back to LO 3.6.


Alex
Comment 8 Lionel Elie Mamane 2014-08-08 09:54:44 UTC
This looks similar to bug 70496 which was caused by https://mariadb.atlassian.net/browse/CONC-60 , so please check if you can reproduce with a more recent MySQL-LibreOffice native connector.
Comment 9 Alex Thurgood 2014-08-08 14:49:37 UTC
Unfortunately, there is not a more recent connector available on OSX, it refuses to either compile using the defaults, or even if I specifically export the paths via export MARIADBCONFIG="/Volumes/HD1/Shared/Repos/LO/packages/mysql-connector-c-6.1.2-osx10.7-x86_64/bin/mysql_config", and other compile time link trickery the extension throws an error :

Impossible d'établir la connexion à la source de données "directremotemysqlosx64".

Statut SQL: 08001

Unable to load the libmysqlcppconn.dylib library.

I guess this will likely not get resolved until bug 46259 and bug 76620 are resolved
Comment 10 Alex Thurgood 2014-09-17 17:34:11 UTC
With my latest connector build against 

export MARIADBCONFIG="/Volumes/HD1/Shared/Repos/LO/packages/mysql-connector-c-6.1.5-osx10.7-x86_64/bin/mysql_config" 

I can now access the table without crashing

closing as wfm