[fdo-trac] #423: ClientServices build failure with 3.3.2RC2 on 64bit linux

FDO trac_fdo at osgeo.org
Tue Nov 11 13:53:29 EST 2008


#423: ClientServices build failure with 3.3.2RC2 on 64bit linux
-----------------------+----------------------------------------------------
 Reporter:  warmerdam  |         Owner:  gregboone
     Type:  defect     |        Status:  new      
 Priority:  minor      |     Milestone:           
Component:  FDO API    |       Version:  3.3.2    
 Severity:  3          |    Resolution:           
 Keywords:  64bit      |   External_id:           
-----------------------+----------------------------------------------------
Comment (by warmerdam):

 I will note this represents an actual problem on my system with the code
 in question which appears to process /proc/self/maps on linux to get a
 list of loaded shared libraries.  The code is:

 {{{
                 unsigned int start, end;

                 if (!fgets (line, sizeof (line), f))
                         continue;
                 if (!strstr (line, " r-xp ") || !strchr (line, '/'))
                         continue;

                 sscanf (line, "%x-%x ", &start, &end);
                 if (((unsigned int) symbol) >= start && ((unsigned int)
 symbol) < end)
                 {
 }}}

 But on my system /proc/self/maps looks like:

 {{{
 2b9a8d4a1000-2b9a8d4a3000 rw-p 00154000 03:02 1045194
 /lib/libc-2.6.1.so
 }}}

 So the start and end values really should be longs and the sscanf should
 be using %lx.  Even this somewhat better approach seems to be a bit risky
 as far as portability goes. Frankly - I'm not clear why we even need such
 esoteric functionality.

 I have patched things with:

 {{{
                 unsigned long start, end;

                 if (!fgets (line, sizeof (line), f))
                         continue;
                 if (!strstr (line, " r-xp ") || !strchr (line, '/'))
                         continue;

                 sscanf (line, "%lx-%lx ", &start, &end);
                 if (((unsigned long) symbol) >= start && ((unsigned long)
 symbol) < end)
                 {
 }}}

 this seems to build cleanly though I don't know how to exercise it.

-- 
Ticket URL: <http://trac.osgeo.org/fdo/ticket/423#comment:1>
FDO <http://fdo.osgeo.org/>
Feature Data Objects


More information about the fdo-trac mailing list