>Subject: Sybase Ultralite Error "44" Segment problem
>From: "Chris Yourch" <[EMAIL PROTECTED]>
>Date: Tue, 05 Dec 2000 16:56:14 -0500
>X-Message-Number: 58
>
>Hi,
>
>I have a fairly large Sybase Ultralite application (300k) and I am getting
>an unknown error "44" when I run the application. Specifically, I am calling
>new (which works fine) on my main database class on a normal launch and I do
>get into my constructor for the class but the first line of code in the
>constructor never gets executed.
>
I work on application which is at the moment 670kB long (optimized, without debug
info) and I know exactly what problem do you have, because we have the
same. I don't know how to solve it, but at least there is workaround we use.
1) Switch off #define UL_ENABLE_SEGMENTS - this is a line which makes problems!
2) Take your ULDatabase.cpp and insert into it files #pragma segment
ultralite_problem1 (2,3,4... you know how much of them you need)
3) recompile (take care about size of segments 64kB max)
it should run until your ULDatabase.hpp file isn't more then 300kB long, then there
comes another problem. It looks that CodeWarrior put all methods from
this file (which should be inlined anyway) into first segment - in our case first
segment was 161kB long. That's why I wrote small program for Micro$oft
Windoze which strips unused (in my case) methods. If you (or anyone else) wants I may
send it (compiled witch cygnus gcc, it is really short but needs one
194kB long .dll :-( ), just mail me if you want.
With this help I can normally work with my project (670kB with inlining on,
optimalisation 4 a no debug info, 780kb with no inlining, no optimalisation and
all debug info on). The only problem I have at the moment is a too small data segment
- I have 1kb of global variables, but thanks to ultralite I lost nearly
60kB.... If you (or anyone else) know how to solve this (very serious) problem, let me
know soon! This is the same problem why we cannot use GNU tools (which I
prefer to CodeWarrior) - they cannot handle so much data to one segment. (I am able
to compile but I cannot link :-() People from palm-gnu-tools-section,
please do something so the best compiler could be used for something bigger....
>Here's the call stack detail:
>
>00001872: FFFF dc.w 0xffff ; Invalid opcode
>0001874: 00000000 ori.b #0x0,d0
>0001878: 00000000 ori.b #0x0,d0
>000187C: 00000000 ori.b #0x0,d0
>0001880: 00000000 ori.b #0x0,d0
>0001884: 00000000 ori.b #0x0,d0
>0001888: 00000000 ori.b #0x0,d0
>000188C: 00000000 ori.b #0x0,d0
>0001890: 00000000 ori.b #0x0,d0
How many times I have seen the same...;-)
>
>There's some more details:
> Normal launch.
> 'new CMyDatabaseClass;' is being called in my PilotMain().
> 59 total segments as reported in the MAP file.
>UL_ENABLE_SEGMENTS is defined so that the #pragma segment directives in
>the generated Ultralite CPP file are turned on.
>- It is a multi-segment app.
>- PilotMain() is in the first segment.
>- All code for the database class is in the first segment.
>- Smart model.
Yes, as I said... We even sent it as bug to Sybase but looks they forgot us.... They
promised answer until end of September 2000 and they mailed in half of
October then they cannot find the problem....they think it is linker error.... and no
more news... :-( Anyway I think the problem is when you have a table in
publication or select in project which is unused - linker tries to be inteligent and
methods from this class aren't included in binary file, BUT because of
#pragma segment before each class it produces empty segments (12 bytes long). I think
PalmOS cannot handle empty code segments... Am I right?
So maybe it could help to check the selects (and publication) and remove unused items
- but I am not sure what happens when table is removed from publication
and is still used in select - I have no time to experiment at the moment, deadline is
soon....
>
>I suspect I am running into some kind of segment related problem.
>
>Any ideas?
>
>Regards,
>Chris
bye
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/