View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002957 | FSSCP | multiplayer | public | 2013-11-19 06:23 | 2013-11-20 06:43 |
Reporter | chief1983 | Assigned To | chief1983 | ||
Priority | normal | Severity | crash | Reproducibility | have not tried |
Status | resolved | Resolution | fixed | ||
Platform | x86-64 | OS | FreeBSD | OS Version | 9.2 |
Product Version | 3.7.1 | ||||
Target Version | 3.7.2 | ||||
Summary | 0002957: *nix Standalone crash on assertion failure | ||||
Description | Beam couldn't find a good object model/type!! (0) Beam couldn't find a good object model/type!! (0) vm_forward_interpolate: Bad rotation vm_forward_interpolate: Bad rotation ASSERTION: "RAND_MAX == 0x7fffffff" at systemvars.cpp:123 | ||||
Steps To Reproduce | Had two Windows 7 clients connected to the WebUI standalone on my FreeBSD machine, running r10121, playing Aeolus Duel, when a couple minutes in, the standalone server crashed out with the assertion above. | ||||
Additional Information | I'm guessing RAND_MAX isn't 0x7fffffff or 0x7fff on this particular platform. The rand32 function probably needs to be expanded to be more flexible, like maybe supporting any number of bits between 16 and 32, or possibly a RAND_MAX higher than 32 bits. Not sure what the case was here when it crashed, other than it broke. | ||||
Tags | No tags attached. | ||||
|
From the /usr/include/stdlib.h on FreeBSD 9.2: #define RAND_MAX 0x7ffffffd rand32() assumes it is either 0x7fff (MSVC, etc) and goes one way, or Asserts that it is 0x7fffffff, which it is not quite on FreeBSD, leading to a debug build crash when rand32 is called. Surprised it took me a few minutes of playing to crash, must not be called except in certain situations. So it looks like rand32 could use a slight overhaul, maybe to at least make sure that if RAND_MAX is not 0x7fffffff, that we try to make a 32bit random number out of however many bits we do have. |
|
More info on the FreeBSD RAND_MAX change found via http://freebsd.1045724.n5.nabble.com/RAND-MAX-issue-td5839987.html Maybe consider upgrading to the Mersenne Twister http://www.bedaux.net/mtrand/ |
|
This issue was created by 0001823. Assert(RAND_MAX >= 0x7ffffffd); would probably handle this, and let us catch any with a RAND_MAX between MSVC and FreeBSD in the future. |
|
Fix committed to trunk@10129. |
fs2open: trunk r10129 2013-11-20 02:11 Ported: N/A Details Diff |
Fix 0002957 - FreeBSD RAND_MAX is 0x7ffffffd, not 0x7fffffff, so we can't always assume that it's the latter. Also move the check earlier in the code, if it's going to break at all, break immediately on any non-conforming platform so we can fine tune this some more. |
Affected Issues 0002957 |
|
mod - /trunk/fs2_open/code/freespace2/freespace.cpp | Diff File | ||
mod - /trunk/fs2_open/code/globalincs/systemvars.cpp | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2013-11-19 06:23 | chief1983 | New Issue | |
2013-11-19 19:59 | chief1983 | Note Added: 0015425 | |
2013-11-19 20:35 | chief1983 | Note Added: 0015426 | |
2013-11-19 20:38 | chief1983 | Note Edited: 0015426 | |
2013-11-19 22:52 | chief1983 | Assigned To | => karajorma |
2013-11-19 22:52 | chief1983 | Status | new => assigned |
2013-11-19 23:05 | chief1983 | Note Added: 0015428 | |
2013-11-19 23:28 | chief1983 | Assigned To | karajorma => chief1983 |
2013-11-20 06:43 | chief1983 | Changeset attached | => fs2open trunk r10129 |
2013-11-20 06:43 | chief1983 | Note Added: 0015432 | |
2013-11-20 06:43 | chief1983 | Status | assigned => resolved |
2013-11-20 06:43 | chief1983 | Resolution | open => fixed |