Issue 35209

Summary: soffice crashes during startup in valgrind-2.2.0
Product: porting Reporter: matthias.huetsch
Component: codeAssignee: matthias.huetsch
Status: CLOSED FIXED QA Contact: issues@porting <issues>
Severity: Trivial    
Priority: P2 CC: caolanm, issues
Version: 680m55   
Target Milestone: OOo 2.0   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---

Description matthias.huetsch 2004-10-08 16:23:57 UTC
In valgrind versions newer than 2.0.0 (e.g. the latest stable 2.2.0 release),
soffice crashes during startup due to resource files (*.res) not found. This
needs to be fixed in order to ensure further OOo testability using valgrind,
callgrind et al.

Resource files (*.res) are located under '.../program/resource/' and are
searched for using 'osl_getExecutableFile()', which is supposed to return
'.../program/soffice.bin'. When run under valgrind, it happens to return
'/usr/local/bin/valgrind' instead, and resource files are thus searched for (and
obviously not found) under '/usr/local/bin/...'.

The function 'osl_getExecutableFile()', and the related functions
'osl_getCommandArg[Count]()', are based on unportable assumptions about how to
obtain a processes command line (e.g. via the '/proc' filesystem), instead of
relying on a standardized API 'main(int argc, char * argv[])', and those
assumptions do fail here (and can do so elsewhere).

A proposed fix introduces a new function 'osl_setCommandArgs(int argc, char *
argv[])', and adapts the various main() functions accordingly (ideally they
already use the recommended 'SAL_IMPLEMENT_MAIN()' macro).
Comment 1 matthias.huetsch 2004-10-08 16:27:05 UTC
For reference, see also Caolan's blog at
http://blogs.linux.ie/caolan/2004/08/30/callgrind-and-ooo/

Will be fixed on cws 'valgrind02'.
Comment 2 matthias.huetsch 2004-10-08 16:44:52 UTC
Accepting...
Comment 3 matthias.huetsch 2004-10-21 11:04:40 UTC
Fixed on cws_src680_valgrind02...
Comment 4 b.osi.ooo 2004-10-28 17:00:11 UTC
TBO: verified
Comment 5 matthias.huetsch 2004-11-14 17:39:09 UTC
Fix integrated into milestone 680m60 (alias 1.9.m60) => closing.
Comment 6 mmeeks 2004-12-15 14:29:29 UTC
*** Issue 38037 has been marked as a duplicate of this issue. ***