Bug#580788: Endiannes issue

Łukasz Jernaś deejay1 at srem.org
Thu May 27 20:29:38 UTC 2010


This is an endiannes issue, backtrace from SPARC:

Reading symbols from
/home/deejay1/packaging/memphis-0.2.2/tests/.libs/lt-unit-tests...done.
(gdb) r
Starting program:
/home/deejay1/packaging/memphis-0.2.2/tests/.libs/lt-unit-tests
[Thread debugging using libthread_db enabled]
/map/new: OK
/map/free: OK
/map/load_data: OK
/map/load_file: OK
/rule/new: OK
/rule_set/new: OK
/rule_set/free: OK
/rule_set/load_data:
Program received signal SIGBUS, Bus error.
0xf7b2ceec in _IO_vfscanf () from /lib/libc.so.6
(gdb) bt
#0  0xf7b2ceec in _IO_vfscanf () from /lib/libc.so.6
#1  0xf7b31fd4 in __isoc99_vsscanf () from /lib/libc.so.6
#2  0xf7b31f2c in __isoc99_sscanf () from /lib/libc.so.6
#3  0xf7c80f90 in cfgStartElement (userData=0x60000, name=0x5ca40
"rules", atts=0x2dee8) at ruleset.c:89
#4  0xf7ca5b08 in doContent (parser=0x62200, startTagLevel=0, enc=0xf7cd42a4,
   s=0x2ec30 "<rules version=\"0.1\" autor=\"MariusRieder\"
background=\"#f0f0f0\">      <rule e=\"way\" k=\"highway\" v=\"*\">
     <line color=\"#000000\" width=\"1.0\"/>      </rule>  </rules>",
end=0x2ecd9 "", nextPtr=0x62218, haveMore=1 '\001')
   at ../lib/xmlparse.c:2360
#5  0xf7ca6b90 in contentProcessor (parser=0x62200, start=0x2ec30
"<rules version=\"0.1\" autor=\"MariusRieder\" background=\"#f0f0f0\">
    <rule e=\"way\" k=\"highway\" v=\"*\">          <line
color=\"#000000\" width=\"1.0\"/>      </rule>  </rules>",
   end=0x2ecd9 "", endPtr=0x62218) at ../lib/xmlparse.c:2022
#6  0xf7ca8368 in doProlog (parser=0x62200, enc=0xf7cd42a4, s=0x2ec30
"<rules version=\"0.1\" autor=\"MariusRieder\" background=\"#f0f0f0\">
    <rule e=\"way\" k=\"highway\" v=\"*\">          <line
color=\"#000000\" width=\"1.0\"/>      </rule>  </rules>",
   end=0x2ecd9 "", tok=29, next=0x2ec30 "<rules version=\"0.1\"
autor=\"MariusRieder\" background=\"#f0f0f0\">      <rule e=\"way\"
k=\"highway\" v=\"*\">          <line color=\"#000000\"
width=\"1.0\"/>      </rule>  </rules>", nextPtr=0x62218, haveMore=1
'\001')
   at ../lib/xmlparse.c:3908
#7  0xf7ca89f0 in prologProcessor (parser=0x62200,
   s=0x2ec08 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>  <rules
version=\"0.1\" autor=\"MariusRieder\" background=\"#f0f0f0\">
<rule e=\"way\" k=\"highway\" v=\"*\">          <line
color=\"#000000\" width=\"1.0\"/>      </rule> "..., end=0x2ecd9 "",
   nextPtr=0x62218) at ../lib/xmlparse.c:3635
#8  0xf7c9fa8c in XML_ParseBuffer (parser=0x62200, len=<value
optimized out>, isFinal=0) at ../lib/xmlparse.c:1573
#9  0xf7c80c80 in rulesetRead_from_buffer (
   buffer=0xffffd340 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<rules version=\"0.1\" autor=\"MariusRieder\" background=\"#f0f0f0\">
   <rule e=\"way\" k=\"highway\" v=\"*\">          <line
color=\"#000000\" width=\"1.0\"/>      </rule> "..., size=209,
   error=0xffffd4c4) at ruleset.c:407
#10 0xf7c85520 in memphis_rule_set_load_from_data (rules=<value optimized out>,
   data=0xffffd340 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<rules version=\"0.1\" autor=\"MariusRieder\" background=\"#f0f0f0\">
   <rule e=\"way\" k=\"highway\" v=\"*\">          <line
color=\"#000000\" width=\"1.0\"/>      </rule> "..., size=209,
   error=0xffffd4c4) at memphis-rule-set.c:170
#11 0x000131e0 in rule_set_load_data () at unit-tests.c:120
#12 0xf7ebcaac in test_case_run (suite=0x2d290, path=0xf7f27398 "") at
/build/buildd-glib2.0_2.24.1-1-sparc-nycaVE/glib2.0-2.24.1/glib/gtestutils.c:1138
#13 g_test_run_suite_internal (suite=0x2d290, path=0xf7f27398 "") at
/build/buildd-glib2.0_2.24.1-1-sparc-nycaVE/glib2.0-2.24.1/glib/gtestutils.c:1187
#14 0xf7ebcc40 in g_test_run_suite_internal (suite=<value optimized
out>, path=0xf7f27398 "") at
/build/buildd-glib2.0_2.24.1-1-sparc-nycaVE/glib2.0-2.24.1/glib/gtestutils.c:1197
#15 0xf7ebcf90 in IA__g_test_run_suite (suite=0x2d210) at
/build/buildd-glib2.0_2.24.1-1-sparc-nycaVE/glib2.0-2.24.1/glib/gtestutils.c:1238
#16 0x00011564 in main (argc=1, argv=0xffffd814) at unit-tests.c:540

Offending code part:

if(sscanf((char *) *(atts+1),"#%2x%2x%2x%2x",
                        (unsigned int *)&ruleset->background[0],
                        (unsigned int *)&ruleset->background[1],
                        (unsigned int *)&ruleset->background[2],
                        (unsigned int *)&ruleset->background[3])
                        < 4)
                {
                    // Default background alpha value
                    ruleset->background[3] = 255;
                }
where atts passed to the function as "const char **atts"

Ideas on how to fix it are welcome…

-- 
Łukasz [DeeJay1] Jernaś





More information about the pkg-gnome-maintainers mailing list