Tag Archive: bug


Did you ever receive the error 17283 “Procedure ‘sp_extendsegment’, Line 182 ‘tempdev1′ is reserved exclusively as a log device.” error? You can get the 17283 error when there is a device fragment that contains only the log segment. Part of the problem is when you extend the log segment onto a device, it will usually drop all other segments so it becomes ‘log only’.

 device_fragments               size          usage                created             free kbytes
 ------------------------------ ------------- -------------------- ------------------- ----------------
 master                                8.0 MB data and log         Dec 16 2004  4:09AM             3376
 tempdev1                           1024.0 MB data and log         Dec 16 2004  7:02AM          1044480
 tempdev1                            256.0 MB data and log         Mar  9 2005 10:49AM           261120
 tempdev1                            256.0 MB log only             Mar  9 2005 10:54AM not applicable
 tempdev1                            488.0 MB data and log         Mar  9 2005 12:10PM           497760
 tempdev1                            256.0 MB data and log         Mar 11 2005  2:03PM           261120
 tempdev1                            244.0 MB data and log         Mar 11 2005  3:09PM           248880
 tempdev1                            200.0 MB data and log         Jun  1 2005 12:33PM           204000
 tempdev1                            200.0 MB data and log         Jul  8 2005  2:55PM           203808
 tempdev1                            200.0 MB data and log         Jul 21 2005  2:54PM           204000
 tempdev1                           1000.0 MB data and log         Feb  6 2006  1:11PM          1020000

So, how to fix this? Well, Sybase doesn’t provide any way to do so without modifying the system tables.

use master
exec sp_configure "allow updates", 1
go
begin tran
go
– since we are dealing with tempdb and we want data and log on all the device fragments, we can make a blanket update.  We would make the update more selective if we had other requirements (update only one row or something)
update sysusages set segmap = 7 where dbid = db_id("tempdb")
go
– if the number of rows updated exceed the number of rows for the database, issue a ‘rollback’
select segmap from sysusages where dbid = db_id("tempdb")
go
– all good?  if so, issue a ‘commit’
commit tran
go
exec sp_configure "allow updates", 0
go
– Now that the system table is updated, we need to refresh the dbtable memory structure so that the changes we made become ‘live’
dbcc dbrepair(tempdb, remap)
go

That’s it! It’s fixed and running with the segmaps without having to restart ASE. Wasn’t that easy?

If you are going to be using ASE 12.5 or ASE 15 with the upcoming Red Hat Enterprise Linux 5.0, there are two CRs that you need to know about:

  1. CR 450004 – XP Server and Backupserver (64bit)
  2. CR 432482 – ASE 15

The problem is the result of using the jmp() and longjmp() functions in the GNU C Library version 2.4 (glibc 2.4).

setjmp() and longjmp() are useful for dealing with errors and interrupts encountered in a low-level subroutine of a program. setjmp() saves the stack context/environment in env for later use by longjmp(). The stack context will be invalidated if the function which called setjmp() returns.

Starting in glibc 2.4, the jmpbuf is unavailable due to a security exploit known for several years.  Restricting access to the jmpbuf was an effort by the glibc maintainers to ‘close this hole’ by forcing the application writers to use the sigsetjmp() and siglongjmp() instead.

The problem with using sigsetjmp() and siglongjmp() is that they aren’t thread safe.  This is supposed to be fixed in glibc 2.6 according to a contact at Sybase but Sybase *does* have a workaround for this issue and will be putting it into the ASE v15 codeline when they perform the RHEL 5 certification sometime next year.

I wasn’t able to find much information the supposed exploit.  I only found a few newsgroup posts that didn’t provide any details.

View full article »