UFO: Alien Invasion Issue Tracker
UFO: Alien Invasion
Go to the previous open issue
Go to the previous issue (open or closed)
star_faded.png
Please log in to bookmark issues
icon_project.png UFO: Alien Invasion / Closed Bug report #2044 assert in cmodel.c (int overflow)
Go to the next issue (open or closed)
Go to the next open issue
This issue has been closed with status "Closed" and resolution "Not determined".
Issue basics
  • Type of issue
    Bug report
  • Category
    Engine
  • Targetted for
    Not determined
  • Status
    Closed
  • Priority
    2. Low
User pain
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
Affected by this issue (0)
There are no items
People involved
Times and dates
  • Posted at
  • Last updated
  • Estimated time
    Not estimated
Issue details
  • Resolution
    Not determined
  • Reproducability
    Not determined
  • Severity
    Not determined
  • Complexity
    Not determined
  • Platform
    Not determined
  • Architecture
    Not determined
Attachments (0)
There is nothing attached to this issue
Duplicate issues (0)
This issue does not have any duplicates
Description
[http://sourceforge.net/p/ufoai/bugs/2044 Item 2044] imported from sourceforge.net tracker on 2013-01-28 19:18:54

On my Mac, i cannot launch any missions as map-loading always crashes.
i have not recreated the maps but downloaded them, maybe this already might fix the problem (gonna try) but nevertheless this might be a problem:
(curTile->wpMaxs wraps around because of an overflow)

==== InitGame ====
music change to van_theme (from van_theme)
SV_ParseAssembly: warning - cvar 'rm_drop' value doesn't seam to be a valid tile id '' - set to default '+drop_firebird'
CM_LoadMap: "-africa/af_ +main +drop_firebird" "-40 -16 0 -40 -16 0"
Map:africa/af_main Offset:(-40, -16, 0)
wpMins:(-2147483648, -2147483648, 0) wpMaxs:(-687865856, -1627389952, 67108864)
Shifted wpMins:(2147483608, 2147483632, 0) wpMaxs:(-687865896, -1627389968, 67108864)
Assertion failed: (minX <= maxX), function CMod_LoadRouting, file src/common/cmodel.c, line 831.

Program received signal SIGABRT, Aborted.
0x96970af0 in __kill ()
(gdb) bt
#0 0x96970af0 in __kill ()
#1 0x96a0bbb0 in abort ()
#2 0x969febc0 in __assert_rtn ()
#3 0x00112bf4 in CMod_LoadRouting (name=0xbfffbc40 "africa/af_main", l=0xbfffbb48, sX=-40, sY=-16, sZ=0) at src/common/cmodel.c:831
#4 0x00113c80 in CM_AddMapTile (name=0xbfffbc40 "africa/af_main", day=qtrue, sX=-40, sY=-16, sZ=0 &#039;\000&#039;) at src/common/cmodel.c:1054
#5 0x001147d4 in CM_LoadMap (tiles=0x1d35745 " +drop_firebird", day=qtrue, pos=0x1d33e3e " -40 -16 0", mapchecksum=0xbfffbd30) at src/common/cmodel.c:1198
#6 0x0014a1f8 in SV_SpawnServer (day=qtrue, server=0xbfffbdf0 "+africa", param=0x0) at src/server/sv_init.c:1112
#7 0x0014a83c in SV_Map (day=qtrue, levelstring=0xbfffbdf0 "+africa", assembly=0x0) at src/server/sv_init.c:1225
#8 0x001445d4 in SV_Map_f () at src/server/sv_ccmds.c:190
#9 0x0010bea0 in Cmd_ExecuteString (text=0xbffff0b4 "map day +africa ") at src/common/cmd.c:912
#10 0x0010a398 in Cbuf_Execute () at src/common/cmd.c:229
#11 0x00039da8 in CL_SendCommand () at src/client/cl_main.c:1257
#12 0x0003a66c in CL_Frame (now=34994, data=0x0) at src/client/cl_main.c:1441
#13 0x0011cb28 in tick_timer (now=34994, data=0x16ca03bc) at src/common/common.c:1092
#14 0x0011cf4c in Qcommon_Frame () at src/common/common.c:1173
#15 0x0018c6f8 in main (argc=1, argv=0xbffff718) at src/ports/macosx/osx_main.m:142
(gdb) frame 3
#3 0x00112bf4 in CMod_LoadRouting (name=0xbfffbc40 "africa/af_main", l=0xbfffbb48, sX=-40, sY=-16, sZ=0) at src/common/cmodel.c:831
831 assert(minX <= maxX);
Current language: auto; currently c
(gdb) p minX
$1 = 2147483608
(gdb) p maxX
$2 = -687865896
(gdb) p sX
$3 = -40
(gdb) p -2147483648 + sX
$4 = 2147483608
(gdb) kill

===== Comments Ported from Sourceforge =====

====== tlh2000 (2009-02-03 15:18:43) ======

looks like an endian issue there - mike any advice from you?
====== zerm (2009-02-03 17:50:11) ======

indeed, endian-issue. did a quick fix in r22282 BUT: need to fix ufo2map aswell or ppc-generated maps will break everything. also, did not check the routing, maybe there needs to be more swapped (temp_map maybe)? wilminator should maybe better take a look :)
====== wilminator (2009-02-04 04:39:49) ======

I think it is the wpMins and wpMaxs variables- they are stored encoded by the compress function and not normalized for endian-ness. I will work on it and cut a patch for that shortly. Or if someone wants to take a stab at it, the code that adds wpMins and wpMaxs to the data stream in routing.c needs to be migrated to use the long int normalizing function to add to the data stream and the compliment function used to decode those values in cmodel.c/CMod_LoadRouting. I may be a while fixing this.
====== wilminator (2009-02-06 06:23:18) ======

I think this patch will fix your issue. We need an intel user to compile the map and a mac user to load and use that map.
====== wilminator (2009-02-06 06:23:50) ======

Endian Patch
====== wilminator (2009-02-06 06:29:21) ======

Actually if this works, you should be able to compile with this patch, re-download your maps, and they should run without modification. The ufo2map code ensures little endian storage and ufo converts that back to the format used by your computer. Since the default is little endian storage, the patch should get up and go with a map from an intel computer.
====== tlh2000 (2009-02-16 11:16:53) ======

the endian issue should be fixed
====== sf-robot (2009-03-18 18:55:28) ======

This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).
====== Missing Comment Alert ======

The importer failed to retrieve a comment in this thread. Please view the old ticket link above for full discussion details.
Steps to reproduce this issue
Nothing entered.
Todos (0 / 0)
Issue created
footer_logo.png The Bug Genie 4.3.1 | Support | Feedback spinning_16.gif